mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-07 14:15:46 +01:00
temporal: add TempoMap::{next,previous_}meter()
This commit is contained in:
parent
49e1f7f79d
commit
faac648502
2 changed files with 30 additions and 0 deletions
|
|
@ -3119,6 +3119,33 @@ TempoMap::previous_tempo (TempoPoint const & point) const
|
|||
return &(*i);
|
||||
}
|
||||
|
||||
MeterPoint const *
|
||||
TempoMap::next_meter (MeterPoint const & t) const
|
||||
{
|
||||
Meters::const_iterator i = _meters.iterator_to (t);
|
||||
++i;
|
||||
|
||||
if (i != _meters.end()) {
|
||||
return &(*i);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
MeterPoint const *
|
||||
TempoMap::previous_meter (MeterPoint const & point) const
|
||||
{
|
||||
Meters::const_iterator i = _meters.iterator_to (point);
|
||||
|
||||
if (i == _meters.begin()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
--i;
|
||||
|
||||
return &(*i);
|
||||
}
|
||||
|
||||
double
|
||||
TempoMap::quarters_per_minute_at (timepos_t const & pos) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -796,6 +796,9 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible
|
|||
LIBTEMPORAL_API TempoPoint const* previous_tempo (TempoPoint const &) const;
|
||||
LIBTEMPORAL_API TempoPoint const* next_tempo (TempoPoint const &) const;
|
||||
|
||||
LIBTEMPORAL_API MeterPoint const* previous_meter (MeterPoint const &) const;
|
||||
LIBTEMPORAL_API MeterPoint const* next_meter (MeterPoint const &) const;
|
||||
|
||||
LIBTEMPORAL_API bool tempo_exists_before (TempoPoint const & t) const { return (bool) previous_tempo (t); }
|
||||
LIBTEMPORAL_API bool tempo_exists_after (TempoPoint const & t) const { return (bool) next_tempo (t); }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue