diff --git a/src/engine/positionscratchcontroller.cpp b/src/engine/positionscratchcontroller.cpp index 16f7a9eb98ed..dfcf4c9aae9e 100644 --- a/src/engine/positionscratchcontroller.cpp +++ b/src/engine/positionscratchcontroller.cpp @@ -106,13 +106,13 @@ PositionScratchController::PositionScratchController(const QString& group) m_d(1), m_f(0.4) { m_pMainSampleRate->connectValueChanged(this, - &PositionScratchController::slotSampleRateChanged); + &PositionScratchController::slotUpdateFilterParameters); } PositionScratchController::~PositionScratchController() { } -void PositionScratchController::slotSampleRateChanged(double sampleRate) { +void PositionScratchController::slotUpdateFilterParameters(double sampleRate) { // VERIFY_OR_DEBUG_ASSERT(!util_isNan(m_bufferSize) && m_bufferSize > 0) { // } // The latency or time difference between process calls. @@ -154,7 +154,7 @@ void PositionScratchController::process(double currentSamplePos, if (bufferSize != m_bufferSize) { m_bufferSize = bufferSize; - slotSampleRateChanged(m_pMainSampleRate->get()); + slotUpdateFilterParameters(m_pMainSampleRate->get()); } double scratchPosition = 0; @@ -313,15 +313,6 @@ void PositionScratchController::process(double currentSamplePos, m_prevSamplePos = currentSamplePos; } -bool PositionScratchController::isEnabled() { - // return true only if m_rate is valid. - return m_isScratching; -} - -double PositionScratchController::getRate() { - return m_rate; -} - void PositionScratchController::notifySeek(mixxx::audio::FramePos position) { DEBUG_ASSERT(position.isValid()); // scratching continues after seek due to calculating the relative distance traveled diff --git a/src/engine/positionscratchcontroller.h b/src/engine/positionscratchcontroller.h index b91b98ce2cb6..b77beff0e42d 100644 --- a/src/engine/positionscratchcontroller.h +++ b/src/engine/positionscratchcontroller.h @@ -25,12 +25,17 @@ class PositionScratchController : public QObject { int wrappedAround, mixxx::audio::FramePos trigger, mixxx::audio::FramePos target); - bool isEnabled(); - double getRate(); + bool isEnabled() { + // TODO return true only if m_rate is valid. + return m_isScratching; + } + double getRate() { + return m_rate; + } void notifySeek(mixxx::audio::FramePos position); private slots: - void slotSampleRateChanged(double sampleRate); + void slotUpdateFilterParameters(double sampleRate); private: const QString m_group;