mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
temporal: add TempoMap::{max,min}_notes_per_minute() API
This commit is contained in:
parent
cda0d6ce9f
commit
0266d98a3b
2 changed files with 35 additions and 0 deletions
|
|
@ -4756,6 +4756,38 @@ TempoMap::map_assert (bool expr, char const * exprstr, char const * file, int li
|
|||
}
|
||||
}
|
||||
|
||||
double
|
||||
TempoMap::max_notes_per_minute() const
|
||||
{
|
||||
double npm = 0;
|
||||
for (auto const & t : _tempos) {
|
||||
if (t.note_types_per_minute() > npm) {
|
||||
npm = t.note_types_per_minute();
|
||||
}
|
||||
if (t.end_note_types_per_minute() > npm) {
|
||||
npm = t.end_note_types_per_minute();
|
||||
}
|
||||
}
|
||||
|
||||
return npm;
|
||||
}
|
||||
|
||||
double
|
||||
TempoMap::min_notes_per_minute() const
|
||||
{
|
||||
double npm = std::numeric_limits<double>::max();
|
||||
|
||||
for (auto const & t : _tempos) {
|
||||
if (t.note_types_per_minute() < npm) {
|
||||
npm = t.note_types_per_minute();
|
||||
}
|
||||
if (t.end_note_types_per_minute() < npm) {
|
||||
npm = t.end_note_types_per_minute();
|
||||
}
|
||||
}
|
||||
|
||||
return npm;
|
||||
}
|
||||
|
||||
#if 0
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue