summaryrefslogtreecommitdiff
path: root/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-06-25 12:33:13 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-06-25 12:33:13 +0000
commit92469df6ab3417c6d953f0b51766d42d71a230af (patch)
tree02bb3bf290988004f3c671df2793139b060ba121 /libs/surfaces/generic_midi/generic_midi_control_protocol.cc
parented51eb8801c95b630d510ec6ced6d37c07544157 (diff)
add late/lazy binding between generic MIDI bindings and controllable elements in the session. this allows you to load a binding map that refers to elements that have not yet been created in the session, and when they are created, the binding will work
git-svn-id: svn://localhost/ardour2/branches/3.0@12921 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces/generic_midi/generic_midi_control_protocol.cc')
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
index fab6431c08..6b8e321112 100644
--- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
+++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
@@ -773,22 +773,27 @@ GenericMidiControlProtocol::reset_controllables ()
/* its entirely possible that the session doesn't have
* the specified controllable (e.g. it has too few
- * tracks). if we find this to be the case, drop any
- * bindings that would be left without controllables.
+ * tracks). if we find this to be the case, we just leave
+ * the binding around, unbound, and it will do "late
+ * binding" (or "lazy binding") if/when any data arrives.
*/
boost::shared_ptr<Controllable> c = session->controllable_by_descriptor (desc);
if (c) {
existingBinding->set_controllable (c.get());
- } else {
- controllables.erase (iter);
- }
+ }
}
iter = next;
}
}
+boost::shared_ptr<Controllable>
+GenericMidiControlProtocol::lookup_controllable (const ControllableDescriptor& desc) const
+{
+ return session->controllable_by_descriptor (desc);
+}
+
MIDIFunction*
GenericMidiControlProtocol::create_function (const XMLNode& node)
{