diff options
author | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2016-08-04 09:45:33 +0200 |
---|---|---|
committer | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2016-08-06 19:38:09 +0200 |
commit | 539c062ed23daf308e650b5d1039384ac5a55666 (patch) | |
tree | 4962af82ee83a1841d79adefe49464a4dba9ef02 /libs | |
parent | 0f64e5ce8473006107841c4b2aa18be9f099d784 (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')
-rw-r--r-- | libs/ardour/luaproc.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc index 8f370ebfad..09be770b0a 100644 --- a/libs/ardour/luaproc.cc +++ b/libs/ardour/luaproc.cc @@ -400,11 +400,10 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan } #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); \ } |