summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2017-05-17 15:55:43 -0500
committerBen Loftis <ben@harrisonconsoles.com>2017-05-17 15:55:43 -0500
commitd3738b087ef1698d45e140114feb8fca4d31e42f (patch)
treedee6cbe57473d8da7b44e4378a0015b38726c423
parent60cc2823f36103b86c9189a122566767ebf898eb (diff)
MCP: Fix issue with strip "select" buttons that stayed stuck on.
* Depending on individual strips to watch the selection property is prone to failure. * Stripable_selection_changed() is called when a selection operation is completed.
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc6
-rw-r--r--libs/surfaces/mackie/strip.cc11
-rw-r--r--libs/surfaces/mackie/strip.h2
-rw-r--r--libs/surfaces/mackie/surface.cc9
-rw-r--r--libs/surfaces/mackie/surface.h2
5 files changed, 25 insertions, 5 deletions
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc
index 0cee0e523b..3d011c1bb6 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.cc
+++ b/libs/surfaces/mackie/mackie_control_protocol.cc
@@ -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 ();
diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc
index 7197545857..3f1ab24da6 100644
--- a/libs/surfaces/mackie/strip.cc
+++ b/libs/surfaces/mackie/strip.cc
@@ -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;
}
diff --git a/libs/surfaces/mackie/strip.h b/libs/surfaces/mackie/strip.h
index a095f8ebe8..a1816f3844 100644
--- a/libs/surfaces/mackie/strip.h
+++ b/libs/surfaces/mackie/strip.h
@@ -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);
diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc
index 35bff7e5b2..079d057d43 100644
--- a/libs/surfaces/mackie/surface.cc
+++ b/libs/surfaces/mackie/surface.cc
@@ -939,6 +939,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)
{
vector<boost::shared_ptr<Stripable> >::const_iterator r;
diff --git a/libs/surfaces/mackie/surface.h b/libs/surfaces/mackie/surface.h
index 3225e23ba0..1c1096fbc4 100644
--- a/libs/surfaces/mackie/surface.h
+++ b/libs/surfaces/mackie/surface.h
@@ -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);