diff options
author | JoergAtGithub <JoergAtGithub@worldwartweb.com> | 2021-03-06 12:39:28 +0100 |
---|---|---|
committer | JoergAtGithub <JoergAtGithub@worldwartweb.com> | 2021-03-06 13:17:24 +0100 |
commit | 277ed269fc956d04ecbeecbe647ee6e68b8d38f4 (patch) | |
tree | 412bfba7ac2b702a4ed14ff09e95090e1bb156d2 | |
parent | f04c35a802ce5e0573c96d9049a5518b3adf29b6 (diff) |
Improved responsiveness when pressing play/cue button at while track is hold on a beat
-rw-r--r-- | src/engine/controls/clockcontrol.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/engine/controls/clockcontrol.cpp b/src/engine/controls/clockcontrol.cpp index 4ae4fdbbb6..8b6c8fdd77 100644 --- a/src/engine/controls/clockcontrol.cpp +++ b/src/engine/controls/clockcontrol.cpp @@ -11,6 +11,8 @@ namespace { constexpr double kBlinkInterval = 0.20; // LED is on 20% of the beat period constexpr double kStandStillTolerance = 0.005; // (seconds) Minimum change, to he last evaluated position +constexpr double kSignificiantRateThreshold = + 0.1; // If rate is significiant, update indicator also inside standstill tolerance } // namespace ClockControl::ClockControl(const QString& group, UserSettingsPointer pConfig) @@ -65,8 +67,10 @@ void ClockControl::updateIndicators(const double dRate, */ // No position change since last indicator update (e.g. deck stopped) -> No indicator update needed + // The kSignificiantRateThreshold condition ensures an immidiate indicator update, when the play/cue button is pressed if ((currentSample <= (m_lastEvaluatedSample + kStandStillTolerance * sampleRate)) && - (currentSample >= (m_lastEvaluatedSample - kStandStillTolerance * sampleRate))) { + (currentSample >= (m_lastEvaluatedSample - kStandStillTolerance * sampleRate)) && + (fabs(dRate) <= kSignificiantRateThreshold)) { return; } |