summaryrefslogtreecommitdiff
path: root/libs/ardour/control_protocol_manager.cc
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/control_protocol_manager.cc
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/control_protocol_manager.cc')
-rw-r--r--libs/ardour/control_protocol_manager.cc23
1 files changed, 23 insertions, 0 deletions
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 ();
+ }
+ }
+}