Skip to content

Commit

Permalink
Fix broken looped playback when score has repeats
Browse files Browse the repository at this point in the history
  • Loading branch information
mathesoncalum committed May 8, 2024
1 parent d91d5be commit 14063f5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/playback/internal/playbackcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,9 +802,16 @@ void PlaybackController::updateLoop()
return;
}

msecs_t fromMsesc = tickToMsecs(boundaries.loopInTick);
msecs_t toMsecs = tickToMsecs(boundaries.loopOutTick);
playback()->player()->setLoop(m_currentSequenceId, fromMsesc, toMsecs);
// Convert from raw ticks (visual tick != playback tick due to repeats etc)
RetVal<tick_t> playbackTickFrom = notationPlayback()->playPositionTickByRawTick(boundaries.loopInTick);
RetVal<tick_t> playbackTickTo = notationPlayback()->playPositionTickByRawTick(boundaries.loopOutTick);
if (!playbackTickFrom.ret || !playbackTickTo.ret) {
return;
}

msecs_t fromMsecs = tickToMsecs(playbackTickFrom.val);
msecs_t toMsecs = tickToMsecs(playbackTickTo.val);
playback()->player()->setLoop(m_currentSequenceId, fromMsecs, toMsecs);

enableLoop();

Expand Down

0 comments on commit 14063f5

Please sign in to comment.