diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-10-27 22:54:32 +0100 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-10-27 23:07:32 +0100 |
commit | c60e8e727dcbd878c8aea08240c7df7defec7c4e (patch) | |
tree | 801a076ef7abbe07d6f3d1d5ca64ed4901e596b6 /src | |
parent | 48c8b3092775ba766a468e6e8e924a5b1ad91a5b (diff) |
Replace implicit casts with ControlObject::toBool() in more places
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/sync/synccontrol.cpp | 10 | ||||
-rw-r--r-- | src/test/enginesynctest.cpp | 2 | ||||
-rw-r--r-- | src/vinylcontrol/vinylcontrolxwax.cpp | 16 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/engine/sync/synccontrol.cpp b/src/engine/sync/synccontrol.cpp index d06b212ee3..1f6c842d01 100644 --- a/src/engine/sync/synccontrol.cpp +++ b/src/engine/sync/synccontrol.cpp @@ -130,12 +130,12 @@ void SyncControl::setSyncMode(SyncMode mode) { m_pSyncEnabled->setAndConfirm(mode != SYNC_NONE); m_pSyncMasterEnabled->setAndConfirm(isMaster(mode)); if (mode == SYNC_FOLLOWER) { - if (m_pVCEnabled && m_pVCEnabled->get()) { + if (m_pVCEnabled && m_pVCEnabled->toBool()) { // If follower mode is enabled, disable vinyl control. m_pVCEnabled->set(0.0); } } - if (mode != SYNC_NONE && m_pPassthroughEnabled->get()) { + if (mode != SYNC_NONE && m_pPassthroughEnabled->toBool()) { // If any sync mode is enabled and passthrough was on somehow, disable passthrough. // This is very unlikely to happen so this deserves a warning. qWarning() << "Notified of sync mode change when passthrough was " @@ -389,7 +389,7 @@ void SyncControl::slotSyncModeChangeRequest(double state) { kLogger.trace() << getGroup() << "SyncControl::slotSyncModeChangeRequest"; } SyncMode mode = syncModeFromDouble(state); - if (m_pPassthroughEnabled->get() && mode != SYNC_NONE) { + if (m_pPassthroughEnabled->toBool() && mode != SYNC_NONE) { qDebug() << "Disallowing enabling of sync mode when passthrough active"; } else { m_pChannel->getEngineBuffer()->requestSyncMode(mode); @@ -402,7 +402,7 @@ void SyncControl::slotSyncMasterEnabledChangeRequest(double state) { // Already master. return; } - if (m_pPassthroughEnabled->get()) { + if (m_pPassthroughEnabled->toBool()) { qDebug() << "Disallowing enabling of sync mode when passthrough active"; return; } @@ -418,7 +418,7 @@ void SyncControl::slotSyncEnabledChangeRequest(double enabled) { // Allow a request for state change even if it's the same as the current // state. We might have toggled on and off in the space of one buffer. - if (bEnabled && m_pPassthroughEnabled->get()) { + if (bEnabled && m_pPassthroughEnabled->toBool()) { qDebug() << "Disallowing enabling of sync mode when passthrough active"; return; } diff --git a/src/test/enginesynctest.cpp b/src/test/enginesynctest.cpp index bb1c7d7417..c1dc308133 100644 --- a/src/test/enginesynctest.cpp +++ b/src/test/enginesynctest.cpp @@ -88,7 +88,7 @@ class EngineSyncTest : public MockedEngineBackendTest { if (group == m_sInternalClockGroup) { if (!ControlObject::getControl(ConfigKey(m_sInternalClockGroup, "sync_master")) - ->get()) { + ->toBool()) { return false; } if (m_pEngineSync->getMaster()) { diff --git a/src/vinylcontrol/vinylcontrolxwax.cpp b/src/vinylcontrol/vinylcontrolxwax.cpp index c77b460214..9fa4060d84 100644 --- a/src/vinylcontrol/vinylcontrolxwax.cpp +++ b/src/vinylcontrol/vinylcontrolxwax.cpp @@ -256,7 +256,7 @@ void VinylControlXwax::analyzeSamples(CSAMPLE* pSamples, size_t nFrames) { // Check if vinyl control is enabled... - m_bIsEnabled = enabled == NULL ? false : checkEnabled(m_bIsEnabled, enabled->get()); + m_bIsEnabled = (!enabled) ? false : checkEnabled(m_bIsEnabled, enabled->toBool()); if(bHaveSignal) { // Always analyze the input samples @@ -309,7 +309,7 @@ void VinylControlXwax::analyzeSamples(CSAMPLE* pSamples, size_t nFrames) { double filePosition = playPos->get() * m_dOldDuration; int reportedMode = static_cast<int>(mode->get()); - bool reportedPlayButton = playButton->get(); + bool reportedPlayButton = playButton->toBool(); if (m_iVCMode != reportedMode) { //if we are playing, don't allow change @@ -333,7 +333,7 @@ void VinylControlXwax::analyzeSamples(CSAMPLE* pSamples, size_t nFrames) { } //if looping has been enabled, don't allow absolute mode - if (loopEnabled->get() && m_iVCMode == MIXXX_VCMODE_ABSOLUTE) { + if (loopEnabled->toBool() && m_iVCMode == MIXXX_VCMODE_ABSOLUTE) { m_iVCMode = MIXXX_VCMODE_RELATIVE; mode->slotSet((double)m_iVCMode); } @@ -486,7 +486,7 @@ void VinylControlXwax::analyzeSamples(CSAMPLE* pSamples, size_t nFrames) { //if we're in relative mode then we'll do a sync //because it might select a cue if (m_iVCMode == MIXXX_VCMODE_ABSOLUTE || - (m_iVCMode == MIXXX_VCMODE_RELATIVE && cueing->get())) { + (m_iVCMode == MIXXX_VCMODE_RELATIVE && cueing->toBool())) { syncPosition(); resetSteadyPitch(dVinylPitch, m_dVinylPosition); } @@ -565,7 +565,7 @@ void VinylControlXwax::analyzeSamples(CSAMPLE* pSamples, size_t nFrames) { } //playbutton status may have changed - reportedPlayButton = playButton->get(); + reportedPlayButton = playButton->toBool(); if (reportedPlayButton) { // Only add to the ring if pitch is stable @@ -616,8 +616,8 @@ 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 (reportedPlayButton && !scratching->get() && - m_dDisplayPitch < 1.9 && m_dDisplayPitch > 0.2) { + if (reportedPlayButton && !scratching->toBool() && + m_dDisplayPitch < 1.9 && m_dDisplayPitch > 0.2) { m_pRateRatio->set(m_dDisplayPitch); } else { m_pRateRatio->set(1.0); @@ -787,7 +787,7 @@ bool VinylControlXwax::checkEnabled(bool was, bool is) { // the track will keep playing at the previous rate. // This allows for single-deck control, dj handoffs, etc. - togglePlayButton(playButton->get() || fabs(m_pVCRate->get()) > 0.05); + togglePlayButton(playButton->toBool() || fabs(m_pVCRate->get()) > 0.05); m_pVCRate->set(m_pRateRatio->get()); resetSteadyPitch(0.0, 0.0); m_bForceResync = true; |