mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-12 17:46:34 +01:00
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
6 changed files with 40 additions and 29 deletions
|
|
@ -1697,7 +1697,6 @@ class Session : public PBD::StatefulDestructible
|
||||||
|
|
||||||
void config_changed (const char*);
|
void config_changed (const char*);
|
||||||
|
|
||||||
void add_control_protocol (const ControlProtocolInfo* const, XMLNode*);
|
|
||||||
XMLNode& get_control_protocol_state ();
|
XMLNode& get_control_protocol_state ();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -324,10 +324,25 @@ ControlProtocolManager::get_state (void)
|
||||||
Glib::Mutex::Lock lm (protocols_lock);
|
Glib::Mutex::Lock lm (protocols_lock);
|
||||||
|
|
||||||
for (list<ControlProtocolInfo*>::iterator i = control_protocol_info.begin(); i != control_protocol_info.end(); ++i) {
|
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);
|
XMLNode * child;
|
||||||
child->add_property (X_("active"), (*i)->protocol ? "yes" : "no");
|
|
||||||
root->add_child_nocopy (*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;
|
return *root;
|
||||||
|
|
|
||||||
|
|
@ -1634,8 +1634,10 @@ IO::set_state (const XMLNode& node)
|
||||||
set_automation_state (*(*iter)->children().front());
|
set_automation_state (*(*iter)->children().front());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*iter)->name() == X_("gaincontrol")) {
|
if ((*iter)->name() == X_("controllable")) {
|
||||||
_gain_control.set_state (**iter);
|
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) {
|
for (XMLNodeConstIterator iter = node.children().begin(); iter != node.children().end(); ++iter) {
|
||||||
|
|
||||||
if ((*iter)->name() == X_("panner")) {
|
if ((*iter)->name() == X_("controllable")) {
|
||||||
|
if ((prop = (*iter)->property("name")) != 0 && prop->value() == "panner") {
|
||||||
_control.set_state (**iter);
|
_control.set_state (**iter);
|
||||||
|
}
|
||||||
|
|
||||||
} else if ((*iter)->name() == X_("Automation")) {
|
} else if ((*iter)->name() == X_("Automation")) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1687,13 +1687,19 @@ Route::_set_state (const XMLNode& node, bool call_base)
|
||||||
_comment = cmt->content();
|
_comment = cmt->content();
|
||||||
|
|
||||||
} else if (child->name() == X_("extra")) {
|
} else if (child->name() == X_("extra")) {
|
||||||
|
|
||||||
_extra_xml = new XMLNode (*child);
|
_extra_xml = new XMLNode (*child);
|
||||||
} else if (child->name() == X_("solo")) {
|
|
||||||
_solo_control.set_state (*child);
|
} else if (child->name() == X_("controllable") && (prop = child->property("name")) != 0) {
|
||||||
_session.add_controllable (&_solo_control);
|
|
||||||
} else if (child->name() == X_("mute")) {
|
if (prop->value() == "solo") {
|
||||||
_mute_control.set_state (*child);
|
_solo_control.set_state (*child);
|
||||||
_session.add_controllable (&_mute_control);
|
_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 ()
|
Session::get_control_protocol_state ()
|
||||||
{
|
{
|
||||||
ControlProtocolManager& cpm (ControlProtocolManager::instance());
|
ControlProtocolManager& cpm (ControlProtocolManager::instance());
|
||||||
XMLNode* node = new XMLNode (X_("ControlProtocols"));
|
return cpm.get_state();
|
||||||
|
|
||||||
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());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue