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
This commit is contained in:
Paul Davis 2013-01-06 14:39:27 +00:00
parent a401abfee7
commit 397729eb18
2 changed files with 10 additions and 7 deletions

View file

@ -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) {

View file

@ -544,8 +544,16 @@ 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) {
ID id = prop->value ();
@ -565,7 +573,6 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version)
}
}
}
}
if ((prop = node.property ("binding")) != 0) {