mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 04:06:26 +01:00
temporal: add TempoMap::duration() method
This commit is contained in:
parent
cc3d867ac4
commit
ba00dc0920
2 changed files with 16 additions and 0 deletions
|
|
@ -4768,6 +4768,20 @@ TempoMap::min_notes_per_minute() const
|
||||||
return npm;
|
return npm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
timepos_t
|
||||||
|
TempoMap::duration(TimeDomain td) const
|
||||||
|
{
|
||||||
|
if (_points.empty()) {
|
||||||
|
return timepos_t::zero (td);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (td == BeatTime) {
|
||||||
|
return timepos_t (_points.back().beats() + Beats (1, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
return timepos_t::from_superclock (_points.back().sclock() + 1);
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
void
|
void
|
||||||
TempoMap::fix_legacy_session ()
|
TempoMap::fix_legacy_session ()
|
||||||
|
|
|
||||||
|
|
@ -872,6 +872,8 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible
|
||||||
LIBTEMPORAL_API void shift (timepos_t const & at, BBT_Offset const & by);
|
LIBTEMPORAL_API void shift (timepos_t const & at, BBT_Offset const & by);
|
||||||
LIBTEMPORAL_API void shift (timepos_t const & at, timecnt_t const & by);
|
LIBTEMPORAL_API void shift (timepos_t const & at, timecnt_t const & by);
|
||||||
|
|
||||||
|
LIBTEMPORAL_API timepos_t duration (TimeDomain) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename TimeType, typename Comparator> TempoPoint const & _tempo_at (TimeType when, Comparator cmp) const {
|
template<typename TimeType, typename Comparator> TempoPoint const & _tempo_at (TimeType when, Comparator cmp) const {
|
||||||
assert (!_tempos.empty());
|
assert (!_tempos.empty());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue