From 8a6f6307368474d7f2f7f5e67fab440b8c91a7bf Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 30 Jun 2021 19:22:22 +0200 Subject: [PATCH] Add Lua API to query all automatable params --- libs/ardour/ardour/automatable.h | 4 ++++ libs/ardour/automatable.cc | 6 ++++++ libs/ardour/luabindings.cc | 6 +++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/libs/ardour/ardour/automatable.h b/libs/ardour/ardour/automatable.h index 5b413f0b54..2bb81622b2 100644 --- a/libs/ardour/ardour/automatable.h +++ b/libs/ardour/ardour/automatable.h @@ -101,6 +101,10 @@ public: void protect_automation (); const std::set& what_can_be_automated() const { return _can_automate_list; } + + /** API for Lua binding */ + std::vector all_automatable_params () const; + void what_has_existing_automation (std::set&) const; static const std::string xml_node_name; diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc index 263b35f35d..7649f36bcb 100644 --- a/libs/ardour/automatable.cc +++ b/libs/ardour/automatable.cc @@ -227,6 +227,12 @@ Automatable::can_automate (Evoral::Parameter what) _can_automate_list.insert (what); } +std::vector +Automatable::all_automatable_params () const +{ + return std::vector (_can_automate_list.begin (), _can_automate_list.end ()); +} + /** \a legacy_param is used for loading legacy sessions where an object (IO, Panner) * had a single automation parameter, with it's type implicit. Derived objects should * pass that type and it will be used for the untyped AutomationList found. diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index f2d3d6647c..b7033cf4f3 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -256,6 +256,7 @@ CLASSKEYS(std::vector); CLASSKEYS(std::vector >); CLASSKEYS(std::vector >); CLASSKEYS(std::vector >); +CLASSKEYS(std::vector); CLASSKEYS(std::list >); // PluginInfoList CLASSKEYS(std::list); @@ -1410,7 +1411,7 @@ LuaBindings::common (lua_State* L) .deriveWSPtrClass ("Automatable") .addCast ("to_slavable") .addFunction ("automation_control", (boost::shared_ptr(Automatable::*)(const Evoral::Parameter&, bool))&Automatable::automation_control) - //.addFunction ("what_can_be_automated", &Automatable::what_can_be_automated) + .addFunction ("all_automatable_params", &Automatable::all_automatable_params) .endClass () .deriveWSPtrClass , Automatable> ("AutomatableSequence") @@ -1852,6 +1853,9 @@ LuaBindings::common (lua_State* L) .beginConstStdCPtrList ("LocationList") .endClass () + .beginConstStdVector ("ParameterList") + .endClass () + // std::list > ControlList .beginStdList > ("ControlList") .endClass ()