fix diamond inheritance - gtkmm main class is sigc::trackable
authorRobin Gareus <robin@gareus.org>
Sun, 28 Jul 2013 18:43:21 +0000 (20:43 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 28 Jul 2013 18:43:21 +0000 (20:43 +0200)
gtk2_ardour/level_meter.cc
gtk2_ardour/level_meter.h

index 55b90012616f7f6cb28390c96a1993b476e48930..1c09b013ba7b217dbb8620398e886dd7a30a4313 100644 (file)
@@ -43,15 +43,15 @@ using namespace Gtkmm2ext;
 using namespace Gtk;
 using namespace std;
 
-LevelMeterBase::LevelMeterBase (Session* s, FastMeter::Orientation o)
+LevelMeterBase::LevelMeterBase (Session* s, PBD::EventLoop::InvalidationRecord* ir, FastMeter::Orientation o)
        : _meter (0)
+       , parent_invalidator(ir)
        , _meter_orientation(o)
        , meter_length (0)
        , thin_meter_width(2)
 {
        set_session (s);
-       //set_spacing (1);
-       Config->ParameterChanged.connect (_parameter_connection, invalidator (*this), boost::bind (&LevelMeterBase::parameter_changed, this, _1), gui_context());
+       Config->ParameterChanged.connect (_parameter_connection, parent_invalidator, boost::bind (&LevelMeterBase::parameter_changed, this, _1), gui_context());
        UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &LevelMeterBase::on_theme_changed));
        ColorsChanged.connect (sigc::mem_fun (*this, &LevelMeterBase::color_handler));
        max_peak = minus_infinity();
@@ -80,8 +80,8 @@ LevelMeterBase::set_meter (PeakMeter* meter)
        _meter = meter;
 
        if (_meter) {
-               _meter->ConfigurationChanged.connect (_configuration_connection, invalidator (*this), boost::bind (&LevelMeterBase::configuration_changed, this, _1, _2), gui_context());
-               _meter->TypeChanged.connect (_meter_type_connection, invalidator (*this), boost::bind (&LevelMeterBase::meter_type_changed, this, _1), gui_context());
+               _meter->ConfigurationChanged.connect (_configuration_connection, parent_invalidator, boost::bind (&LevelMeterBase::configuration_changed, this, _1, _2), gui_context());
+               _meter->TypeChanged.connect (_meter_type_connection, parent_invalidator, boost::bind (&LevelMeterBase::meter_type_changed, this, _1), gui_context());
        }
 }
 
@@ -322,6 +322,7 @@ LevelMeterBase::setup_meters (int len, int initial_width, int thin_width)
                                        break;
                                case MeterIEC2BBC:
                                        c[0] = c[1] = c[2] = c[3] = c[4] = c[5] = c[6] = c[7] = c[8] = c[9] = 0xaaaaaaff;
+                                       stp[0] = stp[1] = stp[2] = stp[3] = 115.0;
                                        break;
                                case MeterIEC2EBU:
                                        stp[0] = 115.0 * meter_deflect_ppm(-24); // ignored
@@ -453,7 +454,7 @@ LevelMeterBase::color_handler ()
 }
 
 LevelMeterHBox::LevelMeterHBox(Session* s)
-       : LevelMeterBase(s)
+       : LevelMeterBase(s, invalidator(*this))
 {
        set_spacing(1);
        show();
@@ -474,7 +475,7 @@ LevelMeterHBox::mtr_remove(Gtk::Widget &w) {
 
 
 LevelMeterVBox::LevelMeterVBox(Session* s)
-       : LevelMeterBase(s, FastMeter::Horizontal)
+       : LevelMeterBase(s, invalidator(*this), FastMeter::Horizontal)
 {
        set_spacing(1);
        show();
index 0a59f1a337b2ab4485d87931c28cd91411164f41..abb5e327edf1d38e3bd641991adb87a2ba15b3c2 100644 (file)
@@ -49,12 +49,12 @@ namespace Gtk {
        class Menu;
 }
 
-class LevelMeterBase : public sigc::trackable, public ARDOUR::SessionHandlePtr
+class LevelMeterBase : public ARDOUR::SessionHandlePtr
 {
   public:
-       LevelMeterBase (ARDOUR::Session*,
+       LevelMeterBase (ARDOUR::Session*, PBD::EventLoop::InvalidationRecord* ir,
                        Gtkmm2ext::FastMeter::Orientation o = Gtkmm2ext::FastMeter::Vertical);
-       ~LevelMeterBase ();
+       virtual ~LevelMeterBase ();
 
        virtual void set_meter (ARDOUR::PeakMeter* meter);
 
@@ -78,6 +78,7 @@ class LevelMeterBase : public sigc::trackable, public ARDOUR::SessionHandlePtr
        virtual void mtr_remove(Gtk::Widget &w) = 0;
 
   private:
+       PBD::EventLoop::InvalidationRecord* parent_invalidator;
        ARDOUR::PeakMeter* _meter;
        Gtkmm2ext::FastMeter::Orientation _meter_orientation;