Pre-seed Lua action-buttons
This commit is contained in:
parent
3208535c20
commit
d226b63e70
@ -1320,6 +1320,7 @@ LuaInstance::load_state ()
|
|||||||
{
|
{
|
||||||
std::string uiscripts;
|
std::string uiscripts;
|
||||||
if (!find_file (ardour_config_search_path(), ui_scripts_file_name, uiscripts)) {
|
if (!find_file (ardour_config_search_path(), ui_scripts_file_name, uiscripts)) {
|
||||||
|
pre_seed_scripts ();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
XMLTree tree;
|
XMLTree tree;
|
||||||
@ -1466,6 +1467,24 @@ LuaInstance::set_state (const XMLNode& node)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LuaInstance::pre_seed_scripts ()
|
||||||
|
{
|
||||||
|
LuaScriptInfoPtr spi = LuaScripting::instance ().by_name ("Mixer Screenshot", LuaScriptInfo::EditorAction);
|
||||||
|
int id = 0;
|
||||||
|
if (spi) {
|
||||||
|
try {
|
||||||
|
std::string script = Glib::file_get_contents (spi->path);
|
||||||
|
LuaState ls;
|
||||||
|
register_classes (ls.getState ());
|
||||||
|
LuaScriptParamList lsp = LuaScriptParams::script_params (ls, spi->path, "action_params");
|
||||||
|
LuaScriptParamPtr lspp (new LuaScriptParam("x-script-origin", "", spi->path, false, true));
|
||||||
|
lsp.push_back (lspp);
|
||||||
|
set_lua_action (id++, "Mixer Screenshot", script, lsp);
|
||||||
|
} catch (...) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
LuaInstance::interactive_add (LuaScriptInfo::ScriptType type, int id)
|
LuaInstance::interactive_add (LuaScriptInfo::ScriptType type, int id)
|
||||||
{
|
{
|
||||||
|
@ -155,6 +155,7 @@ private:
|
|||||||
void init ();
|
void init ();
|
||||||
void set_dirty ();
|
void set_dirty ();
|
||||||
void session_going_away ();
|
void session_going_away ();
|
||||||
|
void pre_seed_scripts ();
|
||||||
|
|
||||||
LuaState lua;
|
LuaState lua;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user