mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-30 08:53:08 +01:00
libtemporal: Beats::round_to_subdivision() was incorectly folding the "beats" part of the value back into the answer.
The "beats" value is already implicit in the "ticks" we actually do the math with
This commit is contained in:
parent
c22c8ed69f
commit
f86395688e
1 changed files with 2 additions and 4 deletions
|
|
@ -57,7 +57,6 @@ Beats::round_to_subdivision (int subdivision, RoundMode dir) const {
|
|||
uint32_t ticks = to_ticks();
|
||||
const uint32_t ticks_one_subdivisions_worth = ticks_per_beat / subdivision;
|
||||
uint32_t mod = ticks % ticks_one_subdivisions_worth;
|
||||
uint32_t beats = _beats;
|
||||
|
||||
DEBUG_TRACE (DEBUG::SnapBBT, string_compose ("%4 => round-nearest, ticks %1 1 div of ticks %2 mod %3\n", ticks, ticks_one_subdivisions_worth, mod, *this));
|
||||
|
||||
|
|
@ -111,12 +110,11 @@ Beats::round_to_subdivision (int subdivision, RoundMode dir) const {
|
|||
*/
|
||||
|
||||
ticks = int_div_round (ticks, ticks_one_subdivisions_worth) * ticks_one_subdivisions_worth;
|
||||
beats = 0;
|
||||
|
||||
}
|
||||
|
||||
DEBUG_TRACE (DEBUG::SnapBBT, string_compose ("return %1 from %2 : %3\n", Beats (beats, ticks), beats, ticks));
|
||||
return Beats (beats, ticks);
|
||||
DEBUG_TRACE (DEBUG::SnapBBT, string_compose ("return %1 from %2 : %3\n", Beats (0, ticks), ticks));
|
||||
return Beats (0, ticks);
|
||||
}
|
||||
|
||||
std::istream&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue