mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
temporal: add Meter::round_to_beat()
This commit is contained in:
parent
f2a725b311
commit
883527ba3e
2 changed files with 12 additions and 0 deletions
|
|
@ -366,6 +366,17 @@ Meter::round_up_to_beat (Temporal::BBT_Time const & bbt) const
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Temporal::BBT_Time
|
||||||
|
Meter::round_to_beat (Temporal::BBT_Time const & bbt) const
|
||||||
|
{
|
||||||
|
Temporal::BBT_Time b = bbt.round_to_beat ();
|
||||||
|
if (b.beats > _divisions_per_bar) {
|
||||||
|
b.bars++;
|
||||||
|
b.beats = 1;
|
||||||
|
}
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
Temporal::Beats
|
Temporal::Beats
|
||||||
Meter::to_quarters (Temporal::BBT_Offset const & offset) const
|
Meter::to_quarters (Temporal::BBT_Offset const & offset) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -336,6 +336,7 @@ class LIBTEMPORAL_API Meter {
|
||||||
BBT_Time bbt_subtract (BBT_Time const & bbt, BBT_Offset const & sub) const;
|
BBT_Time bbt_subtract (BBT_Time const & bbt, BBT_Offset const & sub) const;
|
||||||
BBT_Time round_to_bar (BBT_Time const &) const;
|
BBT_Time round_to_bar (BBT_Time const &) const;
|
||||||
BBT_Time round_up_to_beat (BBT_Time const &) const;
|
BBT_Time round_up_to_beat (BBT_Time const &) const;
|
||||||
|
BBT_Time round_to_beat (BBT_Time const &) const;
|
||||||
Beats to_quarters (BBT_Offset const &) const;
|
Beats to_quarters (BBT_Offset const &) const;
|
||||||
|
|
||||||
XMLNode& get_state () const;
|
XMLNode& get_state () const;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue