diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 3972fc76da..19e0467847 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -712,7 +712,7 @@ private: gint really_remove_region_marker (ArdourMarker*); void goto_nth_marker (int nth); void trigger_script (int nth); - void trigger_script_by_name (const std::string script_name); + void trigger_script_by_name (const std::string script_name, const std::string args = ""); void toggle_marker_lines (); void set_marker_line_visibility (bool); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 536b39f70b..3050f7ccfc 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -873,7 +873,7 @@ static void _lua_print (std::string s) { } void -Editor::trigger_script_by_name (const std::string script_name) +Editor::trigger_script_by_name (const std::string script_name, const std::string in_args) { string script_path; ARDOUR::LuaScriptList scr = LuaScripting::instance ().scripts(LuaScriptInfo::EditorAction); @@ -901,6 +901,8 @@ Editor::trigger_script_by_name (const std::string script_name) lua.do_file (script_path); luabridge::LuaRef args (luabridge::newTable (L)); + args[1] = in_args; + try { luabridge::LuaRef fn = luabridge::getGlobal (L, "factory"); if (fn.isFunction()) { diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 0978083b81..6c876abb20 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -400,6 +400,8 @@ public: virtual void set_video_timeline_height (const int h) = 0; virtual void embed_audio_from_video (std::string, samplepos_t n = 0, bool lock_position_to_video = true) = 0; + virtual void trigger_script_by_name (const std::string script_name, const std::string args = "") = 0; + virtual bool track_selection_change_without_scroll () const = 0; virtual bool show_touched_automation () const = 0;