From 44fd104ada0fbd8b76d34150e941d85d6de6f81b Mon Sep 17 00:00:00 2001 From: Sampo Savolainen Date: Wed, 16 Jul 2008 19:49:19 +0000 Subject: Fixes to get legacy 2.x sends working. git-svn-id: svn://localhost/ardour2/branches/3.0@3624 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/processor.cc | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'libs/ardour/processor.cc') diff --git a/libs/ardour/processor.cc b/libs/ardour/processor.cc index cbbbb374fb..cea33fbe32 100644 --- a/libs/ardour/processor.cc +++ b/libs/ardour/processor.cc @@ -176,6 +176,8 @@ int Processor::set_state (const XMLNode& node) { const XMLProperty *prop; + const XMLProperty *legacy_active = 0; + const XMLProperty *legacy_placement = 0; // may not exist for legacy sessions if ((prop = node.property ("name")) != 0) { @@ -217,22 +219,39 @@ Processor::set_state (const XMLNode& node) } else if ((*niter)->name() == "extra") { _extra_xml = new XMLNode (*(*niter)); + } else if ((*niter)->name() == "Redirect") { + if ( !(legacy_active = (*niter)->property("active"))) { + error << string_compose(_("No %1 property flag in element %2"), "active", (*niter)->name()) << endl; + } + if ( !(legacy_placement = (*niter)->property("placement"))) { + error << string_compose(_("No %1 property flag in element %2"), "placement", (*niter)->name()) << endl; + } } } if ((prop = node.property ("active")) == 0) { - error << _("XML node describing a processor is missing the `active' field") << endmsg; - return -1; + warning << _("XML node describing a processor is missing the `active' field, trying legacy active flag from child node") << endmsg; + if (legacy_active) { + prop = legacy_active; + } else { + error << _("No child node with active property") << endmsg; + return -1; + } } if (_active != (prop->value() == "yes")) { _active = !_active; ActiveChanged (); /* EMIT_SIGNAL */ - } - + } + if ((prop = node.property ("placement")) == 0) { - error << _("XML node describing a processor is missing the `placement' field") << endmsg; - return -1; + warning << _("XML node describing a processor is missing the `placement' field, trying legacy placement flag from child node") << endmsg; + if (legacy_placement) { + prop = legacy_placement; + } else { + error << _("No child node with placement property") << endmsg; + return -1; + } } /* hack to handle older sessions before we only used EnumWriter */ -- cgit v1.2.3