temporal: add BBT_Time::round_up_to_beat_div()

This commit is contained in:
Paul Davis 2023-09-04 10:46:52 -06:00
parent 7c5e7ddf59
commit f1f5df7c9a
2 changed files with 20 additions and 0 deletions

View file

@ -115,6 +115,7 @@ struct LIBTEMPORAL_API BBT_Time
BBT_Time round_to_beat () const { return ticks >= (ticks_per_beat/2) ? BBT_Time (bars, beats+1, 0) : BBT_Time (bars, beats, 0); }
BBT_Time round_down_to_beat () const { return BBT_Time (bars, beats, 0); }
BBT_Time round_up_to_beat () const { return ticks ? BBT_Time (bars, beats+1, 0) : *this; }
BBT_Time round_up_to_beat_div (int beat_div) const;
/* cannot implement round_to_bar() without knowing meter (time
* signature) information, since it requires knowing how many beats