Enable overriding the configuration penalty
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Tue, 2 Aug 2016 19:28:22 +0000 (21:28 +0200)
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Sat, 6 Aug 2016 17:38:09 +0000 (19:38 +0200)
This is useful for exact matches that would otherwise need to duplicate
the bookeeping done by FOUNDCFG()

libs/ardour/luaproc.cc

index 52b567711d479065495a8df399cb6a9d4e600f8d..27de050c311b1800c6fe1c856294c3165ab07f74 100644 (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)