summaryrefslogtreecommitdiff
path: root/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-04-06 09:13:39 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-04-06 09:13:39 -0400
commit6e485c0fc1425de78e21ea1aeec6233b136681dd (patch)
treef107e04527eb04dc3ba3cad8e863c9634ac57c26 /libs/surfaces/generic_midi/generic_midi_control_protocol.cc
parenteb4066003805407e0217338e3d3d923287cc04af (diff)
fix reload of Generic MIDI binding state when the target state involves just a binding map, with no specific controller bindings at all (should fix #5210)
Diffstat (limited to 'libs/surfaces/generic_midi/generic_midi_control_protocol.cc')
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.cc54
1 files changed, 26 insertions, 28 deletions
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
index deb19e0103..b524e2f2a0 100644
--- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
+++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
@@ -528,41 +528,39 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version)
pending_controllables.clear ();
}
+ /* Load up specific bindings from the
+ * <Controls><MidiControllable>...</MidiControllable><Controls> section
+ */
+
{
Glib::Threads::Mutex::Lock lm2 (controllables_lock);
controllables.clear ();
nlist = node.children(); // "Controls"
- if (nlist.empty()) {
- return 0;
- }
-
- nlist = nlist.front()->children(); // "MIDIControllable" ...
-
- if (nlist.empty()) {
- return 0;
- }
+ if (!nlist.empty()) {
+ nlist = nlist.front()->children(); // "MIDIControllable" ...
- for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
-
-
- if ((prop = (*niter)->property ("id")) != 0) {
-
- ID id = prop->value ();
- Controllable* c = Controllable::by_id (id);
-
- if (c) {
- MIDIControllable* mc = new MIDIControllable (this, *_input_port, *c, false);
-
- if (mc->set_state (**niter, version) == 0) {
- controllables.push_back (mc);
- }
+ if (!nlist.empty()) {
+ for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
- } else {
- warning << string_compose (
- _("Generic MIDI control: controllable %1 not found in session (ignored)"),
- id) << endmsg;
+ if ((prop = (*niter)->property ("id")) != 0) {
+
+ ID id = prop->value ();
+ Controllable* c = Controllable::by_id (id);
+
+ if (c) {
+ MIDIControllable* mc = new MIDIControllable (this, *_input_port, *c, false);
+
+ if (mc->set_state (**niter, version) == 0) {
+ controllables.push_back (mc);
+ }
+
+ } else {
+ warning << string_compose (
+ _("Generic MIDI control: controllable %1 not found in session (ignored)"),
+ id) << endmsg;
+ }
+ }
}
}
}