diff options
author | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2016-08-04 12:29:19 +0200 |
---|---|---|
committer | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2016-08-06 19:38:09 +0200 |
commit | 79f66a36b45cc3fbe0218b8af9377377332968d6 (patch) | |
tree | 523d57fd57801550bb88d060e05a262d238c42bd /libs | |
parent | 5691abdf031b8958649f3d6da665be15becdaec8 (diff) |
Take midi into account for penalty computation
Demote configurations if they have mismatched midi in or out with the
same mechanism as for audio, but with lower coefficients so that
mismatched midi has less influence than mismatched audio in selecting
the best configuration.
POLICY CHANGE.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/luaproc.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc index 35e39fe4eb..46fc0aef2f 100644 --- a/libs/ardour/luaproc.cc +++ b/libs/ardour/luaproc.cc @@ -379,6 +379,7 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan // preferred setting (provided by plugin_insert) const int preferred_out = out.n_audio (); + const int preferred_midiout = out.n_midi (); int midi_out = -1; int audio_out = -1; @@ -402,8 +403,12 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan #define FOUNDCFG_IMPRECISE(in, out) { \ const float p = fabsf ((float)(out) - preferred_out) * \ (((out) > preferred_out) ? 1.1 : 1) \ + + fabsf ((float)possible_midiout - preferred_midiout) * \ + ((possible_midiout - preferred_midiout) ? 0.6 : 0.5) \ + fabsf ((float)(in) - audio_in) * \ - (((in) > audio_in) ? 275 : 250); \ + (((in) > audio_in) ? 275 : 250) \ + + fabsf ((float)possible_midiin - midi_in) * \ + ((possible_midiin - midi_in) ? 100 : 110); \ FOUNDCFG_PENALTY(in, out, p); \ } |