diff options
author | Robin Gareus <robin@gareus.org> | 2017-03-17 18:12:50 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-03-17 18:12:50 +0100 |
commit | 6c1051024c5be1c023502958f2ef49c63942af96 (patch) | |
tree | 31d5472d0cc6868361dea9265bfbdcef4061e525 /libs/ardour | |
parent | 7ab1becd43c38921f21d84a2f313e9895e0e72c6 (diff) |
Lua bindings for libardour transient-analysis
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/region.h | 7 | ||||
-rw-r--r-- | libs/ardour/luabindings.cc | 11 |
2 files changed, 18 insertions, 0 deletions
diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 85e0442a41..f51f54b00c 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -326,6 +326,13 @@ class LIBARDOUR_API Region // no transients, but its OK } + /* wrapper to the above for easy access throug Lua */ + AnalysisFeatureList transients () { + AnalysisFeatureList rv; + get_transients (rv); + return rv; + } + bool has_transients () const; virtual int separate_by_channel (ARDOUR::Session&, diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index ac94644c3e..d9f460461f 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -203,6 +203,7 @@ CLASSKEYS(std::vector<std::string>); CLASSKEYS(std::vector<float>); CLASSKEYS(std::vector<float*>); CLASSKEYS(std::vector<double>); +CLASSKEYS(std::list<int64_t>); CLASSKEYS(std::vector<ARDOUR::Plugin::PresetRecord>); CLASSKEYS(std::vector<boost::shared_ptr<ARDOUR::Processor> >); @@ -314,6 +315,10 @@ LuaBindings::stddef (lua_State* L) .beginStdVector <float*> ("FloatArrayVector") .endClass () + // framepos_t, frameoffset_t lists e.g. AnalysisFeatureList + .beginStdList <int64_t> ("Int64List") + .endClass () + // TODO std::set .endNamespace (); } @@ -1002,6 +1007,7 @@ LuaBindings::common (lua_State* L) .addFunction ("regions_at", &Playlist::regions_at) .addFunction ("top_region_at", &Playlist::top_region_at) .addFunction ("top_unmuted_region_at", &Playlist::top_unmuted_region_at) + .addFunction ("find_next_transient", &Playlist::find_next_transient) .addFunction ("find_next_region", &Playlist::find_next_region) .addFunction ("find_next_region_boundary", &Playlist::find_next_region_boundary) .addFunction ("count_regions_at", &Playlist::count_regions_at) @@ -1087,6 +1093,10 @@ LuaBindings::common (lua_State* L) .addFunction ("covers", &Region::covers) .addFunction ("at_natural_position", &Region::at_natural_position) .addFunction ("is_compound", &Region::is_compound) + + .addFunction ("has_transients", &Region::has_transients) + .addFunction ("transients", (AnalysisFeatureList (Region::*)())&Region::transients) + /* editing operations */ .addFunction ("set_length", &Region::set_length) .addFunction ("set_start", &Region::set_start) @@ -1171,6 +1181,7 @@ LuaBindings::common (lua_State* L) .deriveWSPtrClass <Automatable, Evoral::ControlSet> ("Automatable") .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) .endClass () .deriveWSPtrClass <AutomatableSequence<Evoral::Beats>, Automatable> ("AutomatableSequence") |