From d29c70a2a2a56068d9c1fc984a8192dd2b7e1d65 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 19 Mar 2022 15:21:51 -0600 Subject: [PATCH] temporal: add new variant of TempoMap::bbtwalk_to_quarters() --- libs/temporal/tempo.cc | 6 ++++++ libs/temporal/temporal/tempo.h | 1 + 2 files changed, 7 insertions(+) diff --git a/libs/temporal/tempo.cc b/libs/temporal/tempo.cc index a384083cb6..37eabac8f4 100644 --- a/libs/temporal/tempo.cc +++ b/libs/temporal/tempo.cc @@ -1676,6 +1676,12 @@ TempoMap::bbtwalk_to_quarters (Beats const & pos, BBT_Offset const & distance) c return quarters_at (bbt_walk (bbt_at (pos), distance)) - pos; } +Temporal::Beats +TempoMap::bbtwalk_to_quarters (BBT_Time const & pos, BBT_Offset const & distance) const +{ + return quarters_at (bbt_walk (pos, distance)) - quarters_at (pos); +} + void TempoMap::sample_rate_changed (samplecnt_t new_sr) { diff --git a/libs/temporal/temporal/tempo.h b/libs/temporal/temporal/tempo.h index 7d1a30336c..566cf2c108 100644 --- a/libs/temporal/temporal/tempo.h +++ b/libs/temporal/temporal/tempo.h @@ -839,6 +839,7 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible LIBTEMPORAL_API timecnt_t bbt_duration_at (timepos_t const & pos, BBT_Offset const & bbt) const; LIBTEMPORAL_API Beats bbtwalk_to_quarters (Beats const & start, BBT_Offset const & distance) const; + LIBTEMPORAL_API Beats bbtwalk_to_quarters (BBT_Time const & start, BBT_Offset const & distance) const; LIBTEMPORAL_API Temporal::timecnt_t convert_duration (Temporal::timecnt_t const & duration, Temporal::timepos_t const &, Temporal::TimeDomain domain) const;