diff options
author | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2018-08-01 11:24:17 +0200 |
---|---|---|
committer | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2019-05-12 22:32:10 +0200 |
commit | 3bff40b5b3d38df2fb65113832405c36caf599c7 (patch) | |
tree | 3bc51841c087f1da22862f487af56b0d9744414e /libs/ardour | |
parent | 7a6daab64224ab091bc55c2f35a42e2d80ce3369 (diff) |
Enable overriding the configuration penalty
This relieves exact matches of the need to duplicate the bookeeping done
by FOUNDCFG()
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/audio_unit.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index 697c5feb4c..b5af76ced6 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -1365,13 +1365,8 @@ AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out, Cha # pragma clang diagnostic ignored "-Wtautological-compare" #endif -#define FOUNDCFG_IMPRECISE(in, out) { \ - float p = fabsf ((float)(out) - preferred_out); \ - if (in != audio_in) { \ - p += 1000; \ - } \ +#define FOUNDCFG_PENALTY(in, out, p) { \ _output_configs.insert (out); \ - if ((out) > preferred_out) { p *= 1.1; } \ if (p < penalty) { \ used_possible_in = possible_in; \ audio_out = (out); \ @@ -1385,6 +1380,15 @@ 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; } \ + FOUNDCFG_PENALTY(in, out, p); \ +} + #define FOUNDCFG(out) \ FOUNDCFG_IMPRECISE(audio_in, out) @@ -1413,13 +1417,9 @@ AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out, Cha DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("\tCHOSEN: %1 in %2 out to match in %3 out %4\n", possible_in, possible_out, in, out)); - _output_configs.insert (preferred_out); - used_possible_in = possible_in; - audio_out = preferred_out; /* Set penalty so low that this output configuration * will trump any other one */ - penalty = -1 - found = true; + FOUNDCFG_PENALTY(audio_in, preferred_out, -1); break; } |