Skip to content

Commit

Permalink
beatToMilliseconds uses played ticks
Browse files Browse the repository at this point in the history
  • Loading branch information
22justinl committed Jul 27, 2024
1 parent f1ba321 commit 4ecde07
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/playback/internal/playbackcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,14 @@ MeasureBeat PlaybackController::currentBeat() const

msecs_t PlaybackController::beatToMilliseconds(int measureIndex, int beatIndex) const
{
return notationPlayback() ? playedTickToMsecs(notationPlayback()->beatToRawTick(measureIndex, beatIndex)) : 0;
if (!notationPlayback()) {
return 0;
}

muse::midi::tick_t rawTick = notationPlayback()->beatToRawTick(measureIndex, beatIndex);
muse::midi::tick_t playedTick = notationPlayback()->playPositionTickByRawTick(rawTick).val;

return playedTickToMsecs(playedTick);
}

secs_t PlaybackController::beatToSecs(int measureIndex, int beatIndex) const
Expand Down

0 comments on commit 4ecde07

Please sign in to comment.