summaryrefslogtreecommitdiff
path: root/libs/ardour/plugin_insert.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-02-07 17:04:22 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-02-07 17:04:22 +0000
commiteb012ac243854806b1268bef0185f0f906e0b2ac (patch)
treeea1f0bf8f00a4847d28df2552ba6654dbfaeb7e2 /libs/ardour/plugin_insert.cc
parent44d938b6b2010a7bca1f14eb9b2fec3aa41770d1 (diff)
simplify "can-replicate" to allow replication only if a plugin has zero or one input AND output for each data type
git-svn-id: svn://localhost/ardour2/branches/3.0@8742 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/plugin_insert.cc')
-rw-r--r--libs/ardour/plugin_insert.cc31
1 files changed, 8 insertions, 23 deletions
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc
index 43b6c8d905..74cd20644a 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) {