diff options
author | Robin Gareus <robin@gareus.org> | 2017-12-05 01:32:48 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-12-05 01:55:38 +0100 |
commit | f3be5bb421822aa7644b63eea2317f9849f31d57 (patch) | |
tree | 6bb5ef100b0617d5704bdd06903a3cc3f272e661 /gtk2_ardour/luainstance.cc | |
parent | bb5345614d6d4860c619e96fa174b3ffd4e8c262 (diff) |
Lua Script-Selector update
* register bindings for action_param
* honor pre-seeded value (don't ask)
* allow to pre-seed a script-name
* allow to cancel interactive script load at parameter-stage
Diffstat (limited to 'gtk2_ardour/luainstance.cc')
-rw-r--r-- | gtk2_ardour/luainstance.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gtk2_ardour/luainstance.cc b/gtk2_ardour/luainstance.cc index 156ad11d34..68fef8920f 100644 --- a/gtk2_ardour/luainstance.cc +++ b/gtk2_ardour/luainstance.cc @@ -1330,11 +1330,20 @@ LuaInstance::interactive_add (LuaScriptInfo::ScriptType type, int id) return false; } - LuaScriptParamList lsp = LuaScriptParams::script_params (spi, param_function); + LuaState ls; + register_classes (ls.getState ()); + LuaScriptParamList lsp = LuaScriptParams::script_params (ls, spi->path, param_function); + + /* allow cancel */ + for (size_t i = 0; i < lsp.size(); ++i) { + if (lsp[i]->preseeded && lsp[i]->name == "x-script-abort") { + return false; + } + } ScriptParameterDialog spd (_("Set Script Parameters"), spi, reg, lsp); - if (!spd.need_interation ()) { + if (spd.need_interation ()) { switch (spd.run ()) { case Gtk::RESPONSE_ACCEPT: break; @@ -1343,7 +1352,7 @@ LuaInstance::interactive_add (LuaScriptInfo::ScriptType type, int id) } } - LuaScriptParamPtr lspp (new LuaScriptParam("x-script-origin", "", spi->path, false)); + LuaScriptParamPtr lspp (new LuaScriptParam("x-script-origin", "", spi->path, false, true)); lsp.push_back (lspp); switch (type) { |