Add Lua API to query all automatable params

This commit is contained in:
Robin Gareus
2021-06-30 19:22:22 +02:00
parent bf43c8d2d4
commit 8a6f630736
3 changed files with 15 additions and 1 deletions

View File

@@ -101,6 +101,10 @@ public:
void protect_automation ();
const std::set<Evoral::Parameter>& what_can_be_automated() const { return _can_automate_list; }
/** API for Lua binding */
std::vector<Evoral::Parameter> all_automatable_params () const;
void what_has_existing_automation (std::set<Evoral::Parameter>&) const;
static const std::string xml_node_name;

View File

@@ -227,6 +227,12 @@ Automatable::can_automate (Evoral::Parameter what)
_can_automate_list.insert (what);
}
std::vector<Evoral::Parameter>
Automatable::all_automatable_params () const
{
return std::vector<Evoral::Parameter> (_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.

View File

@@ -256,6 +256,7 @@ CLASSKEYS(std::vector<ARDOUR::Plugin::PresetRecord>);
CLASSKEYS(std::vector<boost::shared_ptr<ARDOUR::Processor> >);
CLASSKEYS(std::vector<boost::shared_ptr<ARDOUR::Source> >);
CLASSKEYS(std::vector<boost::shared_ptr<ARDOUR::Readable> >);
CLASSKEYS(std::vector<Evoral::Parameter>);
CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::PluginInfo> >); // PluginInfoList
CLASSKEYS(std::list<ArdourMarker*>);
@@ -1410,7 +1411,7 @@ LuaBindings::common (lua_State* L)
.deriveWSPtrClass <Automatable, Evoral::ControlSet> ("Automatable")
.addCast<Slavable> ("to_slavable")
.addFunction ("automation_control", (boost::shared_ptr<AutomationControl>(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 <AutomatableSequence<Temporal::Beats>, Automatable> ("AutomatableSequence")
@@ -1852,6 +1853,9 @@ LuaBindings::common (lua_State* L)
.beginConstStdCPtrList <Location> ("LocationList")
.endClass ()
.beginConstStdVector <Evoral::Parameter> ("ParameterList")
.endClass ()
// std::list<boost::shared_ptr<AutomationControl> > ControlList
.beginStdList <boost::shared_ptr<AutomationControl> > ("ControlList")
.endClass ()