temporal: move implementation of quarters_per_minute_at() into .cc file

This commit is contained in:
Paul Davis 2021-11-12 14:19:10 -07:00
parent a0e134e1b3
commit e7e44351cc
2 changed files with 12 additions and 9 deletions

View File

@ -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 &

View File

@ -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 {