diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-02-01 11:46:42 +0100 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-02-01 11:46:42 +0100 |
commit | 0f4530af0d3fbd0d37879c9c15814b63abd47aa9 (patch) | |
tree | fbf463d64758b4940b28bd45da001bd7fa3fb386 /libs/surfaces/control_protocol | |
parent | bb74bba1c7eb6679b910840cd73746feefbbdad1 (diff) |
add new API to ControlProtocol to allow GUI to specify left-most mixer strip
Subject To Change. Mileage May Vary. Offer Not Good In All Territories.
Diffstat (limited to 'libs/surfaces/control_protocol')
-rw-r--r-- | libs/surfaces/control_protocol/control_protocol.cc | 22 | ||||
-rw-r--r-- | libs/surfaces/control_protocol/control_protocol/control_protocol.h | 6 |
2 files changed, 23 insertions, 5 deletions
diff --git a/libs/surfaces/control_protocol/control_protocol.cc b/libs/surfaces/control_protocol/control_protocol.cc index 8c2a121779..675294bbd9 100644 --- a/libs/surfaces/control_protocol/control_protocol.cc +++ b/libs/surfaces/control_protocol/control_protocol.cc @@ -57,7 +57,7 @@ PBD::Signal0<void> ControlProtocol::ClearStripableSelection; PBD::Signal1<void,StripableNotificationListPtr> ControlProtocol::StripableSelectionChanged; -Glib::Threads::Mutex ControlProtocol::first_selected_mutex; +Glib::Threads::Mutex ControlProtocol::special_stripable_mutex; boost::weak_ptr<Stripable> ControlProtocol::_first_selected_stripable; StripableNotificationList ControlProtocol::_last_selected; bool ControlProtocol::selection_connected = false; @@ -346,14 +346,28 @@ ControlProtocol::set_state (XMLNode const & node, int /* version */) boost::shared_ptr<Stripable> ControlProtocol::first_selected_stripable () { - Glib::Threads::Mutex::Lock lm (first_selected_mutex); + Glib::Threads::Mutex::Lock lm (special_stripable_mutex); return _first_selected_stripable.lock(); } +boost::shared_ptr<Stripable> +ControlProtocol::leftmost_mixer_stripable () +{ + Glib::Threads::Mutex::Lock lm (special_stripable_mutex); + return _first_selected_stripable.lock(); +} + +void +ControlProtocol::set_leftmost_mixer_stripable (boost::shared_ptr<Stripable> s) +{ + Glib::Threads::Mutex::Lock lm (special_stripable_mutex); + _first_selected_stripable = s; +} + void ControlProtocol::set_first_selected_stripable (boost::shared_ptr<Stripable> s) { - Glib::Threads::Mutex::Lock lm (first_selected_mutex); + Glib::Threads::Mutex::Lock lm (special_stripable_mutex); _first_selected_stripable = s; } @@ -365,7 +379,7 @@ ControlProtocol::stripable_selection_changed (StripableNotificationListPtr sp) _last_selected = *sp; { - Glib::Threads::Mutex::Lock lm (first_selected_mutex); + Glib::Threads::Mutex::Lock lm (special_stripable_mutex); if (!_last_selected.empty()) { if (!had_selection) { diff --git a/libs/surfaces/control_protocol/control_protocol/control_protocol.h b/libs/surfaces/control_protocol/control_protocol/control_protocol.h index 2485ca84ac..987a8bcac4 100644 --- a/libs/surfaces/control_protocol/control_protocol/control_protocol.h +++ b/libs/surfaces/control_protocol/control_protocol/control_protocol.h @@ -95,6 +95,9 @@ class LIBCONTROLCP_API ControlProtocol : public PBD::Stateful, public PBD::Scope static boost::shared_ptr<ARDOUR::Stripable> first_selected_stripable (); static void set_first_selected_stripable (boost::shared_ptr<ARDOUR::Stripable>); + static boost::shared_ptr<ARDOUR::Stripable> leftmost_mixer_stripable (); + static void set_leftmost_mixer_stripable (boost::shared_ptr<ARDOUR::Stripable>); + /* the model here is as follows: we imagine most control surfaces being able to control @@ -156,7 +159,8 @@ class LIBCONTROLCP_API ControlProtocol : public PBD::Stateful, public PBD::Scope bool _active; - static Glib::Threads::Mutex first_selected_mutex; + static Glib::Threads::Mutex special_stripable_mutex; + static boost::weak_ptr<ARDOUR::Stripable> _leftmost_mixer_stripable; static boost::weak_ptr<ARDOUR::Stripable> _first_selected_stripable; static StripableNotificationList _last_selected; static void stripable_selection_changed (StripableNotificationListPtr); |