From 4965d2b8f1c776c5b82adaebe52764dc8a9ca0a6 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Mon, 16 Dec 2024 05:54:27 +0100 Subject: [PATCH] (fix) allow seeking (eg. to hotcue) while scratching with the waveform --- src/engine/controls/ratecontrol.cpp | 4 ++++ src/engine/controls/ratecontrol.h | 1 + src/engine/positionscratchcontroller.cpp | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/engine/controls/ratecontrol.cpp b/src/engine/controls/ratecontrol.cpp index 8e1c065ccda..4f260d3c626 100644 --- a/src/engine/controls/ratecontrol.cpp +++ b/src/engine/controls/ratecontrol.cpp @@ -628,3 +628,7 @@ void RateControl::notifyWrapAround(mixxx::audio::FramePos triggerPos, m_jumpPos = triggerPos; m_targetPos = targetPos; } + +void RateControl::notifySeek(mixxx::audio::FramePos position) { + m_pScratchController->notifySeek(position); +} diff --git a/src/engine/controls/ratecontrol.h b/src/engine/controls/ratecontrol.h index 951772f8406..3bb9271f5e2 100644 --- a/src/engine/controls/ratecontrol.h +++ b/src/engine/controls/ratecontrol.h @@ -88,6 +88,7 @@ public slots: void slotControlRatePermUpSmall(double); void slotControlFastForward(double); void slotControlFastBack(double); + void notifySeek(mixxx::audio::FramePos position) override; private: void processTempRate(const int bufferSamples); diff --git a/src/engine/positionscratchcontroller.cpp b/src/engine/positionscratchcontroller.cpp index d4540b7fabc..71795331c11 100644 --- a/src/engine/positionscratchcontroller.cpp +++ b/src/engine/positionscratchcontroller.cpp @@ -300,7 +300,7 @@ double PositionScratchController::getRate() { void PositionScratchController::notifySeek(mixxx::audio::FramePos position) { DEBUG_ASSERT(position.isValid()); - // scratching continues after seek due to calculating the relative distance traveled - // in m_samplePosDeltaSum + // Scratching continues after seek due to calculating the relative + // distance traveled in m_samplePosDeltaSum m_prevSamplePos = position.toEngineSamplePos(); }