diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-01-06 14:39:27 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-01-06 14:39:27 +0000 |
commit | 397729eb182ba3d5e311f0ac80959cf72f5cba24 (patch) | |
tree | 319e5d7d755fa23b8672667b717c6c65416888ab | |
parent | a401abfee715529d2379f7d0fef5068bddc06640 (diff) |
fix continuing SNAFUs with ::set_state() for control protocols and the parent/child/grandchild relationship for the XML nodes. this corrects problems with MackieControl
git-svn-id: svn://localhost/ardour2/branches/3.0@13794 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/ardour/control_protocol_manager.cc | 8 | ||||
-rw-r--r-- | libs/surfaces/generic_midi/generic_midi_control_protocol.cc | 9 |
2 files changed, 10 insertions, 7 deletions
diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc index 64876b1d5f..0fd5319e40 100644 --- a/libs/ardour/control_protocol_manager.cc +++ b/libs/ardour/control_protocol_manager.cc @@ -72,6 +72,7 @@ ControlProtocolManager::set_session (Session* s) for (list<ControlProtocolInfo*>::iterator i = control_protocol_info.begin(); i != control_protocol_info.end(); ++i) { if ((*i)->requested || (*i)->mandatory) { + instantiate (**i); (*i)->requested = false; @@ -344,12 +345,7 @@ ControlProtocolManager::set_state (const XMLNode& node, int /*version*/) ControlProtocolInfo* cpi = cpi_by_name (prop->value()); if (cpi) { - - if (!(*citer)->children().empty()) { - cpi->state = new XMLNode (*((*citer)->children().front ())); - } else { - cpi->state = 0; - } + cpi->state = new XMLNode (**citer); if (active) { if (_session) { diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc index 8173217c22..a8ca0c7221 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc @@ -544,7 +544,15 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version) return 0; } + nlist = nlist.front()->children(); // "MIDIControllable" ... + + if (nlist.empty()) { + return 0; + } + for (niter = nlist.begin(); niter != nlist.end(); ++niter) { + + if ((prop = (*niter)->property ("id")) != 0) { @@ -565,7 +573,6 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version) } } } - } if ((prop = node.property ("binding")) != 0) { |