diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2020-10-01 01:50:47 +0200 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2020-10-01 01:50:47 +0200 |
commit | bddf8ad161500de346203af012f7a9de6904ce8a (patch) | |
tree | 1877d0fd74f22061e091d4bbee74a27ad782c597 | |
parent | ec47b2bb372c296d63883a0d175afd43cab2e6ad (diff) | |
parent | 827782c7661150e7faff234cc01c9292ef324028 (diff) |
Merge branch '2.3' of git@github.com:mixxxdj/mixxx.git
31 files changed, 125 insertions, 103 deletions
diff --git a/src/analyzer/plugins/analyzerqueenmarybeats.cpp b/src/analyzer/plugins/analyzerqueenmarybeats.cpp index 4e35b88e10..73fc0d8aab 100644 --- a/src/analyzer/plugins/analyzerqueenmarybeats.cpp +++ b/src/analyzer/plugins/analyzerqueenmarybeats.cpp @@ -50,7 +50,7 @@ AnalyzerQueenMaryBeats::~AnalyzerQueenMaryBeats() { bool AnalyzerQueenMaryBeats::initialize(int samplerate) { m_detectionResults.clear(); m_iSampleRate = samplerate; - m_stepSize = m_iSampleRate * kStepSecs; + m_stepSize = static_cast<int>(m_iSampleRate * kStepSecs); m_windowSize = MathUtilities::nextPowerOfTwo(m_iSampleRate / kMaximumBinSizeHz); m_pDetectionFunction = std::make_unique<DetectionFunction>( makeDetectionFunctionConfig(m_stepSize, m_windowSize)); diff --git a/src/control/controllinpotmeter.cpp b/src/control/controllinpotmeter.cpp index 5ca5962f46..e3f16d44b4 100644 --- a/src/control/controllinpotmeter.cpp +++ b/src/control/controllinpotmeter.cpp @@ -10,9 +10,9 @@ ControlLinPotmeter::ControlLinPotmeter(ConfigKey key, new ControlLinPotmeterBehavior(dMinValue, dMaxValue, allowOutOfBounds)); } if (dStep) { - setStepCount((dMaxValue - dMinValue) / dStep); + setStepCount(static_cast<int>((dMaxValue - dMinValue) / dStep)); } if (dSmallStep) { - setSmallStepCount((dMaxValue - dMinValue) / dSmallStep); + setSmallStepCount(static_cast<int>((dMaxValue - dMinValue) / dSmallStep)); } } diff --git a/src/effects/builtin/balanceeffect.cpp b/src/effects/builtin/balanceeffect.cpp index 41c23fe6bc..db24066a3f 100644 --- a/src/effects/builtin/balanceeffect.cpp +++ b/src/effects/builtin/balanceeffect.cpp @@ -116,8 +116,8 @@ void BalanceEffect::processChannel(const ChannelHandle& handle, CSAMPLE_GAIN balance = 0; CSAMPLE_GAIN midSide = 0; if (enableState != EffectEnableState::Disabling) { - balance = m_pBalanceParameter->value(); - midSide = m_pMidSideParameter->value(); + balance = static_cast<decltype(balance)>(m_pBalanceParameter->value()); + midSide = static_cast<decltype(midSide)>(m_pMidSideParameter->value()); } CSAMPLE_GAIN balanceDelta = (balance - pGroupState->m_oldBalance) diff --git a/src/effects/builtin/bitcrushereffect.cpp b/src/effects/builtin/bitcrushereffect.cpp index 04dc81884f..62bcefc042 100644 --- a/src/effects/builtin/bitcrushereffect.cpp +++ b/src/effects/builtin/bitcrushereffect.cpp @@ -76,11 +76,11 @@ void BitCrusherEffect::processChannel(const ChannelHandle& handle, Q_UNUSED(groupFeatures); Q_UNUSED(enableState); // no need to ramp, it is just a bitcrusher ;-) - const CSAMPLE downsample = m_pDownsampleParameter ? - m_pDownsampleParameter->value() : 0.0; + const auto downsample = static_cast<CSAMPLE>( + m_pDownsampleParameter ? m_pDownsampleParameter->value() : 0.0); - CSAMPLE bit_depth = m_pBitDepthParameter ? - m_pBitDepthParameter->value() : 16; + auto bit_depth = static_cast<CSAMPLE>( + m_pBitDepthParameter ? m_pBitDepthParameter->value() : 16); // divided by two because we use float math which includes the sing bit anyway const CSAMPLE scale = pow(2.0f, bit_depth) / 2; @@ -94,7 +94,7 @@ void BitCrusherEffect::processChannel(const ChannelHandle& handle, pState->accumulator += downsample; if (pState->accumulator >= 1.0) { - pState->accumulator -= 1.0; + pState->accumulator -= 1.0f; if (bit_depth < 16) { pState->hold_l = floorf(SampleUtil::clampSample(pInput[i] * gainCorrection) * scale + 0.5f) / scale / gainCorrection; diff --git a/src/effects/builtin/echoeffect.cpp b/src/effects/builtin/echoeffect.cpp index daf820b57e..fe1809b4ec 100644 --- a/src/effects/builtin/echoeffect.cpp +++ b/src/effects/builtin/echoeffect.cpp @@ -145,9 +145,9 @@ void EchoEffect::processChannel(const ChannelHandle& handle, EchoGroupState* pGr EchoGroupState& gs = *pGroupState; // The minimum of the parameter is zero so the exact center of the knob is 1 beat. double period = m_pDelayParameter->value(); - double send_current = m_pSendParameter->value(); - double feedback_current = m_pFeedbackParameter->value(); - CSAMPLE_GAIN pingpong_frac = static_cast<CSAMPLE_GAIN>(m_pPingPongParameter->value()); + const auto send_current = static_cast<CSAMPLE_GAIN>(m_pSendParameter->value()); + const auto feedback_current = static_cast<CSAMPLE_GAIN>(m_pFeedbackParameter->value()); + const auto pingpong_frac = static_cast<CSAMPLE_GAIN>(m_pPingPongParameter->value()); int delay_frames; if (groupFeatures.has_beat_length_sec) { @@ -160,11 +160,12 @@ void EchoEffect::processChannel(const ChannelHandle& handle, EchoGroupState* pGr } else if (period < 1/8.0) { period = 1/8.0; } - delay_frames = period * groupFeatures.beat_length_sec * bufferParameters.sampleRate(); + delay_frames = static_cast<int>(period * groupFeatures.beat_length_sec * + bufferParameters.sampleRate()); } else { // period is a number of seconds period = std::max(period, 1/8.0); - delay_frames = period * bufferParameters.sampleRate(); + delay_frames = static_cast<int>(period * bufferParameters.sampleRate()); } VERIFY_OR_DEBUG_ASSERT(delay_frames > 0) { delay_frames = 1; @@ -197,8 +198,8 @@ void EchoEffect::processChannel(const ChannelHandle& handle, EchoGroupState* pGr CSAMPLE bufferedSampleLeft = gs.delay_buf[read_position]; CSAMPLE bufferedSampleRight = gs.delay_buf[read_position + 1]; if (read_position != prev_read_position) { - double frac = static_cast<double>(i) - / bufferParameters.samplesPerBuffer(); + const CSAMPLE_GAIN frac = static_cast<CSAMPLE_GAIN>(i) / + bufferParameters.samplesPerBuffer(); bufferedSampleLeft *= frac; bufferedSampleRight *= frac; bufferedSampleLeft += gs.delay_buf[prev_read_position] * (1 - frac); diff --git a/src/effects/builtin/flangereffect.cpp b/src/effects/builtin/flangereffect.cpp index a4e39d709d..27a8f8c17f 100644 --- a/src/effects/builtin/flangereffect.cpp +++ b/src/effects/builtin/flangereffect.cpp @@ -7,7 +7,7 @@ namespace{ // Gain correction was verified with replay gain and default parameters -const double kGainCorrection = 1.4125375446227544; // 3 dB +constexpr CSAMPLE kGainCorrection = 1.41253754f; // 3 dB inline CSAMPLE tanh_approx(CSAMPLE input) { // return tanhf(input); // 142ns for process; @@ -156,7 +156,8 @@ void FlangerEffect::processChannel(const ChannelHandle& handle, // When the period is changed, the position of the sound shouldn't // so time need to be recalculated if (pState->previousPeriodFrames != -1.0) { - pState->lfoFrames *= lfoPeriodFrames / pState->previousPeriodFrames; + pState->lfoFrames *= static_cast<unsigned int>( + lfoPeriodFrames / pState->previousPeriodFrames); } pState->previousPeriodFrames = lfoPeriodFrames; @@ -165,12 +166,12 @@ void FlangerEffect::processChannel(const ChannelHandle& handle, // independently in the loop below, so do not multiply lfoPeriodSamples by // the number of channels. - CSAMPLE_GAIN mix = m_pMixParameter->value(); + const auto mix = static_cast<CSAMPLE_GAIN>(m_pMixParameter->value()); RampingValue<CSAMPLE_GAIN> mixRamped( pState->prev_mix, mix, bufferParameters.framesPerBuffer()); pState->prev_mix = mix; - CSAMPLE_GAIN regen = m_pRegenParameter->value(); + const auto regen = static_cast<CSAMPLE_GAIN>(m_pRegenParameter->value()); RampingValue<CSAMPLE_GAIN> regenRamped( pState->prev_regen, regen, bufferParameters.framesPerBuffer()); pState->prev_regen = regen; @@ -185,11 +186,11 @@ void FlangerEffect::processChannel(const ChannelHandle& handle, RampingValue<double> widthRamped( pState->prev_width, width, bufferParameters.framesPerBuffer()); - pState->prev_width = width; + pState->prev_width = static_cast<CSAMPLE_GAIN>(width); RampingValue<double> manualRamped( pState->prev_manual, manual, bufferParameters.framesPerBuffer()); - pState->prev_manual = manual; + pState->prev_manual = static_cast<CSAMPLE_GAIN>(manual); CSAMPLE* delayLeft = pState->delayLeft; CSAMPLE* delayRight = pState->delayRight; @@ -208,7 +209,7 @@ void FlangerEffect::processChannel(const ChannelHandle& handle, pState->lfoFrames = 0; } - float periodFraction = static_cast<float>(pState->lfoFrames) / lfoPeriodFrames; + auto periodFraction = pState->lfoFrames / static_cast<float>(lfoPeriodFrames); double delayMs = manual_ramped + width_ramped / 2 * sin(M_PI * 2.0f * periodFraction); double delayFrames = delayMs * bufferParameters.sampleRate() / 1000; @@ -222,7 +223,8 @@ void FlangerEffect::processChannel(const ChannelHandle& handle, CSAMPLE prevRight = delayRight[framePrev]; CSAMPLE nextRight = delayRight[frameNext]; - CSAMPLE frac = delayFrames - floorf(delayFrames); + const CSAMPLE_GAIN frac = static_cast<CSAMPLE_GAIN>( + delayFrames - floorf(static_cast<float>(delayFrames))); CSAMPLE delayedSampleLeft = prevLeft + frac * (nextLeft - prevLeft); CSAMPLE delayedSampleRight = prevRight + frac * (nextRight - prevRight); @@ -231,7 +233,7 @@ void FlangerEffect::processChannel(const ChannelHandle& handle, pState->delayPos = (pState->delayPos + 1) % kBufferLenth; - double gain = (1 - mix_ramped + kGainCorrection * mix_ramped); + CSAMPLE_GAIN gain = (1 - mix_ramped + kGainCorrection * mix_ramped); pOutput[i] = (pInput[i] + mix_ramped * delayedSampleLeft) / gain; pOutput[i + 1] = (pInput[i + 1] + mix_ramped * delayedSampleRight) / gain; } diff --git a/src/effects/builtin/graphiceqeffect.cpp b/src/effects/builtin/graphiceqeffect.cpp index 0e75760334..9429f5bbd1 100644 --- a/src/effects/builtin/graphiceqeffect.cpp +++ b/src/effects/builtin/graphiceqeffect.cpp @@ -173,10 +173,10 @@ void GraphicEQEffect::processChannel(const ChannelHandle& handle, fMid[i] = 1.0; } } else { - fLow = m_pPotLow->value(); - fHigh = m_pPotHigh->value(); + fLow = static_cast<float>(m_pPotLow->value()); + fHigh = static_cast<float>(m_pPotHigh->value()); for (int i = 0; i < 6; i++) { - fMid[i] = m_pPotMid[i]->value(); + fMid[i] = static_cast<float>(m_pPotMid[i]->value()); } } diff --git a/src/effects/builtin/linkwitzriley8eqeffect.cpp b/src/effects/builtin/linkwitzriley8eqeffect.cpp index 297f314725..b7e726cc9b 100644 --- a/src/effects/builtin/linkwitzriley8eqeffect.cpp +++ b/src/effects/builtin/linkwitzriley8eqeffect.cpp @@ -93,13 +93,13 @@ void LinkwitzRiley8EQEffect::processChannel(const ChannelHandle& handle, float fLow = 0.f, fMid = 0.f, fHigh = 0.f; if (!m_pKillLow->toBool()) { - fLow = m_pPotLow->value(); + fLow = static_cast<float>(m_pPotLow->value()); } if (!m_pKillMid->toBool()) { - fMid = m_pPotMid->value(); + fMid = static_cast<float>(m_pPotMid->value()); } if (!m_pKillHigh->toBool()) { - fHigh = m_pPotHigh->value(); + fHigh = static_cast<float>(m_pPotHigh->value()); } if (pState->m_oldSampleRate != bufferParameters.sampleRate() || @@ -116,11 +116,14 @@ void LinkwitzRiley8EQEffect::processChannel(const ChannelHandle& handle, if (fMid != pState->old_mid || fHigh != pState->old_high) { SampleUtil::applyRampingGain(pState->m_pHighBuf, - pState->old_high, fHigh, - bufferParameters.samplesPerBuffer()); + static_cast<CSAMPLE_GAIN>(pState->old_high), + fHigh, + bufferParameters.samplesPerBuffer()); SampleUtil::addWithRampingGain(pState->m_pHighBuf, - pState->m_pLowBuf, pState->old_mid, fMid, - bufferParameters.samplesPerBuffer()); + pState->m_pLowBuf, + static_cast<CSAMPLE_GAIN>(pState->old_mid), + fMid, + bufferParameters.samplesPerBuffer()); } else { SampleUtil::applyGain(pState->m_pHighBuf, fHigh, bufferParameters.samplesPerBuffer()); SampleUtil::addWithGain(pState->m_pHighBuf, @@ -133,8 +136,12 @@ void LinkwitzRiley8EQEffect::processChannel(const ChannelHandle& handle, if (fLow != pState->old_low) { SampleUtil::copy2WithRampingGain(pOutput, - pState->m_pLowBuf, pState->old_low, fLow, - pState->m_pMidBuf, 1, 1, + pState->m_pLowBuf, + static_cast<CSAMPLE_GAIN>(pState->old_low), + fLow, + pState->m_pMidBuf, + 1, + 1, bufferParameters.samplesPerBuffer()); } else { SampleUtil::copy2WithGain(pOutput, diff --git a/src/effects/builtin/loudnesscontoureffect.cpp b/src/effects/builtin/loudnesscontoureffect.cpp index fd1781f73b..5f9bea97e8 100644 --- a/src/effects/builtin/loudnesscontoureffect.cpp +++ b/src/effects/builtin/loudnesscontoureffect.cpp @@ -68,11 +68,10 @@ LoudnessContourEffectGroupState::LoudnessContourEffectGroupState( : EffectState(bufferParameters), m_oldGainKnob(1.0), m_oldLoudness(0.0), - m_oldGain(1.0), + m_oldGain(1.0f), m_oldFilterGainDb(0), m_oldUseGain(false), m_oldSampleRate(bufferParameters.sampleRate()) { - m_pBuf = SampleUtil::alloc(bufferParameters.samplesPerBuffer()); // Initialize the filters with default parameters @@ -115,7 +114,7 @@ void LoudnessContourEffect::processChannel( Q_UNUSED(groupFeatures); double filterGainDb = pState->m_oldFilterGainDb; - double gain = pState->m_oldGain; + auto gain = static_cast<CSAMPLE_GAIN>(pState->m_oldGain); if (enableState != EffectEnableState::Disabling) { @@ -144,7 +143,7 @@ void LoudnessContourEffect::processChannel( else { filterGainDb = -loudness; // compensate filter boost to avoid clipping - gain = db2ratio(-filterGainDb); + gain = static_cast<CSAMPLE_GAIN>(db2ratio(-filterGainDb)); } pState->setFilters(bufferParameters.sampleRate(), filterGainDb); } diff --git a/src/effects/builtin/loudnesscontoureffect.h b/src/effects/builtin/loudnesscontoureffect.h index 158b5af79a..8877dcb58d 100644 --- a/src/effects/builtin/loudnesscontoureffect.h +++ b/src/effects/builtin/loudnesscontoureffect.h @@ -25,7 +25,7 @@ class LoudnessContourEffectGroupState final : public EffectState { CSAMPLE* m_pBuf; double m_oldGainKnob; double m_oldLoudness; - double m_oldGain; + CSAMPLE_GAIN m_oldGain; double m_oldFilterGainDb; bool m_oldUseGain; unsigned int m_oldSampleRate; diff --git a/src/effects/builtin/lvmixeqbase.h b/src/effects/builtin/lvmixeqbase.h index 1674500011..a57b5a58ed 100644 --- a/src/effects/builtin/lvmixeqbase.h +++ b/src/effects/builtin/lvmixeqbase.h @@ -58,11 +58,15 @@ class LVMixEQEffectGroupState : public EffectState { m_groupDelay = delayLow1 * 2; } - void processChannel(const CSAMPLE* pInput, CSAMPLE* pOutput, - const int numSamples, - const unsigned int sampleRate, - double fLow, double fMid, double fHigh, - double loFreq, double hiFreq) { + void processChannel(const CSAMPLE* pInput, + CSAMPLE* pOutput, + const int numSamples, + const unsigned int sampleRate, + double dLow, + double dMid, + double dHigh, + double loFreq, + double hiFreq) { if (m_oldSampleRate != sampleRate || (m_loFreq != loFreq) || (m_hiFreq != hiFreq)) { @@ -76,8 +80,9 @@ class LVMixEQEffectGroupState : public EffectState { // we can subtract or add the filtered signal to the dry signal if we compensate this delay // The dry signal represents the high gain // Then the higher low pass is added and at least the lower low pass result. - fLow = fLow - fMid; - fMid = fMid - fHigh; + auto fLow = static_cast<CSAMPLE>(dLow - dMid); + auto fMid = static_cast<CSAMPLE>(dMid - dHigh); + auto fHigh = static_cast<CSAMPLE>(dHigh); // Note: We do not call pauseFilter() here because this will introduce a // buffer size-dependent start delay. During such start delay some unwanted @@ -241,9 +246,9 @@ class LVMixEQEffectGroupState : public EffectState { EngineFilterDelay<kMaxDelay>* m_delay2; EngineFilterDelay<kMaxDelay>* m_delay3; - double m_oldLow; - double m_oldMid; - double m_oldHigh; + CSAMPLE_GAIN m_oldLow; + CSAMPLE_GAIN m_oldMid; + CSAMPLE_GAIN m_oldHigh; int m_rampHoldOff; int m_groupDelay; diff --git a/src/effects/builtin/moogladder4filtereffect.cpp b/src/effects/builtin/moogladder4filtereffect.cpp index d0d622d9de..a6d5f419f5 100644 --- a/src/effects/builtin/moogladder4filtereffect.cpp +++ b/src/effects/builtin/moogladder4filtereffect.cpp @@ -120,17 +120,17 @@ void MoogLadder4FilterEffect::processChannel( if (pState->m_loFreq != lpf || pState->m_resonance != resonance || pState->m_samplerate != bufferParameters.sampleRate()) { - pState->m_pLowFilter->setParameter( - bufferParameters.sampleRate(), lpf * bufferParameters.sampleRate(), - resonance); + pState->m_pLowFilter->setParameter(bufferParameters.sampleRate(), + static_cast<float>(lpf * bufferParameters.sampleRate()), + static_cast<float>(resonance)); } if (pState->m_hiFreq != hpf || pState->m_resonance != resonance || pState->m_samplerate != bufferParameters.sampleRate()) { - pState->m_pHighFilter->setParameter( - bufferParameters.sampleRate(), hpf * bufferParameters.sampleRate(), - resonance); + pState->m_pHighFilter->setParameter(bufferParameters.sampleRate(), + static_cast<float>(hpf * bufferParameters.sampleRate()), + static_cast<float>(resonance)); } const CSAMPLE* pLpfInput = pState->m_pBuf; diff --git a/src/effects/builtin/parametriceqeffect.cpp b/src/effects/builtin/parametriceqeffect.cpp index c58c6de042..2a6f8c4250 100644 --- a/src/effects/builtin/parametriceqeffect.cpp +++ b/src/effects/builtin/parametriceqeffect.cpp @@ -180,10 +180,10 @@ void ParametricEQEffect::processChannel(const ChannelHandle& handle, // Ramp to dry, when disabling, this will ramp from dry when enabling as well fGain[i] = 1.0; } else { - fGain[i] = m_pPotGain[i]->value(); + fGain[i] = static_cast<CSAMPLE_GAIN>(m_pPotGain[i]->value()); } - fQ[i] = m_pPotQ[i]->value(); - fCenter[i] = m_pPotCenter[i]->value(); + fQ[i] = static_cast<CSAMPLE_GAIN>(m_pPotQ[i]->value()); + fCenter[i] = static_cast<CSAMPLE_GAIN>(m_pPotCenter[i]->value()); if (fGain[i] != pState->m_oldGain[i] || fQ[i] != pState->m_oldQ[i] || fCenter[i] != pState->m_oldCenter[i]) { diff --git a/src/engine/controls/ratecontrol.cpp b/src/engine/controls/ratecontrol.cpp index e2b25a20f7..f79cc0060d 100644 --- a/src/engine/controls/ratecontrol.cpp +++ b/src/engine/controls/ratecontrol.cpp @@ -475,7 +475,7 @@ double RateControl::calculateSpeed(double baserate, double speed, bool paused, } // If we are reversing (and not scratching,) flip the rate. This is ok even when syncing. // Reverse with vinyl is only ok if absolute mode isn't on. - int vcmode = m_pVCMode ? m_pVCMode->get() : MIXXX_VCMODE_ABSOLUTE; + int vcmode = m_pVCMode ? static_cast<int>(m_pVCMode->get()) : MIXXX_VCMODE_ABSOLUTE; // TODO(owen): Instead of just ignoring reverse mode, should we // disable absolute mode instead? if (m_pReverseButton->get() diff --git a/src/engine/enginesidechaincompressor.cpp b/src/engine/enginesidechaincompressor.cpp index bfc6b49739..7ff4cb1b04 100644 --- a/src/engine/enginesidechaincompressor.cpp +++ b/src/engine/enginesidechaincompressor.cpp @@ -29,10 +29,10 @@ void EngineSideChainCompressor::calculateRates() { m_decayPerFrame = m_strength / m_decayTime; } if (m_attackPerFrame <= 0) { - m_attackPerFrame = 0.005; + m_attackPerFrame = 0.005f; } if (m_decayPerFrame <= 0) { - m_decayPerFrame = 0.005; + m_decayPerFrame = 0.005f; } //qDebug() << "Compressor attack per frame: " << m_attackPerFrame // << "decay per frame: " << m_decayPerFrame; diff --git a/src/engine/filters/enginefilterdelay.h b/src/engine/filters/enginefilterdelay.h index d267b83089..e57d1ada34 100644 --- a/src/engine/filters/enginefilterdelay.h +++ b/src/engine/filters/enginefilterdelay.h @@ -108,7 +108,7 @@ class EngineFilterDelay : public EngineObjectConstIn { // it is an alternative for using pauseFillter() calls void processAndPauseFilter(const CSAMPLE* pIn, CSAMPLE* pOutput, const int iBufferSize) { - double oldDelay = m_delaySamples; + int oldDelay = m_delaySamples; m_delaySamples = 0; process(pIn, pOutput, iBufferSize); m_delaySamples = oldDelay; diff --git a/src/engine/filters/enginefiltermoogladder4.h b/src/engine/filters/enginefiltermoogladder4.h index e7f87d3880..8d4f1c44cb 100644 --- a/src/engine/filters/enginefiltermoogladder4.h +++ b/src/engine/filters/enginefiltermoogladder4.h @@ -84,14 +84,15 @@ class EngineFilterMoogLadderBase : public EngineObjectConstIn { } // frequency & amplitude correction - float kfcr = 1.8730 * (kfc*kfc*kfc) + 0.4955 * (kfc*kfc) - 0.6490 * kfc + 0.9988; + const float kfcr = 1.8730f * (kfc * kfc * kfc) + 0.4955f * (kfc * kfc) - + 0.6490f * kfc + 0.9988f; - float x = -2.0 * kPi * kfcr * kf; // input for taylor approximations + float x = -2.0f * kPi * kfcr * kf; // input for taylor approximations float exp_out = expf(x); m_k2vgNew = v2 * (1 - exp_out); // filter tuning // Resonance correction for self oscillation ~4 - m_kacrNew = resonance * (-3.9364 * (kfc*kfc) + 1.8409 * kfc + 0.9968); + m_kacrNew = resonance * (-3.9364f * (kfc * kfc) + 1.8409f * kfc + 0.9968f); if (MODE == MoogMode::HighPassOversampling || MODE == MoogMode::HighPass) { m_postGainNew = 1; @@ -135,12 +136,10 @@ class EngineFilterMoogLadderBase : public EngineObjectConstIn { for (int i = 0; i < iBufferSize; i += 2) { cross_mix += cross_inc; - m_postGain = m_postGainNew * cross_mix - + startPostGain * (1.0 - cross_mix); - m_kacr = m_kacrNew * cross_mix - + startKacr * (1.0 - cross_mix); - m_k2vg = m_k2vgNew * cross_mix - + startK2vg * (1.0 - cross_mix); + m_postGain = static_cast<float>(m_postGainNew * cross_mix + + startPostGain * (1.0 - cross_mix)); + m_kacr = static_cast<float>(m_kacrNew * cross_mix + startKacr * (1.0 - cross_mix)); + m_k2vg = static_cast<float>(m_k2vgNew * cross_mix + startK2vg * (1.0 - cross_mix)); pOutput[i] = processSample(pIn[i], &m_buf[0]); pOutput[i+1] = processSample(pIn[i+1], &m_buf[1]); } diff --git a/src/engine/filters/enginefilterpansingle.h b/src/engine/filters/enginefilterpansingle.h index 3a91f1cf78..df0a608148 100644 --- a/src/engine/filters/enginefilterpansingle.h +++ b/src/engine/filters/enginefilterpansingle.h @@ -53,8 +53,10 @@ class EngineFilterPanSingle { m_delayFrame = (m_delayFrame + 1) % SIZE; // prepare coefficients for linear interpolation using a linear stretching - CSAMPLE_GAIN timeBetweenFullSamplesLeft = fmod(delayLeftSourceFrame, 1); - CSAMPLE_GAIN timeBetweenFullSamplesRight = fmod(delayRightSourceFrame, 1); + const auto timeBetweenFullSamplesLeft = + static_cast<CSAMPLE_GAIN>(fmod(delayLeftSourceFrame, 1)); + const auto timeBetweenFullSamplesRight = + static_cast<CSAMPLE_GAIN>(fmod(delayRightSourceFrame, 1)); // applying the delay on left channel with linear interpolation between each sample pOutput[0] = diff --git a/src/engine/positionscratchcontroller.cpp b/src/engine/positionscratchcontroller.cpp index 44e8cd4d43..cb7a93e61d 100644 --- a/src/engine/positionscratchcontroller.cpp +++ b/src/engine/positionscratchcontroller.cpp @@ -111,7 +111,7 @@ void PositionScratchController::process(double currentSample, double releaseRate // have 0 ... 3 samples. The remaining jitter is ironed by the following IIR // lowpass filter const double m_dMouseSampeIntervall = 0.016; - const int callsPerDt = ceil(m_dMouseSampeIntervall/dt); + const auto callsPerDt = static_cast<int>(ceil(m_dMouseSampeIntervall / dt)); double scratchPosition = 0; m_dMouseSampeTime += dt; if (m_dMouseSampeTime >= m_dMouseSampeIntervall || !m_bScratching) { diff --git a/src/library/autodj/dlgautodj.cpp b/src/library/autodj/dlgautodj.cpp index b80465998b..cea92beec2 100644 --- a/src/library/autodj/dlgautodj.cpp +++ b/src/library/autodj/dlgautodj.cpp @@ -190,7 +190,7 @@ DlgAutoDJ::DlgAutoDJ( // Setup DlgAutoDJ UI based on the current AutoDJProcessor state. Keep in // mind that AutoDJ may already be active when DlgAutoDJ is created (due to // skin changes, etc.). - spinBoxTransition->setValue(m_pAutoDJProcessor->getTransitionTime()); + spinBoxTransition->setValue(static_cast<int>(m_pAutoDJProcessor->getTransitionTime())); connect(m_pAutoDJProcessor, &AutoDJProcessor::transitionTimeChanged, this, diff --git a/src/library/basecoverartdelegate.cpp b/src/library/basecoverartdelegate.cpp index f828877299..d7b0955a9a 100644 --- a/src/library/basecoverartdelegate.cpp +++ b/src/library/basecoverartdelegate.cpp @@ -119,7 +119,7 @@ void BaseCoverArtDelegate::paintItem( QPixmap pixmap = m_pCache->tryLoadCover( this, coverInfo, - option.rect.width() * scaleFactor, + static_cast<int>(option.rect.width() * scaleFactor), m_inhibitLazyLoading ? CoverArtCache::Loading::CachedOnly : CoverArtCache::Loading::Default); if (pixmap.isNull()) { // Cache miss diff --git a/src/library/dlgcoverartfullsize.cpp b/src/library/dlgcoverartfullsize.cpp index 2fa8b2c851..53bfd7313b 100644 --- a/src/library/dlgcoverartfullsize.cpp +++ b/src/library/dlgcoverartfullsize.cpp @@ -247,8 +247,8 @@ void DlgCoverArtFullSize::wheelEvent(QWheelEvent* event) { // Scale the image size int oldWidth = width(); int oldHeight = height(); - int newWidth = oldWidth + (0.2 * event->angleDelta().y()); - int newHeight = oldHeight + (0.2 * event->angleDelta().y()); + auto newWidth = static_cast<int>(oldWidth + (0.2 * event->a |