From dd2c6e7cf19a34e6dcf0565b5b9b33172e2ad25b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 28 Feb 2020 21:21:16 +0100 Subject: [PATCH] Convert v5 send state-state --- libs/ardour/send.cc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index 0acc1d0b34..ce0cb2a5bf 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -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") {