diff options
author | Robin Gareus <robin@gareus.org> | 2016-12-08 12:44:36 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-12-08 12:45:44 +0100 |
commit | f05f19bdd4c376d8427f488ab9c812df4d400fbc (patch) | |
tree | 0a1f3c7c5b03b97853deb8d2d5cf4ee37f4ec71c /libs/ardour/luabindings.cc | |
parent | 3d925ef503faae520c670464653856f62c6ca56b (diff) |
add Lua bindings for Timecode conversion
Diffstat (limited to 'libs/ardour/luabindings.cc')
-rw-r--r-- | libs/ardour/luabindings.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index 4899757188..46e1d67551 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -423,6 +423,20 @@ LuaBindings::common (lua_State* L) //.addStaticData ("ticks_per_beat", &Timecode::BBT_Time::ticks_per_beat, false) .endClass () + .beginClass <Timecode::Time> ("Time") + .addConstructor <void (*) (double)> () + .addData ("negative", &Timecode::Time::negative) + .addData ("hours", &Timecode::Time::hours) + .addData ("minutes", &Timecode::Time::minutes) + .addData ("seconds", &Timecode::Time::seconds) + .addData ("frames", &Timecode::Time::frames) + .addData ("subframes", &Timecode::Time::subframes) + .addData ("rate", &Timecode::Time::rate) + .addData ("drop", &Timecode::Time::drop) + .endClass () + + // TODO add increment, decrement; push it into the class + /* libtimecode enums */ .beginNamespace ("TimecodeFormat") .addConst ("TC23976", Timecode::TimecodeFormat(Timecode::timecode_23976)) @@ -1809,6 +1823,11 @@ LuaBindings::common (lua_State* L) .addFunction ("route_groups", &Session::route_groups) .addFunction ("new_route_group", &Session::new_route_group) .addFunction ("remove_route_group", (void (Session::*)(RouteGroup*))&Session::remove_route_group) + .addExtCFunction ("timecode_to_sample_lua", ARDOUR::LuaAPI::timecode_to_sample_lua) + .addExtCFunction ("sample_to_timecode_lua", ARDOUR::LuaAPI::sample_to_timecode_lua) + .addFunction ("timecode_frames_per_hour", &Session::timecode_frames_per_hour) + .addFunction ("timecode_frames_per_second", &Session::timecode_frames_per_second) + .addFunction ("timecode_drop_frames", &Session::timecode_drop_frames) .endClass () .beginClass <RegionFactory> ("RegionFactory") @@ -1853,6 +1872,8 @@ LuaBindings::common (lua_State* L) .addFunction ("usleep", Glib::usleep) .addCFunction ("build_filename", ARDOUR::LuaAPI::build_filename) .addFunction ("new_noteptr", ARDOUR::LuaAPI::new_noteptr) + .addCFunction ("sample_to_timecode", ARDOUR::LuaAPI::sample_to_timecode) + .addCFunction ("timecode_to_sample", ARDOUR::LuaAPI::timecode_to_sample) .beginClass <ARDOUR::LuaAPI::Vamp> ("Vamp") .addConstructor <void (*) (const std::string&, float)> () |