fix diamond inheritance - gtkmm main class is sigc::trackable

This commit is contained in:
Robin Gareus 2013-07-28 20:43:21 +02:00
parent cd28d62b26
commit cbcde35376
2 changed files with 12 additions and 10 deletions

View file

@ -43,15 +43,15 @@ using namespace Gtkmm2ext;
using namespace Gtk; using namespace Gtk;
using namespace std; using namespace std;
LevelMeterBase::LevelMeterBase (Session* s, FastMeter::Orientation o) LevelMeterBase::LevelMeterBase (Session* s, PBD::EventLoop::InvalidationRecord* ir, FastMeter::Orientation o)
: _meter (0) : _meter (0)
, parent_invalidator(ir)
, _meter_orientation(o) , _meter_orientation(o)
, meter_length (0) , meter_length (0)
, thin_meter_width(2) , thin_meter_width(2)
{ {
set_session (s); set_session (s);
//set_spacing (1); Config->ParameterChanged.connect (_parameter_connection, parent_invalidator, boost::bind (&LevelMeterBase::parameter_changed, this, _1), gui_context());
Config->ParameterChanged.connect (_parameter_connection, invalidator (*this), boost::bind (&LevelMeterBase::parameter_changed, this, _1), gui_context());
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &LevelMeterBase::on_theme_changed)); UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &LevelMeterBase::on_theme_changed));
ColorsChanged.connect (sigc::mem_fun (*this, &LevelMeterBase::color_handler)); ColorsChanged.connect (sigc::mem_fun (*this, &LevelMeterBase::color_handler));
max_peak = minus_infinity(); max_peak = minus_infinity();
@ -80,8 +80,8 @@ LevelMeterBase::set_meter (PeakMeter* meter)
_meter = meter; _meter = meter;
if (_meter) { if (_meter) {
_meter->ConfigurationChanged.connect (_configuration_connection, invalidator (*this), boost::bind (&LevelMeterBase::configuration_changed, this, _1, _2), 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, invalidator (*this), boost::bind (&LevelMeterBase::meter_type_changed, this, _1), 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; break;
case MeterIEC2BBC: case MeterIEC2BBC:
c[0] = c[1] = c[2] = c[3] = c[4] = c[5] = c[6] = c[7] = c[8] = c[9] = 0xaaaaaaff; 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; break;
case MeterIEC2EBU: case MeterIEC2EBU:
stp[0] = 115.0 * meter_deflect_ppm(-24); // ignored stp[0] = 115.0 * meter_deflect_ppm(-24); // ignored
@ -453,7 +454,7 @@ LevelMeterBase::color_handler ()
} }
LevelMeterHBox::LevelMeterHBox(Session* s) LevelMeterHBox::LevelMeterHBox(Session* s)
: LevelMeterBase(s) : LevelMeterBase(s, invalidator(*this))
{ {
set_spacing(1); set_spacing(1);
show(); show();
@ -474,7 +475,7 @@ LevelMeterHBox::mtr_remove(Gtk::Widget &w) {
LevelMeterVBox::LevelMeterVBox(Session* s) LevelMeterVBox::LevelMeterVBox(Session* s)
: LevelMeterBase(s, FastMeter::Horizontal) : LevelMeterBase(s, invalidator(*this), FastMeter::Horizontal)
{ {
set_spacing(1); set_spacing(1);
show(); show();

View file

@ -49,12 +49,12 @@ namespace Gtk {
class Menu; class Menu;
} }
class LevelMeterBase : public sigc::trackable, public ARDOUR::SessionHandlePtr class LevelMeterBase : public ARDOUR::SessionHandlePtr
{ {
public: public:
LevelMeterBase (ARDOUR::Session*, LevelMeterBase (ARDOUR::Session*, PBD::EventLoop::InvalidationRecord* ir,
Gtkmm2ext::FastMeter::Orientation o = Gtkmm2ext::FastMeter::Vertical); Gtkmm2ext::FastMeter::Orientation o = Gtkmm2ext::FastMeter::Vertical);
~LevelMeterBase (); virtual ~LevelMeterBase ();
virtual void set_meter (ARDOUR::PeakMeter* meter); 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; virtual void mtr_remove(Gtk::Widget &w) = 0;
private: private:
PBD::EventLoop::InvalidationRecord* parent_invalidator;
ARDOUR::PeakMeter* _meter; ARDOUR::PeakMeter* _meter;
Gtkmm2ext::FastMeter::Orientation _meter_orientation; Gtkmm2ext::FastMeter::Orientation _meter_orientation;