Skip to content

Commit

Permalink
Merge pull request #3117 from ronso0/loop-at-track-end
Browse files Browse the repository at this point in the history
loopcontrol: prevent moving a loop beyond track end
  • Loading branch information
Holzhaus authored Oct 17, 2020
2 parents 4707133 + 26689c9 commit 9cb01c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Fix missing manual in deb package lp:1889776
* Fix caching of duplicate tracks that reference the same file #3027
* Fix loss of precision when dealing with floating-point sample positions while setting loop out position and seeking using vinyl control #3126 #3127
* prevent moving a loop beyond track end #3117 https://bugs.launchpad.net/mixxx/+bug/1799574

==== 2.2.4 2020-05-10 ====

Expand Down
6 changes: 6 additions & 0 deletions src/engine/loopingcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,12 @@ 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 we don't allow moving a loop beyond end.
// https://bugs.launchpad.net/mixxx/+bug/1799574
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 9cb01c7

Please sign in to comment.