From c2ffa07e28882f0186348c74128c865dd61a84d2 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 1 Aug 2020 01:16:45 +0200 Subject: [PATCH] Pre-seed scripts: add "List Plugins" --- gtk2_ardour/luainstance.cc | 13 ++++++++++--- gtk2_ardour/luainstance.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/luainstance.cc b/gtk2_ardour/luainstance.cc index 72c5c4640e..10c12da7e1 100644 --- a/gtk2_ardour/luainstance.cc +++ b/gtk2_ardour/luainstance.cc @@ -1498,10 +1498,9 @@ LuaInstance::set_state (const XMLNode& node) } void -LuaInstance::pre_seed_scripts () +LuaInstance::pre_seed_script (std::string const& name, int& id) { - LuaScriptInfoPtr spi = LuaScripting::instance ().by_name ("Mixer Screenshot", LuaScriptInfo::EditorAction); - int id = 0; + LuaScriptInfoPtr spi = LuaScripting::instance ().by_name (name, LuaScriptInfo::EditorAction); if (spi) { try { std::string script = Glib::file_get_contents (spi->path); @@ -1515,6 +1514,14 @@ LuaInstance::pre_seed_scripts () } } +void +LuaInstance::pre_seed_scripts () +{ + int id = 0; + pre_seed_script ("Mixer Screenshot", id); + pre_seed_script ("List Plugins", id); +} + bool LuaInstance::interactive_add (LuaScriptInfo::ScriptType type, int id) { diff --git a/gtk2_ardour/luainstance.h b/gtk2_ardour/luainstance.h index adf2ff4a16..9318ae4d3f 100644 --- a/gtk2_ardour/luainstance.h +++ b/gtk2_ardour/luainstance.h @@ -156,6 +156,7 @@ private: void set_dirty (); void session_going_away (); void pre_seed_scripts (); + void pre_seed_script (std::string const&, int&); LuaState lua;