Fixed midi controllable state saving/loading
git-svn-id: svn://localhost/ardour2/trunk@1356 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
f7d48b79f1
commit
851d1fa76a
@ -1697,7 +1697,6 @@ class Session : public PBD::StatefulDestructible
|
||||
|
||||
void config_changed (const char*);
|
||||
|
||||
void add_control_protocol (const ControlProtocolInfo* const, XMLNode*);
|
||||
XMLNode& get_control_protocol_state ();
|
||||
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -1634,8 +1634,10 @@ IO::set_state (const XMLNode& node)
|
||||
set_automation_state (*(*iter)->children().front());
|
||||
}
|
||||
|
||||
if ((*iter)->name() == X_("gaincontrol")) {
|
||||
_gain_control.set_state (**iter);
|
||||
if ((*iter)->name() == X_("controllable")) {
|
||||
if ((prop = (*iter)->property("name")) != 0 && prop->value() == "gaincontrol") {
|
||||
_gain_control.set_state (**iter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -534,9 +534,10 @@ EqualPowerStereoPanner::set_state (const XMLNode& node)
|
||||
|
||||
for (XMLNodeConstIterator iter = node.children().begin(); iter != node.children().end(); ++iter) {
|
||||
|
||||
if ((*iter)->name() == X_("panner")) {
|
||||
|
||||
_control.set_state (**iter);
|
||||
if ((*iter)->name() == X_("controllable")) {
|
||||
if ((prop = (*iter)->property("name")) != 0 && prop->value() == "panner") {
|
||||
_control.set_state (**iter);
|
||||
}
|
||||
|
||||
} else if ((*iter)->name() == X_("Automation")) {
|
||||
|
||||
|
@ -1687,13 +1687,19 @@ Route::_set_state (const XMLNode& node, bool call_base)
|
||||
_comment = cmt->content();
|
||||
|
||||
} else if (child->name() == X_("extra")) {
|
||||
|
||||
_extra_xml = new XMLNode (*child);
|
||||
} else if (child->name() == X_("solo")) {
|
||||
_solo_control.set_state (*child);
|
||||
_session.add_controllable (&_solo_control);
|
||||
} else if (child->name() == X_("mute")) {
|
||||
_mute_control.set_state (*child);
|
||||
_session.add_controllable (&_mute_control);
|
||||
|
||||
} else if (child->name() == X_("controllable") && (prop = child->property("name")) != 0) {
|
||||
|
||||
if (prop->value() == "solo") {
|
||||
_solo_control.set_state (*child);
|
||||
_session.add_controllable (&_solo_control);
|
||||
}
|
||||
else if (prop->value() == "mute") {
|
||||
_mute_control.set_state (*child);
|
||||
_session.add_controllable (&_mute_control);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1040,19 +1040,7 @@ XMLNode&
|
||||
Session::get_control_protocol_state ()
|
||||
{
|
||||
ControlProtocolManager& cpm (ControlProtocolManager::instance());
|
||||
XMLNode* node = new XMLNode (X_("ControlProtocols"));
|
||||
|
||||
cpm.foreach_known_protocol (bind (mem_fun (*this, &Session::add_control_protocol), node));
|
||||
|
||||
return *node;
|
||||
}
|
||||
|
||||
void
|
||||
Session::add_control_protocol (const ControlProtocolInfo* const cpi, XMLNode* node)
|
||||
{
|
||||
if (cpi->protocol) {
|
||||
node->add_child_nocopy (cpi->protocol->get_state());
|
||||
}
|
||||
return cpm.get_state();
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user