summaryrefslogtreecommitdiff
path: root/libs/ardour/luaproc.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-07-02 20:29:59 +0200
committerRobin Gareus <robin@gareus.org>2016-07-02 23:36:34 +0200
commitc50a0c5dd019028d33819caeb90efcc09481a259 (patch)
treeedc867477a21ca1d3ccb04fd62542c116f8d3a3b /libs/ardour/luaproc.cc
parentd027ce800625d00e4cb96fd27410a575c9b6d895 (diff)
only reconfigure lua DSP plugins if channelcount changes
Diffstat (limited to 'libs/ardour/luaproc.cc')
-rw-r--r--libs/ardour/luaproc.cc30
1 files changed, 16 insertions, 14 deletions
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc
index 63b4e11299..03deea7114 100644
--- a/libs/ardour/luaproc.cc
+++ b/libs/ardour/luaproc.cc
@@ -589,27 +589,29 @@ 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
- lua_State* L = lua.getState ();
- luabridge::LuaRef lua_dsp_configure = luabridge::getGlobal (L, "dsp_configure");
- if (lua_dsp_configure.type () == LUA_TFUNCTION) {
- try {
- lua_dsp_configure (&in, &out);
- } catch (luabridge::LuaException const& e) {
- PBD::error << "LuaException: " << e.what () << "\n";
+ 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) {
+ try {
+ lua_dsp_configure (&in, &out);
+ } catch (luabridge::LuaException const& e) {
+ PBD::error << "LuaException: " << e.what () << "\n";
#ifndef NDEBUG
- std::cerr << "LuaException: " << e.what () << "\n";
+ std::cerr << "LuaException: " << e.what () << "\n";
#endif
- return false;
+ return false;
+ }
}
}
+ _configured_in = in;
+ _configured_out = out;
+
_info->n_inputs = _configured_in;
_info->n_outputs = _configured_out;
return true;