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.
This commit is contained in:
Ben Loftis 2017-05-17 15:55:43 -05:00
parent 60cc2823f3
commit d3738b087e
5 changed files with 25 additions and 5 deletions

View 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 ();

View file

@ -377,12 +377,14 @@ 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) {
void
Strip::update_selection_state ()
{
if(_stripable) {
_surface->write (_select->set_state (_stripable->is_selected()));
}
}
}
void
@ -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;
}

View 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);

View 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)
{

View 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);