Skip to content

Commit

Permalink
loopcontrol: prevent moving a loop beyond track end
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Sep 23, 2020
1 parent 9a5a50a commit 72f41a0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/engine/controls/loopingcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,11 @@ void LoopingControl::slotLoopMove(double beats) {
pBeats->findNBeatsFromSample(new_loop_in, m_pCOBeatLoopSize->get()) :
pBeats->findNBeatsFromSample(loopSamples.end, beats);

// the track would stop as soon as the playhead crosses track end,
// so don't allow moving a loop beyond end.
if (new_loop_out > m_pTrackSamples->get()) {
return;
}
// If we are looping make sure that the play head does not leave the
// loop as a result of our adjustment.
loopSamples.seek = m_bLoopingEnabled;
Expand Down

0 comments on commit 72f41a0

Please sign in to comment.