Merged with trunk R1393.

git-svn-id: svn://localhost/ardour2/branches/midi@1395 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2007-01-28 17:44:13 +00:00
parent cd37c36326
commit f9f5ec85fb
85 changed files with 5136 additions and 2848 deletions

View file

@ -324,10 +324,25 @@ ControlProtocolManager::get_state (void)
Glib::Mutex::Lock lm (protocols_lock);
for (list<ControlProtocolInfo*>::iterator i = control_protocol_info.begin(); i != control_protocol_info.end(); ++i) {
XMLNode* child = new XMLNode (X_("Protocol"));
child->add_property (X_("name"), (*i)->name);
child->add_property (X_("active"), (*i)->protocol ? "yes" : "no");
root->add_child_nocopy (*child);
XMLNode * child;
if ((*i)->protocol) {
child = &((*i)->protocol->get_state());
child->add_property (X_("active"), "yes");
// should we update (*i)->state here? probably.
root->add_child_nocopy (*child);
}
else if ((*i)->state) {
// keep ownership clear
root->add_child_copy (*(*i)->state);
}
else {
child = new XMLNode (X_("Protocol"));
child->add_property (X_("name"), (*i)->name);
child->add_property (X_("active"), "no");
root->add_child_nocopy (*child);
}
}
return *root;