summaryrefslogtreecommitdiff
path: root/libs/ardour
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/ardour
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/ardour')
-rw-r--r--libs/ardour/ardour/control_protocol_manager.h5
-rw-r--r--libs/ardour/control_protocol_manager.cc23
2 files changed, 28 insertions, 0 deletions
diff --git a/libs/ardour/ardour/control_protocol_manager.h b/libs/ardour/ardour/control_protocol_manager.h
index 2dddc30aca..c8370e03a6 100644
--- a/libs/ardour/ardour/control_protocol_manager.h
+++ b/libs/ardour/ardour/control_protocol_manager.h
@@ -27,6 +27,9 @@
#include <glibmm/threads.h>
#include "pbd/stateful.h"
+
+#include "control_protocol/types.h"
+
#include "ardour/session_handle.h"
namespace ARDOUR {
@@ -80,6 +83,8 @@ class LIBARDOUR_API ControlProtocolManager : public PBD::Stateful, public ARDOUR
PBD::Signal1<void,ControlProtocolInfo*> ProtocolStatusChange;
+ void stripable_selection_changed (ARDOUR::StripableNotificationListPtr);
+
private:
ControlProtocolManager ();
static ControlProtocolManager* _instance;
diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc
index ba32ab8b70..338ea816f2 100644
--- a/libs/ardour/control_protocol_manager.cc
+++ b/libs/ardour/control_protocol_manager.cc
@@ -557,3 +557,26 @@ ControlProtocolManager::register_request_buffer_factories ()
}
}
}
+
+void
+ControlProtocolManager::stripable_selection_changed (StripableNotificationListPtr sp)
+{
+ /* this sets up the (static) data structures owned by ControlProtocol
+ that are "shared" across all control protocols.
+ */
+
+ DEBUG_TRACE (DEBUG::Selection, string_compose ("Surface manager: selection changed, now %1 stripables\n", sp ? sp->size() : -1));
+ ControlProtocol::notify_stripable_selection_changed (sp);
+
+ /* now give each protocol the chance to respond to the selection change
+ */
+
+ {
+ Glib::Threads::Mutex::Lock lm (protocols_lock);
+
+ for (list<ControlProtocol*>::iterator p = control_protocols.begin(); p != control_protocols.end(); ++p) {
+ DEBUG_TRACE (DEBUG::Selection, string_compose ("selection change notification for surface \"%1\"\n", (*p)->name()));
+ (*p)->stripable_selection_changed ();
+ }
+ }
+}