diff options
author | Carl Hetherington <carl@carlh.net> | 2009-03-01 19:45:35 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-03-01 19:45:35 +0000 |
commit | fb87fd6ffaa812f483d37686a20c118c583d62df (patch) | |
tree | d624d9890e1b8abda34758b2867503d9b55173f8 /libs | |
parent | 5b5957c195a046551cd82352d0b50b4f0efcf430 (diff) |
Be more tolerant of session files where IOs connect to non-existant bundles.
git-svn-id: svn://localhost/ardour2/branches/3.0@4711 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/io.cc | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 80d5f8c916..f1c1bb1dab 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -1682,12 +1682,12 @@ IO::create_ports (const XMLNode& node) if ((prop = node.property ("input-connection")) != 0) { boost::shared_ptr<Bundle> c = find_possible_bundle (prop->value(), _("in"), _("input")); - - if (!c) { - return -1; - } - - num_inputs = c->nchannels(); + + if (c) { + num_inputs = c->nchannels (); + } else { + num_inputs = 0; + } } else if ((prop = node.property ("inputs")) != 0) { @@ -1698,11 +1698,11 @@ IO::create_ports (const XMLNode& node) boost::shared_ptr<Bundle> c = find_possible_bundle(prop->value(), _("out"), _("output")); - if (!c) { - return -1; - } - - num_outputs = c->nchannels (); + if (c) { + num_outputs = c->nchannels (); + } else { + num_outputs = 0; + } } else if ((prop = node.property ("outputs")) != 0) { @@ -1731,7 +1731,6 @@ IO::create_ports (const XMLNode& node) int IO::make_connections (const XMLNode& node) { - const XMLProperty* prop; if ((prop = node.property ("input-connection")) != 0) { @@ -1739,9 +1738,11 @@ IO::make_connections (const XMLNode& node) if (!c) { return -1; - } + } - connect_input_ports_to_bundle (c, this); + if (n_inputs().get(c->type()) == c->nchannels() && c->ports_are_outputs()) { + connect_input_ports_to_bundle (c, this); + } } else if ((prop = node.property ("inputs")) != 0) { if (set_inputs (prop->value())) { @@ -1757,8 +1758,10 @@ IO::make_connections (const XMLNode& node) return -1; } - connect_output_ports_to_bundle (c, this); - + if (n_outputs().get(c->type()) == c->nchannels() && c->ports_are_inputs()) { + connect_output_ports_to_bundle (c, this); + } + } else if ((prop = node.property ("outputs")) != 0) { if (set_outputs (prop->value())) { error << string_compose(_("improper output channel list in XML node (%1)"), prop->value()) << endmsg; |