Toggle the shown state of send gain on double click.
authorCarl Hetherington <carl@carlh.net>
Wed, 5 Jan 2011 02:06:15 +0000 (02:06 +0000)
committerCarl Hetherington <carl@carlh.net>
Wed, 5 Jan 2011 02:06:15 +0000 (02:06 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8441 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/mixer_strip.h
gtk2_ardour/processor_box.cc

index b547e54852cc577d434bfe19d899882114b056e0..651c9eace9003349885caaa2c50693a49e173f4b 100644 (file)
@@ -98,6 +98,14 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
        void set_route (boost::shared_ptr<ARDOUR::Route>);
        void set_button_names ();
        void show_send (boost::shared_ptr<ARDOUR::Send>);
+       void revert_to_default_display ();
+
+       /** @return the delivery that is being edited using our fader; it will be the
+        *  last send passed to ::show_send, or our route's main out delivery.
+        */
+       boost::shared_ptr<ARDOUR::Delivery> current_delivery () const {
+               return _current_delivery;
+       }
 
        bool mixer_owned () const {
                return _mixer_owned;
@@ -272,8 +280,6 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
        void set_current_delivery (boost::shared_ptr<ARDOUR::Delivery>);
        boost::shared_ptr<ARDOUR::Delivery> _current_delivery;
        
-       void revert_to_default_display ();
-
        void drop_send ();
        PBD::ScopedConnection send_gone_connection;
 
index 7795035ce0add2f8d59453a5bdc69266c0295026..93a1d14bed153f0ddaef7ca26e10d2479e7e0c29 100644 (file)
@@ -1608,7 +1608,11 @@ ProcessorBox::toggle_edit_processor (boost::shared_ptr<Processor> processor)
                }
 
                if (_parent_strip) {
-                       _parent_strip->show_send (send);
+                       if (boost::dynamic_pointer_cast<Send> (_parent_strip->current_delivery()) == send) {
+                               _parent_strip->revert_to_default_display ();
+                       } else {
+                               _parent_strip->show_send (send);
+                       }
                }
 
        } else if ((retrn = boost::dynamic_pointer_cast<Return> (processor)) != 0) {