summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_unit.cc
diff options
context:
space:
mode:
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2018-08-01 11:40:52 +0200
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2019-05-12 22:32:10 +0200
commitfe4d0f67e46a0ad371702fde43d1d726be4a30da (patch)
treed1db4ff3ae52ad140c19f725db506a495c2d185d /libs/ardour/audio_unit.cc
parent3bff40b5b3d38df2fb65113832405c36caf599c7 (diff)
Remove ad-hoc handling of possible_in == 0
Just make the code responsible for possible_in > 0 also handle possible_in == 0 since it nearly does the same thing. The only difference is that the possible_in == 0 case, by using FOUNDCFG(), acted as if possible_in was audio_in. The consolidated code uses FOUNDCFG_IMPRECISE which will add some penalty to the configurations where desired_in == possible_in != audio_in. There is thus a small POLICY CHANGE, but the selected configuration will stay the same unless a better matching configuration is available.
Diffstat (limited to 'libs/ardour/audio_unit.cc')
-rw-r--r--libs/ardour/audio_unit.cc21
1 files changed, 2 insertions, 19 deletions
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc
index b5af76ced6..67938d2de9 100644
--- a/libs/ardour/audio_unit.cc
+++ b/libs/ardour/audio_unit.cc
@@ -1430,23 +1430,6 @@ AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out, Cha
}
/* now allow potentially "imprecise" matches */
- if (possible_in == 0) {
- /* no inputs, generators & instruments */
- if (possible_out == -1 || possible_out == -2) {
- /* any output configuration possible
- * out == -2 is invalid, interpreted as out == -1 */
- FOUNDCFG (preferred_out);
- ANYTHINGGOES;
- } else if (possible_out < -2) {
- /* variable number of outputs up to -N, */
- FOUNDCFG (min (-possible_out, preferred_out));
- UPTO (-possible_out);
- } else {
- /* exact number of outputs */
- FOUNDCFG (possible_out);
- }
- }
-
if (possible_in == -1 || possible_in == -2) {
/* wildcard for input */
if (possible_out == possible_in) {
@@ -1469,10 +1452,10 @@ AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out, Cha
}
}
- if (possible_in < -2 || possible_in > 0) {
+ if (possible_in < -2 || possible_in >= 0) {
/* specified number, exact or up to */
int32_t desired_in;
- if (possible_in > 0) {
+ if (possible_in >= 0) {
/* configuration can only match possible_in */
desired_in = possible_in;
} else {