diff options
author | Len Ovens <len@ovenwerks.net> | 2015-07-13 13:47:00 -0700 |
---|---|---|
committer | Len Ovens <len@ovenwerks.net> | 2015-07-13 13:47:00 -0700 |
commit | d8f3f9f02dadd46ee9490c571f9dbfecb401f6a2 (patch) | |
tree | ab411259581ee986a9782a6f6bd23d0e0078b869 /libs/surfaces/generic_midi | |
parent | fa3896a483e60757b04ab1d61d504d0294cccc75 (diff) |
Move learned midi binding reload after midi map load (fixes #6405)
Diffstat (limited to 'libs/surfaces/generic_midi')
-rw-r--r-- | libs/surfaces/generic_midi/generic_midi_control_protocol.cc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc index d70aeaaf48..631bb025b4 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc @@ -534,6 +534,16 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version) pending_controllables.clear (); } + // midi map has to be loaded first so learned binding can go on top + if ((prop = node.property ("binding")) != 0) { + for (list<MapInfo>::iterator x = map_info.begin(); x != map_info.end(); ++x) { + if (prop->value() == (*x).name) { + load_bindings ((*x).path); + break; + } + } + } + /* Load up specific bindings from the * <Controls><MidiControllable>...</MidiControllable><Controls> section */ @@ -552,6 +562,7 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version) if ((prop = (*niter)->property ("id")) != 0) { ID id = prop->value (); + DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("Relearned binding for session: Control ID: %1\n", id)); Controllable* c = Controllable::by_id (id); if (c) { @@ -572,15 +583,6 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version) } } - if ((prop = node.property ("binding")) != 0) { - for (list<MapInfo>::iterator x = map_info.begin(); x != map_info.end(); ++x) { - if (prop->value() == (*x).name) { - load_bindings ((*x).path); - break; - } - } - } - return 0; } |