13
0

only reconfigure lua DSP plugins if channelcount changes

This commit is contained in:
Robin Gareus 2016-07-02 20:29:59 +02:00
parent d027ce8006
commit c50a0c5dd0

View File

@ -589,13 +589,11 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan
bool
LuaProc::configure_io (ChanCount in, ChanCount out)
{
_configured_in = in;
_configured_out = out;
_configured_in.set (DataType::MIDI, _has_midi_input ? 1 : 0);
_configured_out.set (DataType::MIDI, _has_midi_output ? 1 : 0);
in.set (DataType::MIDI, _has_midi_input ? 1 : 0);
out.set (DataType::MIDI, _has_midi_output ? 1 : 0);
// configure the DSP if needed
if (in != _configured_in || out != _configured_out) {
lua_State* L = lua.getState ();
luabridge::LuaRef lua_dsp_configure = luabridge::getGlobal (L, "dsp_configure");
if (lua_dsp_configure.type () == LUA_TFUNCTION) {
@ -609,6 +607,10 @@ LuaProc::configure_io (ChanCount in, ChanCount out)
return false;
}
}
}
_configured_in = in;
_configured_out = out;
_info->n_inputs = _configured_in;
_info->n_outputs = _configured_out;