13
0

Convert v5 send state-state

This commit is contained in:
Robin Gareus 2020-02-28 21:21:16 +01:00
parent 300063c8b9
commit dd2c6e7cf1
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -305,6 +305,26 @@ Send::set_state (const XMLNode& node, int version)
}
if (version <= 6000) {
XMLNode const* nn = &node;
#ifdef MIXBUS
/* This was also broken in mixbus 6.0 */
if (version <= 6000)
#else
/* version 5: Gain Control was owned by the Amp */
if (version < 6000)
#endif
{
XMLNode* processor = node.child ("Processor");
if (processor) {
nn = processor;
if ((gain_node = nn->child (Controllable::xml_node_name.c_str ())) != 0) {
_gain_control->set_state (*gain_node, version);
_gain_control->set_flags (Controllable::Flag ((int)_gain_control->flags() | Controllable::InlineControl));
}
}
}
/* convert GainAutomation to BusSendLevel
*
* (early Ardour 6.0-pre0 and Mixbus 6.0 used "BusSendLevel"
@ -317,9 +337,11 @@ Send::set_state (const XMLNode& node, int version)
* -> Automatable::set_automation_xml_state()
*/
XMLNodeList nlist;
XMLNode* automation = node.child ("Automation");
XMLNode* automation = nn->child ("Automation");
if (automation) {
nlist = automation->children();
} else if (0 != (automation = node.child ("Automation"))) {
nlist = automation->children();
}
for (XMLNodeIterator i = nlist.begin(); i != nlist.end(); ++i) {
if ((*i)->name() != "AutomationList") {