summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorSampo Savolainen <v2@iki.fi>2008-07-16 19:49:19 +0000
committerSampo Savolainen <v2@iki.fi>2008-07-16 19:49:19 +0000
commit44fd104ada0fbd8b76d34150e941d85d6de6f81b (patch)
treeaa628a04544161bf3250a149d0e4f8143a1b0f1f /libs/ardour
parent01f18f325fd9c90f7c529bdda713f376cc2065b5 (diff)
Fixes to get legacy 2.x sends working.
git-svn-id: svn://localhost/ardour2/branches/3.0@3624 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/io_processor.cc30
-rw-r--r--libs/ardour/processor.cc31
2 files changed, 47 insertions, 14 deletions
diff --git a/libs/ardour/io_processor.cc b/libs/ardour/io_processor.cc
index 9802c83330..08530b924c 100644
--- a/libs/ardour/io_processor.cc
+++ b/libs/ardour/io_processor.cc
@@ -73,26 +73,40 @@ int
IOProcessor::set_state (const XMLNode& node)
{
const XMLProperty *prop;
+ const XMLNode *io_node = 0;
Processor::set_state(node);
XMLNodeList nlist = node.children();
XMLNodeIterator niter;
- bool have_io = false;
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == IO::state_node_name) {
- have_io = true;
- _io->set_state(**niter);
-
- // legacy sessions: use IO name
- if ((prop = node.property ("name")) == 0) {
- set_name(_io->name());
+ io_node = (*niter);
+ break;
+ } else if ((*niter)->name() == "Redirect") {
+ XMLNodeList rlist = (*niter)->children();
+ XMLNodeIterator riter;
+
+ for (riter = rlist.begin(); riter != rlist.end(); ++riter) {
+ if ( (*riter)->name() == IO::state_node_name) {
+ warning << _("Found legacy IO in a redirect") << endmsg;
+ io_node = (*riter);
+ break;
+ }
}
}
}
- if (!have_io) {
+ if (io_node) {
+ _io->set_state(*io_node);
+
+ // legacy sessions: use IO name
+ if ((prop = node.property ("name")) == 0) {
+ set_name(_io->name());
+ }
+
+ } else {
error << _("XML node describing a redirect is missing an IO node") << endmsg;
return -1;
}
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 */