From e8dd86dcc13c0be8f91343239746ee82f077ac5d Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 7 Feb 2011 17:04:22 +0000 Subject: [PATCH] simplify "can-replicate" to allow replication only if a plugin has zero or one input AND output for each data type git-svn-id: http://subversion.ardour.org/svn/ardour2/ardour2/branches/3.0@8742 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/plugin_insert.cc | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 43b6c8d90..74cd20644 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -619,35 +619,20 @@ PluginInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out) } // See if replication is possible - // We can replicate if there exists a single factor f such that, for every type, - // the number of plugin inputs * f = the requested number of inputs - uint32_t f = 0; + // We allow replication only for plugins with either zero or 1 inputs and outputs + // for every valid data type. + uint32_t f = 1; bool can_replicate = true; for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) { // No inputs of this type if (inputs.get(*t) == 0 && in.get(*t) == 0) { continue; + } - // Plugin has more inputs than requested, can not replicate - } else if (inputs.get(*t) >= in.get(*t)) { - can_replicate = false; - break; - - // Plugin inputs is not a factor of requested inputs, can not replicate - } else if (inputs.get(*t) == 0 || in.get(*t) % inputs.get(*t) != 0) { - can_replicate = false; - break; - - // Potential factor not set yet - } else if (f == 0) { - f = in.get(*t) / inputs.get(*t);; - } - - // Factor for this type does not match another type, can not replicate - if (f != (in.get(*t) / inputs.get(*t))) { - can_replicate = false; - break; - } + if (inputs.get(*t) != 1 || outputs.get (*t) != 1) { + can_replicate = false; + break; + } } if (can_replicate) { -- 2.11.4.GIT