From eb3f50e15c9f9ed1880c59fecd6f8b3edcc05820 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 12 May 2017 14:51:31 +0100 Subject: 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. --- libs/surfaces/mackie/mackie_control_protocol.cc | 7 ++++--- libs/surfaces/mackie/mackie_control_protocol.h | 4 +--- libs/surfaces/mackie/strip.cc | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'libs/surfaces/mackie') 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 r) const } void -MackieControlProtocol::update_selected (boost::shared_ptr s, bool became_selected) +MackieControlProtocol::stripable_selection_changed () { - if (became_selected) { + boost::shared_ptr 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 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()); } 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) const; bool is_mapped (boost::shared_ptr) const; boost::shared_ptr first_selected_stripable () const; - void update_selected (boost::shared_ptr, 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 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()); } } } -- cgit v1.2.3