lua_setglobal (L, "self");
// sandbox
- lua.do_command ("io = nil os = nil loadfile = nil require = nil dofile = nil package = nil debug = nil");
+ lua.sandbox (true);
#if 0
lua.do_command ("for n in pairs(_G) do print(n) end print ('----')"); // print global env
#endif
luabridge::LuaRef lua_dsp_init = luabridge::getGlobal (L, "dsp_init");
if (lua_dsp_init.type () == LUA_TFUNCTION) {
try {
- lua_dsp_init (_session.nominal_frame_rate ());
+ lua_dsp_init (_session.nominal_sample_rate ());
} catch (luabridge::LuaException const& e) {
- ;
- }
+ } catch (...) { }
}
_ctrl_params.clear ();
}
} catch (luabridge::LuaException const& e) {
_iotable = NULL;
+ } catch (...) {
+ _iotable = NULL;
}
}
std::cerr << "LuaException: " << e.what () << "\n";
#endif
return false;
+ } catch (...) {
+ return false;
}
}
}
int
LuaProc::connect_and_run (BufferSet& bufs,
- framepos_t start, framepos_t end, double speed,
+ samplepos_t start, samplepos_t end, double speed,
ChanMapping in, ChanMapping out,
- pframes_t nframes, framecnt_t offset)
+ pframes_t nframes, samplecnt_t offset)
{
if (!_lua_dsp) {
return 0;
if (valid) {
for (MidiBuffer::iterator m = bufs.get_midi(idx).begin();
m != bufs.get_midi(idx).end(); ++m, ++e) {
- const Evoral::Event<framepos_t> ev(*m, false);
+ const Evoral::Event<samplepos_t> ev(*m, false);
luabridge::LuaRef lua_midi_data (luabridge::newTable (L));
const uint8_t* data = ev.buffer();
for (uint32_t i = 0; i < ev.size(); ++i) {
if (!i.value ()["time"].isNumber ()) { continue; }
if (!i.value ()["data"].isTable ()) { continue; }
luabridge::LuaRef data_tbl (i.value ()["data"]);
- framepos_t tme = i.value ()["time"];
+ samplepos_t tme = i.value ()["time"];
if (tme < 1 || tme > nframes) { continue; }
uint8_t data[64];
size_t size = 0;
std::cerr << "LuaException: " << e.what () << "\n";
#endif
return -1;
+ } catch (...) {
+ return -1;
}
#ifdef WITH_LUAPROC_STATS
int64_t t1 = g_get_monotonic_time ();