remove certain ControlProtocol signals related to stripable selection
[ardour.git] / libs / surfaces / mackie / strip.cc
index 4fdebb38d705d74456c2d8b3d04ca8f448048d3b..48d170e91c6ee2b7fd4c88b895fdf611833d74a2 100644 (file)
@@ -44,6 +44,7 @@
 #include "ardour/panner_shell.h"
 #include "ardour/phase_control.h"
 #include "ardour/rc_configuration.h"
+#include "ardour/record_enable_control.h"
 #include "ardour/route.h"
 #include "ardour/session.h"
 #include "ardour/send.h"
@@ -214,12 +215,13 @@ Strip::set_stripable (boost::shared_ptr<Stripable> r, bool /*with_messages*/)
 
        _stripable->gain_control()->Changed.connect(stripable_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_gain_changed, this, false), ui_context());
        _stripable->PropertyChanged.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_property_changed, this, _1), ui_context());
+       _stripable->presentation_info().PropertyChanged.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_property_changed, this, _1), ui_context());
 
-       boost::shared_ptr<Track> trk = boost::dynamic_pointer_cast<ARDOUR::Track>(_stripable);
+       boost::shared_ptr<AutomationControl> rec_enable_control = _stripable->rec_enable_control ();
 
-       if (trk) {
-               _recenable->set_control (trk->rec_enable_control());
-               trk->rec_enable_control()->Changed .connect(stripable_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_record_enable_changed, this), ui_context());
+       if (rec_enable_control) {
+               _recenable->set_control (rec_enable_control);
+               rec_enable_control->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_record_enable_changed, this), ui_context());
        }
 
        // TODO this works when a currently-banked stripable is made inactive, but not
@@ -274,6 +276,7 @@ Strip::notify_all()
        notify_mute_changed ();
        notify_gain_changed ();
        notify_property_changed (PBD::PropertyChange (ARDOUR::Properties::name));
+       notify_property_changed (PBD::PropertyChange (ARDOUR::Properties::selected));
        notify_panner_azi_changed ();
        notify_panner_width_changed ();
        notify_record_enable_changed ();
@@ -371,11 +374,15 @@ Strip::notify_processor_changed (bool force_update)
 void
 Strip::notify_property_changed (const PropertyChange& what_changed)
 {
-       if (!what_changed.contains (ARDOUR::Properties::name)) {
-               return;
+       if (what_changed.contains (ARDOUR::Properties::name)) {
+               show_stripable_name ();
        }
 
-       show_stripable_name ();
+       if (what_changed.contains (ARDOUR::Properties::selected)) {
+               if (_stripable) {
+                       _surface->write (_select->set_state (_stripable->presentation_info().selected()));
+               }
+       }
 }
 
 void
@@ -1305,19 +1312,6 @@ Strip::unlock_controls ()
        _controls_locked = false;
 }
 
-void
-Strip::gui_selection_changed (const ARDOUR::StrongStripableNotificationList& rl)
-{
-       for (ARDOUR::StrongStripableNotificationList::const_iterator i = rl.begin(); i != rl.end(); ++i) {
-               if ((*i) == _stripable) {
-                       _surface->write (_select->set_state (on));
-                       return;
-               }
-       }
-
-       _surface->write (_select->set_state (off));
-}
-
 string
 Strip::vpot_mode_string ()
 {