13
0

Enable overriding the configuration penalty

This is useful for exact matches that would otherwise need to duplicate
the bookeeping done by FOUNDCFG()
This commit is contained in:
Julien "_FrnchFrgg_" RIVAUD 2016-08-02 21:28:22 +02:00
parent 80541de283
commit 8311607e5c

View File

@ -385,13 +385,8 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan
float penalty = 9999;
bool found = false;
#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) { \
audio_out = (out); \
if (imprecise) { \
@ -404,6 +399,15 @@ 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; } \
FOUNDCFG_PENALTY(in, out, p); \
}
#define FOUNDCFG(out) \
FOUNDCFG_IMPRECISE(audio_in, out)