summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-06-23 22:12:16 +0000
committerDavid Robillard <d@drobilla.net>2007-06-23 22:12:16 +0000
commit66722dd874e0fe5a57fc7dfe236635cc4a763318 (patch)
tree2320e8a77a9fd8bce3c69caec928b84a2c6d742d
parent4b9c53bb98a662e65fbe5b1a507362c1d543a268 (diff)
Fix loading inserts from 2.0 sessions.
git-svn-id: svn://localhost/ardour2/trunk@2029 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/ardour/automation_event.cc2
-rw-r--r--libs/ardour/insert.cc14
-rw-r--r--libs/ardour/port_insert.cc2
-rw-r--r--libs/ardour/redirect.cc12
-rw-r--r--libs/ardour/send.cc5
5 files changed, 13 insertions, 22 deletions
diff --git a/libs/ardour/automation_event.cc b/libs/ardour/automation_event.cc
index cfac2e445f..50688dda2c 100644
--- a/libs/ardour/automation_event.cc
+++ b/libs/ardour/automation_event.cc
@@ -131,7 +131,7 @@ AutomationList::AutomationList (const AutomationList& other, double start, doubl
mark_dirty ();
- AutomationListCreated(this);
+ AutomationListCreated(this);
}
AutomationList::AutomationList (const XMLNode& node)
diff --git a/libs/ardour/insert.cc b/libs/ardour/insert.cc
index 177aa5a98c..bb02cb0925 100644
--- a/libs/ardour/insert.cc
+++ b/libs/ardour/insert.cc
@@ -55,7 +55,7 @@ using namespace PBD;
sigc::signal<void,Insert*> Insert::InsertCreated;
-// Always saved as Insert, but may be Redirect in legacy sessions
+// Always saved as Insert, but may be Redirect or Send in legacy sessions
const string Insert::state_node_name = "Insert";
Insert::Insert(Session& session, const string& name, Placement p)
@@ -177,14 +177,8 @@ Insert::set_state (const XMLNode& node)
{
const XMLProperty *prop;
- if (node.name() != state_node_name) {
- error << string_compose(_("incorrect XML node \"%1\" passed to Redirect object"), node.name()) << endmsg;
- return -1;
- }
-
- if ((prop = node.property ("name")) == 0) {
- warning << _("XML node describing an insert is missing the `name' field") << endmsg;
- } else {
+ // may not exist for legacy sessions
+ if ((prop = node.property ("name")) != 0) {
set_name(prop->value());
}
@@ -202,7 +196,7 @@ Insert::set_state (const XMLNode& node)
if ((prop = (*niter)->property ("path")) != 0) {
old_set_automation_state (*(*niter));
} else {
- Automatable::set_automation_state (*(*niter));
+ set_automation_state (*(*niter));
}
if ((prop = (*niter)->property ("visible")) != 0) {
diff --git a/libs/ardour/port_insert.cc b/libs/ardour/port_insert.cc
index 53903c4b34..51bf8fb0fb 100644
--- a/libs/ardour/port_insert.cc
+++ b/libs/ardour/port_insert.cc
@@ -128,7 +128,7 @@ PortInsert::set_state(const XMLNode& node)
const XMLProperty *prop;
if ((prop = node.property ("type")) == 0) {
- error << _("XML node describing insert is missing the `type' field") << endmsg;
+ error << _("XML node describing port insert is missing the `type' field") << endmsg;
return -1;
}
diff --git a/libs/ardour/redirect.cc b/libs/ardour/redirect.cc
index b5216cf323..ef01f3437a 100644
--- a/libs/ardour/redirect.cc
+++ b/libs/ardour/redirect.cc
@@ -72,12 +72,9 @@ Redirect::state (bool full_state)
int
Redirect::set_state (const XMLNode& node)
{
- Insert::set_state(node);
+ const XMLProperty *prop;
- if (node.name() != "Insert" && node.name() != "Redirect") {
- error << string_compose(_("incorrect XML node \"%1\" passed to Redirect object"), node.name()) << endmsg;
- return -1;
- }
+ Insert::set_state(node);
XMLNodeList nlist = node.children();
XMLNodeIterator niter;
@@ -87,6 +84,11 @@ Redirect::set_state (const XMLNode& node)
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());
+ }
}
}
diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc
index 1ba063b2dc..aee4d4004c 100644
--- a/libs/ardour/send.cc
+++ b/libs/ardour/send.cc
@@ -109,11 +109,6 @@ Send::set_state(const XMLNode& node)
Redirect::set_state (*insert_node);
- if (niter == nlist.end()) {
- error << _("XML node describing a send is missing a Redirect node") << endmsg;
- return -1;
- }
-
return 0;
}