mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
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:
parent
a401abfee7
commit
397729eb18
2 changed files with 10 additions and 7 deletions
|
|
@ -72,6 +72,7 @@ ControlProtocolManager::set_session (Session* s)
|
||||||
|
|
||||||
for (list<ControlProtocolInfo*>::iterator i = control_protocol_info.begin(); i != control_protocol_info.end(); ++i) {
|
for (list<ControlProtocolInfo*>::iterator i = control_protocol_info.begin(); i != control_protocol_info.end(); ++i) {
|
||||||
if ((*i)->requested || (*i)->mandatory) {
|
if ((*i)->requested || (*i)->mandatory) {
|
||||||
|
|
||||||
instantiate (**i);
|
instantiate (**i);
|
||||||
(*i)->requested = false;
|
(*i)->requested = false;
|
||||||
|
|
||||||
|
|
@ -344,12 +345,7 @@ ControlProtocolManager::set_state (const XMLNode& node, int /*version*/)
|
||||||
ControlProtocolInfo* cpi = cpi_by_name (prop->value());
|
ControlProtocolInfo* cpi = cpi_by_name (prop->value());
|
||||||
|
|
||||||
if (cpi) {
|
if (cpi) {
|
||||||
|
cpi->state = new XMLNode (**citer);
|
||||||
if (!(*citer)->children().empty()) {
|
|
||||||
cpi->state = new XMLNode (*((*citer)->children().front ()));
|
|
||||||
} else {
|
|
||||||
cpi->state = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (active) {
|
if (active) {
|
||||||
if (_session) {
|
if (_session) {
|
||||||
|
|
|
||||||
|
|
@ -544,7 +544,15 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nlist = nlist.front()->children(); // "MIDIControllable" ...
|
||||||
|
|
||||||
|
if (nlist.empty()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
|
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ((prop = (*niter)->property ("id")) != 0) {
|
if ((prop = (*niter)->property ("id")) != 0) {
|
||||||
|
|
||||||
|
|
@ -565,7 +573,6 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((prop = node.property ("binding")) != 0) {
|
if ((prop = node.property ("binding")) != 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue