13
0

Fix Beats::rount_to.. Bar rounding

This commit is contained in:
Robin Gareus 2022-03-04 19:41:25 +01:00
parent ab3a7dc721
commit 2c769e9f23
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -46,8 +46,14 @@ Beats::round_to_subdivision (int subdivision, RoundMode dir) const {
BBT_Time bbt (metric.bbt_at (*this));
if (dir < 0) {
if (dir == RoundDownAlways && bbt.ticks == 0) {
bbt = metric.bbt_subtract (bbt, Temporal::BBT_Offset (0, 0, 1));
}
bbt = metric.meter().round_down_to_bar (bbt);
} if (dir > 0) {
if (dir == RoundUpAlways && bbt.ticks == 0) {
bbt.ticks += 1;
}
bbt = metric.meter().round_up_to_bar (bbt);
} else {
bbt = metric.meter().round_to_bar (bbt);