From d2d268263c131f1c9d1f6b0af3a78a99a2f61364 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 26 Feb 2021 13:34:24 +0100 Subject: [PATCH] Add Lua Bindings to access Bundles --- libs/ardour/luabindings.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index 1bcd5fbe11..768b131568 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -43,6 +43,7 @@ #include "ardour/audioplaylist.h" #include "ardour/audiorom.h" #include "ardour/buffer_set.h" +#include "ardour/bundle.h" #include "ardour/beats_samples_converter.h" #include "ardour/chan_mapping.h" #include "ardour/convolver.h" @@ -93,6 +94,7 @@ #include "ardour/stripable.h" #include "ardour/track.h" #include "ardour/tempo.h" +#include "ardour/user_bundle.h" #include "ardour/vca.h" #include "ardour/vca_manager.h" @@ -260,8 +262,10 @@ CLASSKEYS(std::list); CLASSKEYS(std::list >); CLASSKEYS(std::list >); CLASSKEYS(std::list >); +CLASSKEYS(std::list >); CLASSKEYS(std::list >); CLASSKEYS(boost::shared_ptr > >); +CLASSKEYS(boost::shared_ptr > >); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); @@ -1170,6 +1174,19 @@ LuaBindings::common (lua_State* L) #endif .endClass () + .beginWSPtrClass ("Bundle") + .addCast ("to_userbundle") + .addFunction ("name", &Bundle::name) + .addFunction ("n_total", &Bundle::n_total) + .addFunction ("nchannels", &Bundle::nchannels) + .addFunction ("channel_name", &Bundle::channel_name) + .addFunction ("ports_are_inputs", &Bundle::ports_are_inputs) + .addFunction ("ports_are_outputs", &Bundle::ports_are_outputs) + .endClass () + + .deriveWSPtrClass ("UserBundle") + .endClass () + .deriveWSPtrClass ("AudioPlaylist") .addFunction ("read", &AudioPlaylist::read) .endClass () @@ -1740,6 +1757,11 @@ LuaBindings::common (lua_State* L) .addVoidPtrConstructor > > () .endClass () + // boost::shared_ptr + .beginPtrStdVector > ("BundleListPtr") + .addVoidPtrConstructor > > () + .endClass () + // typedef std::list > WeakRouteList .beginConstStdList > ("WeakRouteList") .endClass () @@ -2477,6 +2499,8 @@ LuaBindings::common (lua_State* L) .addFunction ("get_routelist", &Session::get_routelist) .addFunction ("plot_process_graph", &Session::plot_process_graph) + .addFunction ("bundles", &Session::bundles) + .addFunction ("name", &Session::name) .addFunction ("path", &Session::path) .addFunction ("record_status", &Session::record_status)