Skip to content

Commit

Permalink
fix clang-tidy warning in vsyncthread.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Jan 28, 2024
1 parent a7b8319 commit e1fae28
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/waveform/vsyncthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
#include "util/performancetimer.h"

namespace {

constexpr int kNumStableDeltasRequired = 20;

VSyncThread::VSyncMode defaultVSyncMode() {
#ifdef __APPLE__
return VSyncThread::ST_PLL;
#else
return VSyncThread::ST_TIMER;
#endif
}

} // namespace

VSyncThread::VSyncThread(QObject* pParent, VSyncThread::VSyncMode vSyncMode)
Expand Down Expand Up @@ -285,12 +289,8 @@ mixxx::Duration VSyncThread::sinceLastSwap() const {
return m_sinceLastSwap;
}

namespace {
const int numStableDeltasRequired = 20;
}

bool VSyncThread::pllInitializing() const {
return m_pllInitCnt < numStableDeltasRequired;
return m_pllInitCnt < kNumStableDeltasRequired;
}

void VSyncThread::updatePLL() {
Expand All @@ -303,7 +303,7 @@ void VSyncThread::updatePLL() {

const double pllPhaseIn = m_pllTimer.elapsed().toDoubleMicros();

if (m_pllInitCnt < numStableDeltasRequired) {
if (m_pllInitCnt < kNumStableDeltasRequired) {
// Before activating the phase-lock-looped, we need an initial
// delta and phase, which we calculate by taking the average
// delta over a number of stable deltas.
Expand All @@ -318,7 +318,7 @@ void VSyncThread::updatePLL() {
m_pllInitSum = 0.0;
m_pllInitCnt = 0;
}
if (m_pllInitCnt == numStableDeltasRequired) {
if (m_pllInitCnt == kNumStableDeltasRequired) {
m_pllDeltaOut = m_pllInitAvg;
}
return;
Expand Down

0 comments on commit e1fae28

Please sign in to comment.