Skip to content

Commit

Permalink
LoopingControl: Combine loop reset code paths in slotLoopStartPos()
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Sep 6, 2021
1 parent 6efff85 commit d8f91a9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/engine/controls/loopingcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,19 +959,17 @@ void LoopingControl::slotLoopStartPos(double positionSamples) {
if (!position.isValid()) {
emit loopReset();
setLoopingEnabled(false);
} else if (loopInfo.endPosition.isValid() && loopInfo.endPosition <= position) {
emit loopReset();
loopInfo.endPosition = mixxx::audio::kInvalidFramePos;
m_pCOLoopEndPosition->set(kNoTrigger);
setLoopingEnabled(false);
}

loopInfo.seekMode = LoopSeekMode::MovedOut;
loopInfo.startPosition = position;
m_pCOLoopStartPosition->set(position.toEngineSamplePosMaybeInvalid());

if (loopInfo.startPosition.isValid() && loopInfo.endPosition.isValid() &&
loopInfo.endPosition <= loopInfo.startPosition) {
emit loopReset();
loopInfo.endPosition = mixxx::audio::kInvalidFramePos;
m_pCOLoopEndPosition->set(kNoTrigger);
setLoopingEnabled(false);
}
m_loopInfo.setValue(loopInfo);
}

Expand Down

0 comments on commit d8f91a9

Please sign in to comment.