summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_unit.cc
diff options
context:
space:
mode:
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2018-08-01 14:24:40 +0200
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2019-05-12 22:32:10 +0200
commita4474e95a447060c313c31c4bc6540ce8821e3da (patch)
tree38b2fb78476f31cbe192169f06b11f2c586b847f /libs/ardour/audio_unit.cc
parentfe4d0f67e46a0ad371702fde43d1d726be4a30da (diff)
Make the configuration penalty subtler about inputs
Instead of uniformly demote configurations with a non-matching audio input count (using a penalty offset of 1000), also grade the impreciseness of the configuration so that those with the nearest input count are preferred. As for outputs, give a slightly higher handicap to configuration with too many inputs with regard to the actual audio inputs that can be fed to the plugin. POLICY CHANGE: when only imprecise configurations are found the actually selected one can be different (better) than before this commit.
Diffstat (limited to 'libs/ardour/audio_unit.cc')
-rw-r--r--libs/ardour/audio_unit.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc
index 67938d2de9..c8c546c30d 100644
--- a/libs/ardour/audio_unit.cc
+++ b/libs/ardour/audio_unit.cc
@@ -1381,11 +1381,11 @@ AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out, Cha
}
#define FOUNDCFG_IMPRECISE(in, out) { \
- float p = fabsf ((float)(out) - preferred_out); \
- if (in != audio_in) { \
- p += 1000; \
- } \
- if ((out) > preferred_out) { p *= 1.1; } \
+ const float p = \
+ fabsf ((float)(out) - preferred_out) * \
+ (((out) > preferred_out) ? 1.1 : 1) \
+ + fabsf ((float)(in) - audio_in) * \
+ (((in) > audio_in) ? 275 : 250); \
FOUNDCFG_PENALTY(in, out, p); \
}
@@ -1483,8 +1483,6 @@ AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out, Cha
* Really imprecise only if desired_in != audio_in */
FOUNDCFG_IMPRECISE (desired_in, possible_out);
}
- // ideally we'll also find the closest, best matching
- // input configuration with minimal output penalty...
}
}