diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-05-12 17:49:09 +0100 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-05-12 17:49:09 +0100 |
commit | 7021d02782ef9c8a15a0b2cd0762c12a8d87c470 (patch) | |
tree | 8d95182cca7111a44558a907a5cc81d219d7bac7 /libs/surfaces/control_protocol | |
parent | 38285d0e543a9501d2b1bc8ec6539656740fc50e (diff) |
don't actually use a method from libardourcp inside libardour; use a PBD::Signal to avoid linker issues
Diffstat (limited to 'libs/surfaces/control_protocol')
-rw-r--r-- | libs/surfaces/control_protocol/control_protocol.cc | 8 | ||||
-rw-r--r-- | libs/surfaces/control_protocol/control_protocol/control_protocol.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libs/surfaces/control_protocol/control_protocol.cc b/libs/surfaces/control_protocol/control_protocol.cc index c2589d24e3..e094e9b6cc 100644 --- a/libs/surfaces/control_protocol/control_protocol.cc +++ b/libs/surfaces/control_protocol/control_protocol.cc @@ -21,6 +21,7 @@ #include "pbd/convert.h" #include "pbd/error.h" +#include "ardour/control_protocol_manager.h" #include "ardour/gain_control.h" #include "ardour/session.h" #include "ardour/record_enable_control.h" @@ -60,6 +61,8 @@ Glib::Threads::Mutex ControlProtocol::special_stripable_mutex; boost::weak_ptr<Stripable> ControlProtocol::_first_selected_stripable; boost::weak_ptr<Stripable> ControlProtocol::_leftmost_mixer_stripable; StripableNotificationList ControlProtocol::_last_selected; +PBD::ScopedConnection ControlProtocol::selection_connection; +bool ControlProtocol::selection_connected = false; const std::string ControlProtocol::state_node_name ("Protocol"); @@ -68,6 +71,11 @@ ControlProtocol::ControlProtocol (Session& s, string str) , _name (str) , _active (false) { + if (!selection_connected) { + /* this is all static, connect it only once (and early), for all ControlProtocols */ + ControlProtocolManager::StripableSelectionChanged.connect_same_thread (selection_connection, boost::bind (&ControlProtocol::notify_stripable_selection_changed, _1)); + selection_connected = true; + } } ControlProtocol::~ControlProtocol () diff --git a/libs/surfaces/control_protocol/control_protocol/control_protocol.h b/libs/surfaces/control_protocol/control_protocol/control_protocol.h index ff5cd314fa..0068cd6b66 100644 --- a/libs/surfaces/control_protocol/control_protocol/control_protocol.h +++ b/libs/surfaces/control_protocol/control_protocol/control_protocol.h @@ -158,6 +158,8 @@ class LIBCONTROLCP_API ControlProtocol : public PBD::Stateful, public PBD::Scope static boost::weak_ptr<ARDOUR::Stripable> _leftmost_mixer_stripable; static boost::weak_ptr<ARDOUR::Stripable> _first_selected_stripable; static StripableNotificationList _last_selected; + static PBD::ScopedConnection selection_connection; + static bool selection_connected; }; extern "C" { |