13
0

Add Lua Bindings to access Bundles

This commit is contained in:
Robin Gareus 2021-02-26 13:34:24 +01:00
parent 61b29c5810
commit d2d268263c
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -43,6 +43,7 @@
#include "ardour/audioplaylist.h" #include "ardour/audioplaylist.h"
#include "ardour/audiorom.h" #include "ardour/audiorom.h"
#include "ardour/buffer_set.h" #include "ardour/buffer_set.h"
#include "ardour/bundle.h"
#include "ardour/beats_samples_converter.h" #include "ardour/beats_samples_converter.h"
#include "ardour/chan_mapping.h" #include "ardour/chan_mapping.h"
#include "ardour/convolver.h" #include "ardour/convolver.h"
@ -93,6 +94,7 @@
#include "ardour/stripable.h" #include "ardour/stripable.h"
#include "ardour/track.h" #include "ardour/track.h"
#include "ardour/tempo.h" #include "ardour/tempo.h"
#include "ardour/user_bundle.h"
#include "ardour/vca.h" #include "ardour/vca.h"
#include "ardour/vca_manager.h" #include "ardour/vca_manager.h"
@ -260,8 +262,10 @@ CLASSKEYS(std::list<ARDOUR::AudioRange>);
CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Port> >); CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Port> >);
CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Region> >); CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Region> >);
CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Route> >); CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Route> >);
CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Route> >);
CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Stripable> >); CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Stripable> >);
CLASSKEYS(boost::shared_ptr<std::list<boost::shared_ptr<ARDOUR::Route> > >); CLASSKEYS(boost::shared_ptr<std::list<boost::shared_ptr<ARDOUR::Route> > >);
CLASSKEYS(boost::shared_ptr<std::vector<boost::shared_ptr<ARDOUR::Bundle> > >);
CLASSKEYS(boost::shared_ptr<ARDOUR::AudioRegion>); CLASSKEYS(boost::shared_ptr<ARDOUR::AudioRegion>);
CLASSKEYS(boost::shared_ptr<ARDOUR::AudioRom>); CLASSKEYS(boost::shared_ptr<ARDOUR::AudioRom>);
@ -1170,6 +1174,19 @@ LuaBindings::common (lua_State* L)
#endif #endif
.endClass () .endClass ()
.beginWSPtrClass <Bundle> ("Bundle")
.addCast<UserBundle> ("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, Bundle> ("UserBundle")
.endClass ()
.deriveWSPtrClass <AudioPlaylist, Playlist> ("AudioPlaylist") .deriveWSPtrClass <AudioPlaylist, Playlist> ("AudioPlaylist")
.addFunction ("read", &AudioPlaylist::read) .addFunction ("read", &AudioPlaylist::read)
.endClass () .endClass ()
@ -1740,6 +1757,11 @@ LuaBindings::common (lua_State* L)
.addVoidPtrConstructor<std::list<boost::shared_ptr <Route> > > () .addVoidPtrConstructor<std::list<boost::shared_ptr <Route> > > ()
.endClass () .endClass ()
// boost::shared_ptr<BundleList>
.beginPtrStdVector <boost::shared_ptr<Bundle> > ("BundleListPtr")
.addVoidPtrConstructor<std::vector<boost::shared_ptr <Bundle> > > ()
.endClass ()
// typedef std::list<boost::weak_ptr <Route> > WeakRouteList // typedef std::list<boost::weak_ptr <Route> > WeakRouteList
.beginConstStdList <boost::weak_ptr<Route> > ("WeakRouteList") .beginConstStdList <boost::weak_ptr<Route> > ("WeakRouteList")
.endClass () .endClass ()
@ -2477,6 +2499,8 @@ LuaBindings::common (lua_State* L)
.addFunction ("get_routelist", &Session::get_routelist) .addFunction ("get_routelist", &Session::get_routelist)
.addFunction ("plot_process_graph", &Session::plot_process_graph) .addFunction ("plot_process_graph", &Session::plot_process_graph)
.addFunction ("bundles", &Session::bundles)
.addFunction ("name", &Session::name) .addFunction ("name", &Session::name)
.addFunction ("path", &Session::path) .addFunction ("path", &Session::path)
.addFunction ("record_status", &Session::record_status) .addFunction ("record_status", &Session::record_status)