summaryrefslogtreecommitdiff
path: root/libs/ardour/luaproc.cc
diff options
context:
space:
mode:
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2016-08-02 21:28:22 +0200
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2016-08-06 19:38:09 +0200
commit8311607e5c2ffa16dde1b65b8e40b2ad77f8d70d (patch)
tree5f97fdb632cafc5aab5d1a2bf1082740d53c9023 /libs/ardour/luaproc.cc
parent80541de2830359a04450fc69353f778bd13acb8b (diff)
Enable overriding the configuration penalty
This is useful for exact matches that would otherwise need to duplicate the bookeeping done by FOUNDCFG()
Diffstat (limited to 'libs/ardour/luaproc.cc')
-rw-r--r--libs/ardour/luaproc.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc
index 52b567711d..27de050c31 100644
--- a/libs/ardour/luaproc.cc
+++ b/libs/ardour/luaproc.cc
@@ -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)