MCP: Fix issue with strip "select" buttons that stayed stuck on.
authorBen Loftis <ben@harrisonconsoles.com>
Wed, 17 May 2017 20:55:43 +0000 (15:55 -0500)
committerBen Loftis <ben@harrisonconsoles.com>
Wed, 17 May 2017 20:55:43 +0000 (15:55 -0500)
  * Depending on individual strips to watch the selection property is prone to failure.
  * Stripable_selection_changed() is called when a selection operation is completed.

libs/surfaces/mackie/mackie_control_protocol.cc
libs/surfaces/mackie/strip.cc
libs/surfaces/mackie/strip.h
libs/surfaces/mackie/surface.cc
libs/surfaces/mackie/surface.h

index 0cee0e523b69cd46dd3914df7555b249dc7a7737..3d011c1bb61f2dc6179a75d4291e17d02a836b5e 100644 (file)
@@ -2371,8 +2371,12 @@ MackieControlProtocol::is_mapped (boost::shared_ptr<Stripable> r) const
 void
 MackieControlProtocol::stripable_selection_changed ()
 {
-       boost::shared_ptr<Stripable> s = first_selected_stripable ();
+       //this function is called after the stripable selection is "stable", so this is the place to check surface selection state
+       for (Surfaces::iterator si = surfaces.begin(); si != surfaces.end(); ++si) {
+               (*si)->update_strip_selection ();
+       }
 
+       boost::shared_ptr<Stripable> s = first_selected_stripable ();
        if (s) {
                check_fader_automation_state ();
 
index 719754585730e5b2d3dc7140d62bcb0b96af85f9..3f1ab24da645f4320c89c7e2cdac7731e6fb82f3 100644 (file)
@@ -377,11 +377,13 @@ Strip::notify_property_changed (const PropertyChange& what_changed)
        if (what_changed.contains (ARDOUR::Properties::name)) {
                show_stripable_name ();
        }
+}
 
-       if (what_changed.contains (ARDOUR::Properties::selected)) {
-               if (_stripable) {
-                       _surface->write (_select->set_state (_stripable->is_selected()));
-               }
+void
+Strip::update_selection_state ()
+{
+       if(_stripable) {
+               _surface->write (_select->set_state (_stripable->is_selected()));
        }
 }
 
@@ -1729,6 +1731,7 @@ Strip::setup_eq_vpot (boost::shared_ptr<Stripable> r)
                        case 2:
                                eq_band = global_pos;
                                pc = r->eq_gain_controllable (eq_band);
+                               band_name = r->eq_band_name (eq_band);
                                param = EQGain;
                                break;
                }
index a095f8ebe85f1fdbf84a17b8e9932914dea9787f..a1816f3844c274c1dd787874de724407a3dc7698 100644 (file)
@@ -86,6 +86,8 @@ public:
 
        void notify_metering_state_changed();
 
+       void update_selection_state ();
+
        void block_screen_display_for (uint32_t msecs);
        void block_vpot_mode_display_for (uint32_t msecs);
 
index 35bff7e5b28687ffda09190004134a2264fbbaeb..079d057d43ee7c7613730bafb99c06f0146ab076 100644 (file)
@@ -938,6 +938,15 @@ Surface::write (const MidiByteArray& data)
        }
 }
 
+void
+Surface::update_strip_selection ()
+{
+       Strips::iterator s = strips.begin();
+       for ( ; s != strips.end(); ++s) {
+               (*s)->update_selection_state();
+       }
+}
+
 void
 Surface::map_stripables (const vector<boost::shared_ptr<Stripable> >& stripables)
 {
index 3225e23ba06bfa2f7194b55f4752f5dcd1fa5f1e..1c1096fbc4ea787a6df0f0b25bc1f03b548aae0d 100644 (file)
@@ -90,6 +90,8 @@ public:
 
        void map_stripables (const std::vector<boost::shared_ptr<ARDOUR::Stripable> >&);
 
+       void update_strip_selection ();
+
        const MidiByteArray& sysex_hdr() const;
 
        void periodic (ARDOUR::microseconds_t now_usecs);