summaryrefslogtreecommitdiff
path: root/libs/ardour/luaproc.cc
diff options
context:
space:
mode:
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2016-08-01 15:01:44 +0200
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2016-08-06 19:38:09 +0200
commit0f00d5147129259db94783c67c49e37c944da086 (patch)
tree222ddf4f4395881ff92b235677ec13ec6a5edf8c /libs/ardour/luaproc.cc
parent4c7242545bf7c5171851de260a74f583b55c7ea3 (diff)
Move a MIDI test in the table handling loop...
...to later enable that condition truthiness to depend on the loop iteration. The goal here is to prepare for the upcoming rewrite, without introducing any policy change for now. There is no behavior change because if all loop iterations are skipped, then \found will be false, and with \imprecise being null the last attempt will be skipped and we will return false.
Diffstat (limited to 'libs/ardour/luaproc.cc')
-rw-r--r--libs/ardour/luaproc.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc
index f1f64f038b..6af4a1842e 100644
--- a/libs/ardour/luaproc.cc
+++ b/libs/ardour/luaproc.cc
@@ -346,10 +346,6 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan
// caller must hold process lock (no concurrent calls to interpreter
_output_configs.clear ();
- if (in.n_midi() > 0 && !_has_midi_input && !imprecise) {
- return false;
- }
-
lua_State* L = lua.getState ();
luabridge::LuaRef ioconfig = luabridge::getGlobal (L, "dsp_ioconfig");
if (!ioconfig.isFunction ()) {
@@ -379,6 +375,7 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan
}
const int audio_in = in.n_audio ();
+ const int midi_in = in.n_midi ();
// preferred setting (provided by plugin_insert)
const int preferred_out = out.n_audio ();
@@ -416,6 +413,11 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan
int possible_in = io["audio_in"].isNumber() ? io["audio_in"] : -1;
int possible_out = io["audio_out"].isNumber() ? io["audio_out"] : -1;
+ int possible_midiin = _has_midi_input ? 1 : 0;
+
+ if (midi_in > 0 && possible_midiin == 0 && !imprecise) {
+ continue;
+ }
// exact match
if ((possible_in == audio_in) && (possible_out == preferred_out)) {