summaryrefslogtreecommitdiff
path: root/libs/ardour/control_protocol_manager.cc
diff options
context:
space:
mode:
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;