diff options
author | Carl Hetherington <carl@carlh.net> | 2010-09-03 15:34:09 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-09-03 15:34:09 +0000 |
commit | 5b90aab4d8837316fc5835083999747c56f24d58 (patch) | |
tree | d631d6591ade721f57f32c567a1f1529af8114fe /libs/ardour/send.cc | |
parent | 8778724701ac14ebb02fe46dd3dc71eef38b636a (diff) |
Fix restore of sends from session files for both 2.X and 3.0 sessions. Fixes #3433.
git-svn-id: svn://localhost/ardour2/branches/3.0@7739 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/send.cc')
-rw-r--r-- | libs/ardour/send.cc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index 9d5d2398c7..48083d594a 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -139,6 +139,10 @@ Send::state (bool full) int Send::set_state (const XMLNode& node, int version) { + if (version < 3000) { + return set_state_2X (node, version); + } + XMLNodeList nlist = node.children(); XMLNodeIterator niter; const XMLProperty* prop; @@ -162,6 +166,41 @@ Send::set_state (const XMLNode& node, int version) return 0; } +int +Send::set_state_2X (const XMLNode& node, int version) +{ + /* use the IO's name for the name of the send */ + XMLNodeList const & children = node.children (); + + XMLNodeList::const_iterator i = children.begin(); + while (i != children.end() && (*i)->name() != X_("Redirect")) { + ++i; + } + + if (i == children.end()) { + return -1; + } + + XMLNodeList const & grand_children = (*i)->children (); + XMLNodeList::const_iterator j = grand_children.begin (); + while (j != grand_children.end() && (*j)->name() != X_("IO")) { + ++j; + } + + if (j == grand_children.end()) { + return -1; + } + + XMLProperty const * prop = (*j)->property X_("name"); + if (!prop) { + return -1; + } + + set_name (prop->value ()); + + return 0; +} + bool Send::can_support_io_configuration (const ChanCount& in, ChanCount& out) const { @@ -180,6 +219,10 @@ Send::configure_io (ChanCount in, ChanCount out) return false; } + if (_output) { + _output->ensure_io (out, false, 0); + } + if (!Processor::configure_io (in, out)) { return false; } |