From 07ee9b6164b88a237cc8a51ef49544695eed48a0 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 15 Oct 2016 21:16:57 +0200 Subject: [PATCH] Source and AudioSource Lua bindings --- libs/ardour/luabindings.cc | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index 308f6a4fce..034c6ee73b 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -175,6 +175,7 @@ CLASSKEYS(ARDOUR::PortManager); CLASSKEYS(ARDOUR::PresentationInfo); CLASSKEYS(ARDOUR::Session); CLASSKEYS(ARDOUR::SessionConfiguration); +CLASSKEYS(ARDOUR::Source); CLASSKEYS(PBD::ID); CLASSKEYS(PBD::Configuration); @@ -192,6 +193,7 @@ CLASSKEYS(std::vector); CLASSKEYS(std::vector); CLASSKEYS(std::vector >); +CLASSKEYS(std::vector >); CLASSKEYS(std::list); CLASSKEYS(std::list); @@ -1004,6 +1006,9 @@ LuaBindings::common (lua_State* L) .addFunction ("nudge_position", &Region::nudge_position) .addFunction ("move_to_natural_position", &Region::move_to_natural_position) .addFunction ("move_start", &Region::move_start) + .addFunction ("master_sources", &Region::master_sources) + .addFunction ("master_source_names", &Region::master_source_names) + .addFunction ("n_channels", &Region::n_channels) .addFunction ("trim_front", &Region::trim_front) .addFunction ("trim_end", &Region::trim_end) .addFunction ("trim_to", &Region::trim_to) @@ -1022,6 +1027,7 @@ LuaBindings::common (lua_State* L) .addFunction ("set_locked", &Region::set_locked) .addFunction ("set_video_locked", &Region::set_video_locked) .addFunction ("set_position_locked", &Region::set_position_locked) + .addFunction ("source", &Region::source) .endClass () .deriveWSPtrClass ("MidiRegion") @@ -1032,7 +1038,21 @@ LuaBindings::common (lua_State* L) .addFunction ("length_beats", &MidiRegion::length_beats) .endClass () - .beginWSPtrClass ("Source") + .deriveWSPtrClass ("Source") + .addCast ("to_audiosource") + .addCast ("to_midisource") + .addFunction ("timestamp", &Source::timestamp) + .addFunction ("empty", &Source::empty) + .addFunction ("length", &Source::length) + .addFunction ("natural_position", &Source::natural_position) + .addFunction ("destructive", &Source::destructive) + .addFunction ("writable", &Source::writable) + .addFunction ("has_been_analysed", &Source::has_been_analysed) + .addFunction ("can_be_analysed", &Source::can_be_analysed) + .addFunction ("timeline_position", &Source::timeline_position) + .addFunction ("use_count", &Source::use_count) + .addFunction ("used", &Source::used) + .addFunction ("ancestor_name", &Source::ancestor_name) .endClass () .deriveWSPtrClass ("MidiSource") @@ -1041,6 +1061,17 @@ LuaBindings::common (lua_State* L) .addFunction ("model", &MidiSource::model) .endClass () + .deriveWSPtrClass ("AudioSource") + .addCast ("to_readable") + .addFunction ("readable_length", &AudioSource::readable_length) + .addFunction ("n_channels", &AudioSource::n_channels) + .addFunction ("empty", &Source::empty) + .addFunction ("length", &Source::length) + .addFunction ("read", &AudioSource::read) + .addFunction ("sample_rate", &AudioSource::sample_rate) + .addFunction ("captured_for", &AudioSource::captured_for) + .endClass () + .deriveWSPtrClass ("Automatable") .addFunction ("automation_control", (boost::shared_ptr(Automatable::*)(const Evoral::Parameter&, bool))&Automatable::automation_control) .endClass () @@ -1275,6 +1306,10 @@ LuaBindings::common (lua_State* L) .beginConstStdList > ("WeakRouteList") .endClass () + // typedef std::vector > Region::SourceList + .beginStdVector > ("SourceList") + .endClass () + // std::list< boost::weak_ptr > .beginConstStdList > ("WeakAudioSourceList") .endClass () -- 2.30.2