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) {
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) {
int
IO::make_connections (const XMLNode& node)
{
-
const XMLProperty* prop;
if ((prop = node.property ("input-connection")) != 0) {
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())) {
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;