, lua (lua_newstate (&PBD::ReallocPool::lalloc, &_mempool))
#endif
, _lua_dsp (0)
+ , _lua_latency (0)
, _script (script)
, _lua_does_channelmapping (false)
, _lua_has_inline_display (false)
, _designated_bypass_port (UINT32_MAX)
+ , _signal_latency (0)
, _control_data (0)
, _shadow_data (0)
, _configured (false)
, lua (lua_newstate (&PBD::ReallocPool::lalloc, &_mempool))
#endif
, _lua_dsp (0)
+ , _lua_latency (0)
, _script (other.script ())
, _origin (other._origin)
, _lua_does_channelmapping (false)
, _lua_has_inline_display (false)
, _designated_bypass_port (UINT32_MAX)
+ , _signal_latency (0)
, _control_data (0)
, _shadow_data (0)
, _configured (false)
#endif
lua.do_command ("collectgarbage();");
delete (_lua_dsp);
+ delete (_lua_latency);
delete [] _control_data;
delete [] _shadow_data;
}
assert (0);
}
+ luabridge::LuaRef lua_dsp_latency = luabridge::getGlobal (L, "dsp_latency");
+ if (lua_dsp_latency.type () == LUA_TFUNCTION) {
+ _lua_latency = new luabridge::LuaRef (lua_dsp_latency);
+ }
+
// initialize the DSP if needed
luabridge::LuaRef lua_dsp_init = luabridge::getGlobal (L, "dsp_init");
if (lua_dsp_init.type () == LUA_TFUNCTION) {
}
}
}
+
+ if (_lua_latency) {
+ _signal_latency = (*_lua_latency)();
+ }
+
} catch (luabridge::LuaException const& e) {
PBD::error << "LuaException: " << e.what () << "\n";
#ifndef NDEBUG
try {
script = Glib::file_get_contents (path);
- } catch (Glib::FileError err) {
+ } catch (Glib::FileError const& err) {
return PluginPtr ();
}