From 4b9d6ff498ce0f1d6bcf70d3b95854d2ce2fcb1c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 14 Jan 2020 03:05:22 +0100 Subject: [PATCH] Add Lua bindings to inspect the Tempo Map --- libs/ardour/luabindings.cc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index f781530b4a..a0cdcf850e 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -1758,6 +1758,7 @@ LuaBindings::common (lua_State* L) .addConstructor () .addFunction ("note_type", &Tempo::note_type) .addFunction ("note_types_per_minute", (double (Tempo::*)() const)&Tempo::note_types_per_minute) + .addFunction ("end_note_types_per_minute", (double (Tempo::*)() const)&Tempo::end_note_types_per_minute) .addFunction ("quarter_notes_per_minute", &Tempo::quarter_notes_per_minute) .addFunction ("samples_per_quarter_note", &Tempo::samples_per_quarter_note) .addFunction ("samples_per_note_type", &Tempo::samples_per_note_type) @@ -1787,7 +1788,6 @@ LuaBindings::common (lua_State* L) .addFunction ("add_tempo", &TempoMap::add_tempo) .addFunction ("add_meter", &TempoMap::add_meter) .addFunction ("tempo_section_at_sample", (TempoSection& (TempoMap::*)(samplepos_t))&TempoMap::tempo_section_at_sample) - .addFunction ("tempo_section_at_sample", (const TempoSection& (TempoMap::*)(samplepos_t) const)&TempoMap::tempo_section_at_sample) .addFunction ("meter_section_at_sample", &TempoMap::meter_section_at_sample) .addFunction ("meter_section_at_beat", &TempoMap::meter_section_at_beat) .addFunction ("bbt_at_sample", &TempoMap::bbt_at_sample) @@ -1795,20 +1795,33 @@ LuaBindings::common (lua_State* L) .addFunction ("exact_qn_at_sample", &TempoMap::exact_qn_at_sample) .addFunction ("samplepos_plus_qn", &TempoMap::samplepos_plus_qn) .addFunction ("framewalk_to_qn", &TempoMap::framewalk_to_qn) + .addFunction ("previous_tempo_section", &TempoMap::previous_tempo_section) + .addFunction ("next_tempo_section", &TempoMap::next_tempo_section) .endClass () .beginClass ("MetricSection") .addFunction ("pulse", &MetricSection::pulse) .addFunction ("set_pulse", &MetricSection::set_pulse) + .addFunction ("sample", &MetricSection::sample) + .addFunction ("minute", &MetricSection::minute) + .addFunction ("initial", &MetricSection::initial) + .addFunction ("is_tempo", &MetricSection::is_tempo) + .addFunction ("sample_at_minute", &MetricSection::sample_at_minute) + .addFunction ("minute_at_sample", &MetricSection::minute_at_sample) .endClass () .deriveClass ("TempoSection") + .addCast ("to_tempo") .addFunction ("c", (double(TempoSection::*)()const)&TempoSection::c) + .addFunction ("active", &TempoSection::active) + .addFunction ("locked_to_meter", &TempoSection::locked_to_meter) + .addFunction ("clamped", &TempoSection::clamped) .endClass () .deriveClass ("MeterSection") .addCast ("to_meter") - .addFunction ("set_pulse", &MeterSection::set_pulse) + .addFunction ("bbt", &MeterSection::bbt) + .addFunction ("beat", &MeterSection::beat) .addFunction ("set_beat", (void(MeterSection::*)(double))&MeterSection::set_beat) .endClass ()