diff options
author | Owen Williams <owilliams@mixxx.org> | 2015-03-29 15:47:53 -0400 |
---|---|---|
committer | Owen Williams <owilliams@mixxx.org> | 2015-03-29 15:47:53 -0400 |
commit | 6bc9cc256a18b30b1541942d66db9071ac6c9216 (patch) | |
tree | 1cb1011d647f6519b1b3e5722dc6d5430b11e637 /src/vinylcontrol | |
parent | 657dfcd7eeef492296a1978cac1078b15cc32b17 (diff) |
Improve vinyl control logic for determining when to update the rate slider
Diffstat (limited to 'src/vinylcontrol')
-rw-r--r-- | src/vinylcontrol/steadypitch.cpp | 3 | ||||
-rw-r--r-- | src/vinylcontrol/steadypitch.h | 2 | ||||
-rw-r--r-- | src/vinylcontrol/vinylcontrolxwax.cpp | 8 | ||||
-rw-r--r-- | src/vinylcontrol/vinylcontrolxwax.h | 4 |
4 files changed, 10 insertions, 7 deletions
diff --git a/src/vinylcontrol/steadypitch.cpp b/src/vinylcontrol/steadypitch.cpp index 71580a032a..39596ac588 100644 --- a/src/vinylcontrol/steadypitch.cpp +++ b/src/vinylcontrol/steadypitch.cpp @@ -119,7 +119,6 @@ double SteadyPitch::check(double pitch, double time) return 0.0; } -double SteadyPitch::steadyValue(void) -{ +double SteadyPitch::steadyValue(void) const { return m_dOldSteadyPitch; } diff --git a/src/vinylcontrol/steadypitch.h b/src/vinylcontrol/steadypitch.h index d7973c76fd..972e2e0c10 100644 --- a/src/vinylcontrol/steadypitch.h +++ b/src/vinylcontrol/steadypitch.h @@ -10,7 +10,7 @@ class SteadyPitch { SteadyPitch(double threshold, bool assumeSteady); void reset(double pitch, double time); double check(double pitch, double time); - double steadyValue(void); + double steadyValue(void) const; bool directionChanged(double pitch); bool resyncDetected(double new_time); private: diff --git a/src/vinylcontrol/vinylcontrolxwax.cpp b/src/vinylcontrol/vinylcontrolxwax.cpp index 046d9c0845..bf162753c5 100644 --- a/src/vinylcontrol/vinylcontrolxwax.cpp +++ b/src/vinylcontrol/vinylcontrolxwax.cpp @@ -596,7 +596,7 @@ void VinylControlXwax::analyzeSamples(CSAMPLE* pSamples, size_t nFrames) { } m_pVCRate->set(averagePitch + dDriftControl); - if (m_iPosition != -1 && reportedPlayButton && uiUpdateTime(filePosition)) { + if (uiUpdateTime(filePosition)) { double true_pitch = averagePitch + dDriftControl; double pitch_difference = true_pitch - m_dDisplayPitch; @@ -617,8 +617,10 @@ void VinylControlXwax::analyzeSamples(CSAMPLE* pSamples, size_t nFrames) { m_dDisplayPitch += pitch_difference * .01; } // Don't show extremely high or low speeds in the UI. - if (m_dDisplayPitch < 1.9 && m_dDisplayPitch > 0.2) { - m_pRateSlider->set(rateDir->get() * (m_dDisplayPitch - 1.0) / rateRange->get()); + if (reportedPlayButton && !scratching->get() && + m_dDisplayPitch < 1.9 && m_dDisplayPitch > 0.2) { + m_pRateSlider->set(rateDir->get() * + (m_dDisplayPitch - 1.0) / rateRange->get()); } else { m_pRateSlider->set(0.0); } diff --git a/src/vinylcontrol/vinylcontrolxwax.h b/src/vinylcontrol/vinylcontrolxwax.h index 471df4ac82..62a808b0fa 100644 --- a/src/vinylcontrol/vinylcontrolxwax.h +++ b/src/vinylcontrol/vinylcontrolxwax.h @@ -103,7 +103,9 @@ class VinylControlXwax : public VinylControl { // A smoothed pitch value to show to the user. double m_dDisplayPitch; - // Steady pitch trackers. + // Steady pitch trackers. "Subtle" will be more likely to return true, + // so it is used to set the play button. "Gross" is more likely to return + // false, so it is used to trigger the "scratching" CO. SteadyPitch* m_pSteadySubtle; SteadyPitch* m_pSteadyGross; |