trivially change API of GainMeter but more importantly don't show meter if no Route...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 8 Mar 2016 19:56:07 +0000 (14:56 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 May 2016 19:30:40 +0000 (15:30 -0400)
gtk2_ardour/gain_meter.cc
gtk2_ardour/gain_meter.h

index 47b6d423fb0f96c3a398aceed47406d69bea1f1e..b38e653bac3edd7c0b4364092bbd1e5586782a70 100644 (file)
@@ -251,6 +251,12 @@ GainMeterBase::set_controls (boost::shared_ptr<Route> r,
        gain_changed ();
        show_gain ();
        update_gain_sensitive ();
+
+       if (!_meter) {
+               peak_display.hide ();
+       } else {
+               peak_display.show ();
+       }
 }
 
 void
@@ -975,12 +981,11 @@ GainMeter::GainMeter (Session* s, int fader_length)
        gain_automation_state_button.set_size_request (PX_SCALE(12, 15), PX_SCALE(12, 15));
        gain_automation_style_button.set_size_request (PX_SCALE(12, 15), PX_SCALE(12, 15));
 
-       fader_vbox = manage (new Gtk::VBox());
-       fader_vbox->set_spacing (0);
-       fader_vbox->pack_start (*gain_slider, true, true);
+       fader_vbox.set_spacing (0);
+       fader_vbox.pack_start (*gain_slider, true, true);
 
        fader_alignment.set (0.5, 0.5, 0.0, 1.0);
-       fader_alignment.add (*fader_vbox);
+       fader_alignment.add (fader_vbox);
 
        hbox.pack_start (fader_alignment, true, true);
 
@@ -1042,20 +1047,20 @@ GainMeter::set_controls (boost::shared_ptr<Route> r,
 
        if (_route) {
                _route->active_changed.connect (model_connections, invalidator (*this), boost::bind (&GainMeter::route_active_changed, this), gui_context ());
+               hbox.pack_start (meter_hbox, true, true);
+               meter_hbox.show ();
        }
 
-       /*
-          if we have a non-hidden route (ie. we're not the click or the auditioner),
-          pack some route-dependent stuff.
-       */
-
-       hbox.pack_start (meter_hbox, true, true);
-
 //     if (r && !r->is_auditioner()) {
 //             fader_vbox->pack_start (gain_automation_state_button, false, false, 0);
 //     }
 
-       hbox.show_all ();
+       gain_display_box.show ();
+       gain_display.show ();
+       gain_slider->show ();
+       fader_vbox.show ();
+       fader_alignment.show ();
+       hbox.show ();
        setup_meters ();
 }
 
index 897ae7d1b740a72a3bde4001a6ccc20015b7f3b7..5c6181bf3b5f9e21944f9b19d3aab886e16e7c67 100644 (file)
@@ -232,7 +232,7 @@ class GainMeter : public GainMeterBase, public Gtk::VBox
 
        Gtk::HBox  gain_display_box;
        Gtk::HBox  fader_box;
-       Gtk::VBox* fader_vbox;
+       Gtk::VBox  fader_vbox;
        Gtk::HBox  hbox;
        Gtk::HBox  meter_hbox;
        Gtk::Alignment fader_alignment;