From f9f5ec85fbfd15d0008f70d4185a84eeadfd3891 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 28 Jan 2007 17:44:13 +0000 Subject: Merged with trunk R1393. git-svn-id: svn://localhost/ardour2/branches/midi@1395 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/control_protocol_manager.cc | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'libs/ardour/control_protocol_manager.cc') 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::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; -- cgit v1.2.3