summaryrefslogtreecommitdiffstats
path: root/src/engine/controls/loopingcontrol.cpp
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2019-09-16 01:59:06 +0200
committerDaniel Schürmann <daschuer@mixxx.org>2019-09-16 01:59:06 +0200
commitbdc87af0852da845c9f34c3c85c1a9fcb7dc994d (patch)
treeaa948d31065295c5e69fa012870316115e86588d /src/engine/controls/loopingcontrol.cpp
parentd0447ad837c860348f1cfe588a55e29a97e755ef (diff)
parent4000c668ed75fa9a8142c06f2aac5fd48392a9df (diff)
Merge remote-tracking branch 'upstream/2.2'
Diffstat (limited to 'src/engine/controls/loopingcontrol.cpp')
-rw-r--r--src/engine/controls/loopingcontrol.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/engine/controls/loopingcontrol.cpp b/src/engine/controls/loopingcontrol.cpp
index 19c506e086..02f9e10fb4 100644
--- a/src/engine/controls/loopingcontrol.cpp
+++ b/src/engine/controls/loopingcontrol.cpp
@@ -354,18 +354,28 @@ double LoopingControl::nextTrigger(bool reverse,
LoopSamples loopSamples = m_loopSamples.getValue();
+ // m_bAdjustingLoopIn is true while the LoopIn button is pressed while a loop is active (slotLoopIn)
if (m_bAdjustingLoopInOld != m_bAdjustingLoopIn) {
m_bAdjustingLoopInOld = m_bAdjustingLoopIn;
- if (reverse && !m_bAdjustingLoopIn) {
+
+ // When the LoopIn button is released in reverse mode we jump to the end of the loop to not fall out and disable the active loop
+ // This must not happen in quantized mode. The newly set start is always ahead (in time, but behind spacially) of the current position so we don't jump.
+ // Jumping to the end is then handled when the loop's start is reached later in this function.
+ if (reverse && !m_bAdjustingLoopIn && !m_pQuantizeEnabled->toBool()) {
m_oldLoopSamples = loopSamples;
*pTarget = loopSamples.end;
return currentSample;
}
}
+ // m_bAdjustingLoopOut is true while the LoopOut button is pressed while a loop is active (slotLoopOut)
if (m_bAdjustingLoopOutOld != m_bAdjustingLoopOut) {
m_bAdjustingLoopOutOld = m_bAdjustingLoopOut;
- if (!reverse && !m_bAdjustingLoopOut) {
+
+ // When the LoopOut button is released in forward mode we jump to the start of the loop to not fall out and disable the active loop
+ // This must not happen in quantized mode. The newly set end is always ahead of the current position so we don't jump.
+ // Jumping to the start is then handled when the loop's end is reached later in this function.
+ if (!reverse && !m_bAdjustingLoopOut && !m_pQuantizeEnabled->toBool()) {
m_oldLoopSamples = loopSamples;
*pTarget = loopSamples.start;
return currentSample;