Skip to content
Permalink
Browse files

Add Lua bindings to inspect the Tempo Map

  • Loading branch information
x42 committed Jan 14, 2020
1 parent bca825e commit 4b9d6ff498ce0f1d6bcf70d3b95854d2ce2fcb1c
Showing with 15 additions and 2 deletions.
  1. +15 −2 libs/ardour/luabindings.cc
@@ -1758,6 +1758,7 @@ LuaBindings::common (lua_State* L)
.addConstructor <void (*) (double, double, double)> ()
.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,28 +1788,40 @@ 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)
.addFunction ("exact_beat_at_sample", &TempoMap::exact_beat_at_sample)
.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> ("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, MetricSection> ("TempoSection")
.addCast<Tempo> ("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, MetricSection> ("MeterSection")
.addCast<Meter> ("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 ()

0 comments on commit 4b9d6ff

Please sign in to comment.
You can’t perform that action at this time.