diff --git a/gtk2_ardour/luainstance.cc b/gtk2_ardour/luainstance.cc index c813eeea63..0f02f943ea 100644 --- a/gtk2_ardour/luainstance.cc +++ b/gtk2_ardour/luainstance.cc @@ -37,6 +37,7 @@ #include "luainstance.h" #include "luasignal.h" #include "marker.h" +#include "processor_box.h" #include "time_axis_view.h" #include "selection.h" #include "script_selector.h" @@ -349,6 +350,16 @@ const char *luasignalstr[] = { }; // namespace +/** special cases for Ardour's Mixer UI */ +namespace LuaMixer { + + ProcessorBox::ProcSelection + processor_selection (lua_State* L) { + return ProcessorBox::current_processor_selection (); + } + +}; + //////////////////////////////////////////////////////////////////////////////// #define xstr(s) stringify(s) @@ -545,6 +556,8 @@ LuaInstance::register_classes (lua_State* L) .addFunction ("http_get", (std::string (*)(const std::string&))&ArdourCurl::http_get) + .addFunction ("processor_selection", &LuaMixer::processor_selection) + .beginStdList ("ArdourMarkerList") .endClass () diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index 5dd7483be4..5f0115529c 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -454,6 +454,16 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD static Gtkmm2ext::Bindings* bindings; static void register_actions(); + typedef std::vector > ProcSelection; + + static ProcSelection current_processor_selection () { + ProcSelection ps; + if (_current_processor_box) { + _current_processor_box->get_selected_processors (ps); + } + return ps; + } + #ifndef NDEBUG static bool show_all_processors; #endif @@ -535,8 +545,6 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD void ab_plugins (); - typedef std::vector > ProcSelection; - void cut_processors (const ProcSelection&); void copy_processors (const ProcSelection&); void delete_processors (const ProcSelection&);