From 201fd55743367aca35561507fa3cc552037a6c58 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 24 Apr 2017 04:10:10 +0200 Subject: Add ControlEvent Lua bindings and related methods to access MIDI-CC --- libs/ardour/luabindings.cc | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'libs') diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index ac1f27f240..536c552bde 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -200,6 +200,7 @@ CLASSKEYS(PBD::StatefulDestructible); CLASSKEYS(Evoral::Beats); CLASSKEYS(Evoral::Event); +CLASSKEYS(Evoral::ControlEvent); CLASSKEYS(std::vector); @@ -208,6 +209,8 @@ CLASSKEYS(std::vector); CLASSKEYS(std::vector); CLASSKEYS(std::list); +CLASSKEYS(std::list); + CLASSKEYS(std::vector); CLASSKEYS(std::vector >); CLASSKEYS(std::vector >); @@ -500,6 +503,11 @@ LuaBindings::common (lua_State* L) .addFunction ("id", &Evoral::Parameter::id) .endClass () + .beginClass ("ControlEvent") + .addData ("when", &Evoral::ControlEvent::when) + .addData ("value", &Evoral::ControlEvent::value) + .endClass () + .beginWSPtrClass ("ControlList") .addFunction ("add", &Evoral::ControlList::add) .addFunction ("thin", &Evoral::ControlList::thin) @@ -510,7 +518,9 @@ LuaBindings::common (lua_State* L) .addFunction ("truncate_end", &Evoral::ControlList::truncate_end) .addFunction ("truncate_start", &Evoral::ControlList::truncate_start) .addFunction ("clear", (void (Evoral::ControlList::*)(double, double))&Evoral::ControlList::clear) + .addFunction ("clear_list", (void (Evoral::ControlList::*)())&Evoral::ControlList::clear) .addFunction ("in_write_pass", &Evoral::ControlList::in_write_pass) + .addFunction ("events", &Evoral::ControlList::events) .endClass () .beginWSPtrClass ("ControlSet") @@ -761,10 +771,10 @@ LuaBindings::common (lua_State* L) .deriveClass ("OwnedPropertyList") .endClass () - .beginWSPtrClass ("AutomationList") + .deriveWSPtrClass ("AutomationList") .addCast ("to_stateful") .addCast ("to_statefuldestructible") - .addCast ("list") + .addCast ("list") // deprecated .addFunction ("get_state", &AutomationList::get_state) .addFunction ("memento_command", &AutomationList::memento_command) .addFunction ("touching", &AutomationList::touching) @@ -1136,6 +1146,7 @@ LuaBindings::common (lua_State* L) .addFunction ("set_video_locked", &Region::set_video_locked) .addFunction ("set_position_locked", &Region::set_position_locked) .addFunction ("source", &Region::source) + .addFunction ("control", static_cast(Region::*)(const Evoral::Parameter&, bool)>(&Region::control)) .endClass () .deriveWSPtrClass ("MidiRegion") @@ -1498,6 +1509,9 @@ LuaBindings::common (lua_State* L) .beginStdList > > ("NotePtrList") .endClass () + .beginConstStdList ("EventList") + .endClass () + #if 0 // depends on Evoal:: Note, Beats see note_fixer.h // typedef Evoral::Note Note; // std::set< boost::weak_ptr > @@ -1532,6 +1546,12 @@ LuaBindings::common (lua_State* L) .addFunction ("from", &BeatsFramesConverter::from) .endClass () + .beginClass ("DoubleBeatsFramesConverter") + .addConstructor () + .addFunction ("to", &DoubleBeatsFramesConverter::to) + .addFunction ("from", &DoubleBeatsFramesConverter::from) + .endClass () + .beginClass ("TempoMap") .addFunction ("add_tempo", &TempoMap::add_tempo) .addFunction ("add_meter", &TempoMap::add_meter) -- cgit v1.2.3