ensure that Lua DSP scripts are configured (even with 0 channels)
authorRobin Gareus <robin@gareus.org>
Sat, 17 Sep 2016 23:10:53 +0000 (01:10 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 17 Sep 2016 23:17:05 +0000 (01:17 +0200)
This fixes an issue with dsp_configure not being when there are
only MIDI signals at the given insertion point.

libs/ardour/ardour/luaproc.h
libs/ardour/luaproc.cc

index e38e8fbeedcca2995f7a8a4c67da81017088b7ba..d0d919b6c36d9e46108b96ac7446df136b2de310 100644 (file)
@@ -173,6 +173,8 @@ private:
        ChanCount _configured_in;
        ChanCount _configured_out;
 
+       bool      _configured;
+
        ChanCount _selected_in;
        ChanCount _selected_out;
 
index 7b676167de79e931fe3446cb8ea5c71930121f54..752aa8108fb5b32e34e4b8806a087c3ea5fc7c6b 100644 (file)
@@ -61,6 +61,7 @@ LuaProc::LuaProc (AudioEngine& engine,
        , _designated_bypass_port (UINT32_MAX)
        , _control_data (0)
        , _shadow_data (0)
+       , _configured (false)
        , _has_midi_input (false)
        , _has_midi_output (false)
 {
@@ -91,6 +92,7 @@ LuaProc::LuaProc (const LuaProc &other)
        , _designated_bypass_port (UINT32_MAX)
        , _control_data (0)
        , _shadow_data (0)
+       , _configured (false)
        , _has_midi_input (false)
        , _has_midi_output (false)
 {
@@ -526,7 +528,7 @@ LuaProc::configure_io (ChanCount in, ChanCount out)
        _info->n_outputs = _selected_out;
 
        // configure the DSP if needed
-       if (in != _configured_in || out != _configured_out) {
+       if (in != _configured_in || out != _configured_out || !_configured) {
                lua_State* L = lua.getState ();
                luabridge::LuaRef lua_dsp_configure = luabridge::getGlobal (L, "dsp_configure");
                if (lua_dsp_configure.type () == LUA_TFUNCTION) {
@@ -563,6 +565,7 @@ LuaProc::configure_io (ChanCount in, ChanCount out)
                                        _info->n_inputs = lin;
                                        _info->n_outputs = lout;
                                }
+                               _configured = true;
                        } catch (luabridge::LuaException const& e) {
                                PBD::error << "LuaException: " << e.what () << "\n";
 #ifndef NDEBUG