Fixes to get legacy 2.x sends working.
git-svn-id: svn://localhost/ardour2/branches/3.0@3624 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
01f18f325f
commit
44fd104ada
@ -73,26 +73,40 @@ int
|
|||||||
IOProcessor::set_state (const XMLNode& node)
|
IOProcessor::set_state (const XMLNode& node)
|
||||||
{
|
{
|
||||||
const XMLProperty *prop;
|
const XMLProperty *prop;
|
||||||
|
const XMLNode *io_node = 0;
|
||||||
|
|
||||||
Processor::set_state(node);
|
Processor::set_state(node);
|
||||||
|
|
||||||
XMLNodeList nlist = node.children();
|
XMLNodeList nlist = node.children();
|
||||||
XMLNodeIterator niter;
|
XMLNodeIterator niter;
|
||||||
bool have_io = false;
|
|
||||||
|
|
||||||
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
|
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
|
||||||
if ((*niter)->name() == IO::state_node_name) {
|
if ((*niter)->name() == IO::state_node_name) {
|
||||||
have_io = true;
|
io_node = (*niter);
|
||||||
_io->set_state(**niter);
|
break;
|
||||||
|
} else if ((*niter)->name() == "Redirect") {
|
||||||
|
XMLNodeList rlist = (*niter)->children();
|
||||||
|
XMLNodeIterator riter;
|
||||||
|
|
||||||
// legacy sessions: use IO name
|
for (riter = rlist.begin(); riter != rlist.end(); ++riter) {
|
||||||
if ((prop = node.property ("name")) == 0) {
|
if ( (*riter)->name() == IO::state_node_name) {
|
||||||
set_name(_io->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;
|
error << _("XML node describing a redirect is missing an IO node") << endmsg;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -176,6 +176,8 @@ int
|
|||||||
Processor::set_state (const XMLNode& node)
|
Processor::set_state (const XMLNode& node)
|
||||||
{
|
{
|
||||||
const XMLProperty *prop;
|
const XMLProperty *prop;
|
||||||
|
const XMLProperty *legacy_active = 0;
|
||||||
|
const XMLProperty *legacy_placement = 0;
|
||||||
|
|
||||||
// may not exist for legacy sessions
|
// may not exist for legacy sessions
|
||||||
if ((prop = node.property ("name")) != 0) {
|
if ((prop = node.property ("name")) != 0) {
|
||||||
@ -217,12 +219,24 @@ Processor::set_state (const XMLNode& node)
|
|||||||
|
|
||||||
} else if ((*niter)->name() == "extra") {
|
} else if ((*niter)->name() == "extra") {
|
||||||
_extra_xml = new XMLNode (*(*niter));
|
_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) {
|
if ((prop = node.property ("active")) == 0) {
|
||||||
error << _("XML node describing a processor is missing the `active' field") << endmsg;
|
warning << _("XML node describing a processor is missing the `active' field, trying legacy active flag from child node") << endmsg;
|
||||||
return -1;
|
if (legacy_active) {
|
||||||
|
prop = legacy_active;
|
||||||
|
} else {
|
||||||
|
error << _("No child node with active property") << endmsg;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_active != (prop->value() == "yes")) {
|
if (_active != (prop->value() == "yes")) {
|
||||||
@ -231,8 +245,13 @@ Processor::set_state (const XMLNode& node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((prop = node.property ("placement")) == 0) {
|
if ((prop = node.property ("placement")) == 0) {
|
||||||
error << _("XML node describing a processor is missing the `placement' field") << endmsg;
|
warning << _("XML node describing a processor is missing the `placement' field, trying legacy placement flag from child node") << endmsg;
|
||||||
return -1;
|
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 */
|
/* hack to handle older sessions before we only used EnumWriter */
|
||||||
|
Loading…
Reference in New Issue
Block a user