From e7e44351cc61e845d58b6de9ca85a69723db02ac Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 12 Nov 2021 14:19:10 -0700 Subject: [PATCH] temporal: move implementation of quarters_per_minute_at() into .cc file --- libs/temporal/tempo.cc | 16 +++++++++++----- libs/temporal/temporal/tempo.h | 5 +---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/libs/temporal/tempo.cc b/libs/temporal/tempo.cc index 5d19053160..1079ec5a2e 100644 --- a/libs/temporal/tempo.cc +++ b/libs/temporal/tempo.cc @@ -2774,14 +2774,20 @@ TempoMap::previous_tempo (TempoPoint const & point) const return 0; } +double +TempoMap::quarters_per_minute_at (timepos_t const & pos) const +{ + TempoPoint const & tp (tempo_at (pos)); + const double val = tp.note_types_per_minute_at_DOUBLE (pos) * (4.0 / tp.note_type()); + std::cerr << "qpm @ " << pos << " using " << tp << " = " << val << std::endl; + return val; +} + + TempoPoint const & TempoMap::tempo_at (timepos_t const & pos) const { - if (pos.is_beats()) { - return tempo_at (pos.beats()); - } - - return tempo_at (pos.superclocks()); + return pos.is_beats() ? tempo_at (pos.beats()) : tempo_at (pos.superclocks()); } TempoPoint const & diff --git a/libs/temporal/temporal/tempo.h b/libs/temporal/temporal/tempo.h index 6b60265eb4..2806407721 100644 --- a/libs/temporal/temporal/tempo.h +++ b/libs/temporal/temporal/tempo.h @@ -772,10 +772,7 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible /* convenience function that hides some complexities behind fetching * the bpm at position */ - LIBTEMPORAL_API double quarters_per_minute_at (timepos_t const & pos) const { - TempoPoint const & tp (tempo_at (pos)); - return tp.note_types_per_minute_at_DOUBLE (pos) * (4.0 / tp.note_type()); - } + LIBTEMPORAL_API double quarters_per_minute_at (timepos_t const & pos) const; /* convenience function */ LIBTEMPORAL_API BBT_Time round_to_bar (BBT_Time const & bbt) const {