summaryrefslogtreecommitdiff
path: root/libs/surfaces/mackie
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2017-05-12 14:51:31 +0100
committerPaul Davis <paul@linuxaudiosystems.com>2017-05-12 14:51:39 +0100
commiteb3f50e15c9f9ed1880c59fecd6f8b3edcc05820 (patch)
tree5acd3346a7a7d63f0f8d1375f60979ecb4579a1f /libs/surfaces/mackie
parentefc2660fec0d01c4c47d3fffcc5443025b33afc0 (diff)
change the way ControlProtocols (control surfaces) are notified and handle Stripable selection changes
The Editor continues to notify them, but via a direct call to ControlProtocolManager, not a signal. The CP Manager calls the ControlProtocol static method to set up static data structures holding selection info for all surfaces and then notifies each surface/protocol that selection has changed.
Diffstat (limited to 'libs/surfaces/mackie')
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc7
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.h4
-rw-r--r--libs/surfaces/mackie/strip.cc1
3 files changed, 5 insertions, 7 deletions
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc
index e50d098882..0cee0e523b 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.cc
+++ b/libs/surfaces/mackie/mackie_control_protocol.cc
@@ -2369,10 +2369,11 @@ MackieControlProtocol::is_mapped (boost::shared_ptr<Stripable> r) const
}
void
-MackieControlProtocol::update_selected (boost::shared_ptr<Stripable> s, bool became_selected)
+MackieControlProtocol::stripable_selection_changed ()
{
- if (became_selected) {
+ boost::shared_ptr<Stripable> s = first_selected_stripable ();
+ if (s) {
check_fader_automation_state ();
/* It is possible that first_selected_route() may return null if we
@@ -2382,7 +2383,7 @@ MackieControlProtocol::update_selected (boost::shared_ptr<Stripable> s, bool bec
* set_subview_mode() will fail, and we will reset to None.
*/
- if (set_subview_mode (_subview_mode, first_selected_stripable())) {
+ if (set_subview_mode (_subview_mode, s)) {
set_subview_mode (None, boost::shared_ptr<Stripable>());
}
diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h
index 2c649a179a..9172716fe2 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.h
+++ b/libs/surfaces/mackie/mackie_control_protocol.h
@@ -140,7 +140,6 @@ class MackieControlProtocol
bool is_midi_track (boost::shared_ptr<ARDOUR::Stripable>) const;
bool is_mapped (boost::shared_ptr<ARDOUR::Stripable>) const;
boost::shared_ptr<ARDOUR::Stripable> first_selected_stripable () const;
- void update_selected (boost::shared_ptr<ARDOUR::Stripable>, bool selected);
void check_fader_automation_state ();
void update_fader_automation_state ();
@@ -360,8 +359,7 @@ class MackieControlProtocol
void clear_surfaces ();
void force_special_stripable_to_strip (boost::shared_ptr<ARDOUR::Stripable> r, uint32_t surface, uint32_t strip_number);
void build_button_map ();
- void gui_track_selection_changed (ARDOUR::StripableNotificationListPtr, bool save_list);
- void _gui_track_selection_changed (ARDOUR::StripableNotificationList*, bool save_list, bool gui_did_change);
+ void stripable_selection_changed ();
int ipmidi_restart ();
void initialize ();
int set_device_info (const std::string& device_name);
diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc
index 61cb64ce9b..1ec72d501c 100644
--- a/libs/surfaces/mackie/strip.cc
+++ b/libs/surfaces/mackie/strip.cc
@@ -381,7 +381,6 @@ Strip::notify_property_changed (const PropertyChange& what_changed)
if (what_changed.contains (ARDOUR::Properties::selected)) {
if (_stripable) {
_surface->write (_select->set_state (_stripable->is_selected()));
- _surface->mcp().update_selected (_stripable, _stripable->is_selected());
}
}
}