X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fluaproc.cc;h=09be770b0a9bd2b4719acfdfffe68d58832d124e;hb=539c062ed23daf308e650b5d1039384ac5a55666;hp=f2db7848c8946857131dd10158264c97b734b0d8;hpb=93aa03ee2a54a02ef8df74cdf16539ebba827cf2;p=ardour.git diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc index f2db7848c8..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); \ } @@ -462,23 +461,6 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan continue; } - if (possible_in == 0) { - /* no inputs, generators & instruments */ - if (possible_out == -1 || possible_out == -2) { - /* any output configuration possible - * out == -2 is invalid, interpreted as out == -1 */ - FOUNDCFG (preferred_out); - ANYTHINGGOES; - } else if (possible_out < -2) { - /* variable number of outputs up to -N, */ - FOUNDCFG (min (-possible_out, preferred_out)); - UPTO (-possible_out); - } else { - /* exact number of outputs */ - FOUNDCFG (possible_out); - } - } - if (possible_in == -1 || possible_in == -2) { /* wildcard for input */ if (possible_out == possible_in) { @@ -501,10 +483,10 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan } } - if (possible_in < -2 || possible_in > 0) { + if (possible_in < -2 || possible_in >= 0) { /* specified number, exact or up to */ int desired_in; - if (possible_in > 0) { + if (possible_in >= 0) { /* configuration can only match possible_in */ desired_in = possible_in; } else {