summaryrefslogtreecommitdiff
path: root/gtk2_ardour/meter_strip.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2015-01-02 21:44:54 +0700
committerPaul Davis <paul@linuxaudiosystems.com>2015-09-16 16:55:17 -0400
commit6b019a495359909a3d1a778ca10cd7df7cc302cc (patch)
tree75746a1e4a3daecd8c9cd0996b3c63d7d1657be4 /gtk2_ardour/meter_strip.cc
parent45d487f16e8be102bfcdefcd950a69c886495b94 (diff)
Move UIConfiguration Singleton into UIConfiguration header
This removes the direct dependence on ardour_ui.h from 39 files
Diffstat (limited to 'gtk2_ardour/meter_strip.cc')
-rw-r--r--gtk2_ardour/meter_strip.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/gtk2_ardour/meter_strip.cc b/gtk2_ardour/meter_strip.cc
index 3279bd64e1..b1199811ef 100644
--- a/gtk2_ardour/meter_strip.cc
+++ b/gtk2_ardour/meter_strip.cc
@@ -38,6 +38,7 @@
#include "logmeter.h"
#include "gui_thread.h"
#include "ardour_window.h"
+#include "ui_config.h"
#include "utils.h"
#include "meterbridge.h"
@@ -58,7 +59,7 @@ PBD::Signal1<void,MeterStrip*> MeterStrip::CatchDeletion;
PBD::Signal0<void> MeterStrip::MetricChanged;
PBD::Signal0<void> MeterStrip::ConfigurationChanged;
-#define PX_SCALE(pxmin, dflt) rint(std::max((double)pxmin, (double)dflt * ARDOUR_UI::config()->get_ui_scale()))
+#define PX_SCALE(pxmin, dflt) rint(std::max((double)pxmin, (double)dflt * UIConfiguration::instance().get_ui_scale()))
MeterStrip::MeterStrip (int metricmode, MeterType mt)
: AxisView(0)
@@ -111,8 +112,8 @@ MeterStrip::MeterStrip (int metricmode, MeterType mt)
nfo_vbox.show();
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &MeterStrip::on_theme_changed));
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
- UIConfiguration::DPIReset.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
+ UIConfiguration::instance().DPIReset.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
}
MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
@@ -299,8 +300,8 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
name_label.signal_button_release_event().connect (sigc::mem_fun(*this, &MeterStrip::name_label_button_release), false);
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &MeterStrip::on_theme_changed));
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
- UIConfiguration::DPIReset.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
+ UIConfiguration::instance().DPIReset.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
Config->ParameterChanged.connect (*this, invalidator (*this), ui_bind (&MeterStrip::parameter_changed, this, _1), gui_context());
sess->config.ParameterChanged.connect (*this, invalidator (*this), ui_bind (&MeterStrip::parameter_changed, this, _1), gui_context());
@@ -414,7 +415,7 @@ MeterStrip::fast_update ()
float mpeak = level_meter->update_meters();
if (mpeak > max_peak) {
max_peak = mpeak;
- if (mpeak >= ARDOUR_UI::config()->get_meter_peak()) {
+ if (mpeak >= UIConfiguration::instance().get_meter_peak()) {
peak_display.set_active_state ( Gtkmm2ext::ExplicitActive );
}
}
@@ -544,8 +545,8 @@ MeterStrip::on_size_allocate (Gtk::Allocation& a)
tnh = 4 + std::max(2u, _session->track_number_decimals()) * 8; // TODO 8 = max_with_of_digit_0_to_9()
}
- nh *= ARDOUR_UI::config()->get_ui_scale();
- tnh *= ARDOUR_UI::config()->get_ui_scale();
+ nh *= UIConfiguration::instance().get_ui_scale();
+ tnh *= UIConfiguration::instance().get_ui_scale();
int prev_height, ignored;
bool need_relayout = false;
@@ -810,7 +811,7 @@ MeterStrip::name_changed () {
}
const int tnh = 4 + std::max(2u, _session->track_number_decimals()) * 8; // TODO 8 = max_width_of_digit_0_to_9()
// NB numbers are rotated 90deg. on the meterbridge -> use height
- number_label.set_size_request(PX_SCALE(18, 18), tnh * ARDOUR_UI::config()->get_ui_scale());
+ number_label.set_size_request(PX_SCALE(18, 18), tnh * UIConfiguration::instance().get_ui_scale());
} else {
number_label.hide();
}