Skip to content

Commit

Permalink
Improved responsiveness when pressing play/cue button at while track …
Browse files Browse the repository at this point in the history
…is hold on a beat
  • Loading branch information
JoergAtGithub committed Mar 6, 2021
1 parent f04c35a commit 02bc663
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/engine/controls/clockcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 02bc663

Please sign in to comment.