summaryrefslogtreecommitdiff
path: root/libs/ardour/control_protocol_manager.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-01-28 17:44:13 +0000
committerDavid Robillard <d@drobilla.net>2007-01-28 17:44:13 +0000
commitf9f5ec85fbfd15d0008f70d4185a84eeadfd3891 (patch)
treeadb7e13707b1361604c1ec57c0ea405125a4e98e /libs/ardour/control_protocol_manager.cc
parentcd37c36326a165ddf6eb83c176213b0732a6db0d (diff)
Merged with trunk R1393.
git-svn-id: svn://localhost/ardour2/branches/midi@1395 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/control_protocol_manager.cc')
-rw-r--r--libs/ardour/control_protocol_manager.cc23
1 files changed, 19 insertions, 4 deletions
diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc
index de177d0e3d..72f56794d7 100644
--- a/libs/ardour/control_protocol_manager.cc
+++ b/libs/ardour/control_protocol_manager.cc
@@ -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;