From f64c98e2e80637eec68d7ecc58052c1087f328e2 Mon Sep 17 00:00:00 2001 From: Ferran Pujol Camins Date: Fri, 30 Sep 2022 22:39:20 +0200 Subject: [PATCH 01/10] Implement band bypass mode on all eq effects --- .../backends/builtin/bessel4lvmixeqeffect.cpp | 16 +++---- .../backends/builtin/bessel4lvmixeqeffect.h | 6 +-- .../backends/builtin/bessel8lvmixeqeffect.cpp | 16 +++---- .../backends/builtin/bessel8lvmixeqeffect.h | 6 +-- .../builtin/biquadfullkilleqeffect.cpp | 48 +++++++++++++------ .../backends/builtin/biquadfullkilleqeffect.h | 1 + .../builtin/linkwitzriley8eqeffect.cpp | 13 ++--- .../backends/builtin/linkwitzriley8eqeffect.h | 6 +-- .../builtin/threebandbiquadeqeffect.cpp | 28 ++++++----- .../builtin/threebandbiquadeqeffect.h | 3 +- src/effects/effectsmanager.cpp | 3 +- src/effects/effectsmanager.h | 4 ++ 12 files changed, 83 insertions(+), 67 deletions(-) diff --git a/src/effects/backends/builtin/bessel4lvmixeqeffect.cpp b/src/effects/backends/builtin/bessel4lvmixeqeffect.cpp index 31fe55a00b1..82ea3ae2c78 100644 --- a/src/effects/backends/builtin/bessel4lvmixeqeffect.cpp +++ b/src/effects/backends/builtin/bessel4lvmixeqeffect.cpp @@ -29,8 +29,9 @@ EffectManifestPointer Bessel4LVMixEQEffect::getManifest() { } Bessel4LVMixEQEffect::Bessel4LVMixEQEffect() { - m_pLoFreqCorner = new ControlProxy("[Mixer Profile]", "LoEQFrequency"); - m_pHiFreqCorner = new ControlProxy("[Mixer Profile]", "HiEQFrequency"); + m_pLoFreqCorner = std::make_unique("[Mixer Profile]", "LoEQFrequency"); + m_pHiFreqCorner = std::make_unique("[Mixer Profile]", "HiEQFrequency"); + m_pEQButtonMode = std::make_unique("[Mixer Profile]", "EQButtonMode"); } void Bessel4LVMixEQEffect::loadEngineEffectParameters( @@ -43,11 +44,6 @@ void Bessel4LVMixEQEffect::loadEngineEffectParameters( m_pKillHigh = parameters.value("killHigh"); } -Bessel4LVMixEQEffect::~Bessel4LVMixEQEffect() { - delete m_pLoFreqCorner; - delete m_pHiFreqCorner; -} - void Bessel4LVMixEQEffect::processChannel( Bessel4LVMixEQEffectGroupState* pState, const CSAMPLE* pInput, @@ -67,17 +63,17 @@ void Bessel4LVMixEQEffect::processChannel( if (!m_pKillLow->toBool()) { fLow = m_pPotLow->value(); } else { - fLow = 0; + fLow = m_pEQButtonMode->get() == 0 ? 0 : 1; } if (!m_pKillMid->toBool()) { fMid = m_pPotMid->value(); } else { - fMid = 0; + fMid = m_pEQButtonMode->get() == 0 ? 0 : 1; } if (!m_pKillHigh->toBool()) { fHigh = m_pPotHigh->value(); } else { - fHigh = 0; + fHigh = m_pEQButtonMode->get() == 0 ? 0 : 1; } pState->processChannel(pInput, pOutput, diff --git a/src/effects/backends/builtin/bessel4lvmixeqeffect.h b/src/effects/backends/builtin/bessel4lvmixeqeffect.h index c5295f9eb2f..97b22e06c72 100644 --- a/src/effects/backends/builtin/bessel4lvmixeqeffect.h +++ b/src/effects/backends/builtin/bessel4lvmixeqeffect.h @@ -22,7 +22,6 @@ class Bessel4LVMixEQEffectGroupState : public LVMixEQEffectGroupState { public: Bessel4LVMixEQEffect(); - virtual ~Bessel4LVMixEQEffect(); static QString getId(); static EffectManifestPointer getManifest(); @@ -51,8 +50,9 @@ class Bessel4LVMixEQEffect : public EffectProcessorImpl m_pLoFreqCorner; + std::unique_ptr m_pHiFreqCorner; + std::unique_ptr m_pEQButtonMode; DISALLOW_COPY_AND_ASSIGN(Bessel4LVMixEQEffect); }; diff --git a/src/effects/backends/builtin/bessel8lvmixeqeffect.cpp b/src/effects/backends/builtin/bessel8lvmixeqeffect.cpp index ff201f0bd60..ea61c9b79a6 100644 --- a/src/effects/backends/builtin/bessel8lvmixeqeffect.cpp +++ b/src/effects/backends/builtin/bessel8lvmixeqeffect.cpp @@ -29,8 +29,9 @@ EffectManifestPointer Bessel8LVMixEQEffect::getManifest() { } Bessel8LVMixEQEffect::Bessel8LVMixEQEffect() { - m_pLoFreqCorner = new ControlProxy("[Mixer Profile]", "LoEQFrequency"); - m_pHiFreqCorner = new ControlProxy("[Mixer Profile]", "HiEQFrequency"); + m_pLoFreqCorner = std::make_unique("[Mixer Profile]", "LoEQFrequency"); + m_pHiFreqCorner = std::make_unique("[Mixer Profile]", "HiEQFrequency"); + m_pEQButtonMode = std::make_unique("[Mixer Profile]", "EQButtonMode"); } void Bessel8LVMixEQEffect::loadEngineEffectParameters( @@ -43,11 +44,6 @@ void Bessel8LVMixEQEffect::loadEngineEffectParameters( m_pKillHigh = parameters.value("killHigh"); } -Bessel8LVMixEQEffect::~Bessel8LVMixEQEffect() { - delete m_pLoFreqCorner; - delete m_pHiFreqCorner; -} - void Bessel8LVMixEQEffect::processChannel( Bessel8LVMixEQEffectGroupState* pState, const CSAMPLE* pInput, @@ -67,17 +63,17 @@ void Bessel8LVMixEQEffect::processChannel( if (!m_pKillLow->toBool()) { fLow = m_pPotLow->value(); } else { - fLow = 0; + fLow = m_pEQButtonMode->get() == 0 ? 0 : 1; } if (!m_pKillMid->toBool()) { fMid = m_pPotMid->value(); } else { - fMid = 0; + fMid = m_pEQButtonMode->get() == 0 ? 0 : 1; } if (!m_pKillHigh->toBool()) { fHigh = m_pPotHigh->value(); } else { - fHigh = 0; + fHigh = m_pEQButtonMode->get() == 0 ? 0 : 1; } pState->processChannel(pInput, pOutput, diff --git a/src/effects/backends/builtin/bessel8lvmixeqeffect.h b/src/effects/backends/builtin/bessel8lvmixeqeffect.h index 097df8c96e6..88b9388431b 100644 --- a/src/effects/backends/builtin/bessel8lvmixeqeffect.h +++ b/src/effects/backends/builtin/bessel8lvmixeqeffect.h @@ -24,7 +24,6 @@ class Bessel8LVMixEQEffectGroupState : public LVMixEQEffectGroupState { public: Bessel8LVMixEQEffect(); - virtual ~Bessel8LVMixEQEffect(); static QString getId(); static EffectManifestPointer getManifest(); @@ -53,8 +52,9 @@ class Bessel8LVMixEQEffect : public EffectProcessorImpl m_pLoFreqCorner; + std::unique_ptr m_pHiFreqCorner; + std::unique_ptr m_pEQButtonMode; DISALLOW_COPY_AND_ASSIGN(Bessel8LVMixEQEffect); }; diff --git a/src/effects/backends/builtin/biquadfullkilleqeffect.cpp b/src/effects/backends/builtin/biquadfullkilleqeffect.cpp index fa3bcb4b35a..6a23627d966 100644 --- a/src/effects/backends/builtin/biquadfullkilleqeffect.cpp +++ b/src/effects/backends/builtin/biquadfullkilleqeffect.cpp @@ -145,6 +145,7 @@ void BiquadFullKillEQEffectGroupState::setFilters( BiquadFullKillEQEffect::BiquadFullKillEQEffect() { m_pLoFreqCorner = std::make_unique("[Mixer Profile]", "LoEQFrequency"); m_pHiFreqCorner = std::make_unique("[Mixer Profile]", "HiEQFrequency"); + m_pEQButtonMode = std::make_unique("[Mixer Profile]", "EQButtonMode"); } void BiquadFullKillEQEffect::loadEngineEffectParameters( @@ -157,9 +158,6 @@ void BiquadFullKillEQEffect::loadEngineEffectParameters( m_pKillHigh = parameters.value("killHigh"); } -// BiquadFullKillEQEffect::~BiquadFullKillEQEffect() { -// } - void BiquadFullKillEQEffect::processChannel( BiquadFullKillEQEffectGroupState* pState, const CSAMPLE* pInput, @@ -185,12 +183,21 @@ void BiquadFullKillEQEffect::processChannel( double bqGainMid = 0; double bqGainHigh = 0; if (enableState != EffectEnableState::Disabling) { - bqGainLow = knobValueToBiquadGainDb( - m_pPotLow->value(), m_pKillLow->toBool()); - bqGainMid = knobValueToBiquadGainDb( - m_pPotMid->value(), m_pKillMid->toBool()); - bqGainHigh = knobValueToBiquadGainDb( - m_pPotHigh->value(), m_pKillHigh->toBool()); + if (m_pEQButtonMode->get() == 0) { + bqGainLow = knobValueToBiquadGainDb( + m_pPotLow->value(), m_pKillLow->toBool()); + bqGainMid = knobValueToBiquadGainDb( + m_pPotMid->value(), m_pKillMid->toBool()); + bqGainHigh = knobValueToBiquadGainDb( + m_pPotHigh->value(), m_pKillHigh->toBool()); + } else { + bqGainLow = knobValueToBiquadGainDb( + m_pKillLow->toBool() ? 1 : m_pPotLow->value(), false); + bqGainMid = knobValueToBiquadGainDb( + m_pKillMid->toBool() ? 1 : m_pPotMid->value(), false); + bqGainHigh = knobValueToBiquadGainDb( + m_pKillHigh->toBool() ? 1 : m_pPotHigh->value(), false); + } } int activeFilters = 0; @@ -394,12 +401,23 @@ void BiquadFullKillEQEffect::processChannel( pState->m_lvMixIso->processChannelAndPause( pOutput, pOutput, engineParameters.samplesPerBuffer()); } else { - double fLow = knobValueToBesselRatio( - m_pPotLow->value(), m_pKillLow->toBool()); - double fMid = knobValueToBesselRatio( - m_pPotMid->value(), m_pKillMid->toBool()); - double fHigh = knobValueToBesselRatio( - m_pPotHigh->value(), m_pKillHigh->toBool()); + double fLow, fMid, fHigh; + if (m_pEQButtonMode->get() == 0) { + fLow = knobValueToBesselRatio( + m_pPotLow->value(), m_pKillLow->toBool()); + fMid = knobValueToBesselRatio( + m_pPotMid->value(), m_pKillMid->toBool()); + fHigh = knobValueToBesselRatio( + m_pPotHigh->value(), m_pKillHigh->toBool()); + } else { + fLow = knobValueToBesselRatio( + m_pKillLow->toBool() ? 1 : m_pPotLow->value(), false); + fMid = knobValueToBesselRatio( + m_pKillMid->toBool() ? 1 : m_pPotMid->value(), false); + fHigh = knobValueToBesselRatio( + m_pKillHigh->toBool() ? 1 : m_pPotHigh->value(), false); + } + pState->m_lvMixIso->processChannel(pOutput, pOutput, engineParameters.samplesPerBuffer(), diff --git a/src/effects/backends/builtin/biquadfullkilleqeffect.h b/src/effects/backends/builtin/biquadfullkilleqeffect.h index 065572d8510..30344e34d56 100644 --- a/src/effects/backends/builtin/biquadfullkilleqeffect.h +++ b/src/effects/backends/builtin/biquadfullkilleqeffect.h @@ -96,4 +96,5 @@ class BiquadFullKillEQEffect : public EffectProcessorImpl m_pLoFreqCorner; std::unique_ptr m_pHiFreqCorner; + std::unique_ptr m_pEQButtonMode; }; diff --git a/src/effects/backends/builtin/linkwitzriley8eqeffect.cpp b/src/effects/backends/builtin/linkwitzriley8eqeffect.cpp index 03c020a441c..eef096ce0ea 100644 --- a/src/effects/backends/builtin/linkwitzriley8eqeffect.cpp +++ b/src/effects/backends/builtin/linkwitzriley8eqeffect.cpp @@ -68,8 +68,9 @@ void LinkwitzRiley8EQEffectGroupState::setFilters(int sampleRate, int lowFreq, i } LinkwitzRiley8EQEffect::LinkwitzRiley8EQEffect() { - m_pLoFreqCorner = new ControlProxy("[Mixer Profile]", "LoEQFrequency"); - m_pHiFreqCorner = new ControlProxy("[Mixer Profile]", "HiEQFrequency"); + m_pLoFreqCorner = std::make_unique("[Mixer Profile]", "LoEQFrequency"); + m_pHiFreqCorner = std::make_unique("[Mixer Profile]", "HiEQFrequency"); + m_pEQButtonMode = std::make_unique("[Mixer Profile]", "EQButtonMode"); } void LinkwitzRiley8EQEffect::loadEngineEffectParameters( @@ -82,11 +83,6 @@ void LinkwitzRiley8EQEffect::loadEngineEffectParameters( m_pKillHigh = parameters.value("killHigh"); } -LinkwitzRiley8EQEffect::~LinkwitzRiley8EQEffect() { - delete m_pLoFreqCorner; - delete m_pHiFreqCorner; -} - void LinkwitzRiley8EQEffect::processChannel( LinkwitzRiley8EQEffectGroupState* pState, const CSAMPLE* pInput, @@ -96,7 +92,8 @@ void LinkwitzRiley8EQEffect::processChannel( const GroupFeatureState& groupFeatures) { Q_UNUSED(groupFeatures); - float fLow = 0.f, fMid = 0.f, fHigh = 0.f; + float fButtonOnValue = static_cast(m_pEQButtonMode->get()); + float fLow = fButtonOnValue, fMid = fButtonOnValue, fHigh = fButtonOnValue; if (!m_pKillLow->toBool()) { fLow = static_cast(m_pPotLow->value()); } diff --git a/src/effects/backends/builtin/linkwitzriley8eqeffect.h b/src/effects/backends/builtin/linkwitzriley8eqeffect.h index 15ed871dc02..728128fb2ec 100644 --- a/src/effects/backends/builtin/linkwitzriley8eqeffect.h +++ b/src/effects/backends/builtin/linkwitzriley8eqeffect.h @@ -40,7 +40,6 @@ class LinkwitzRiley8EQEffectGroupState : public EffectState { class LinkwitzRiley8EQEffect : public EffectProcessorImpl { public: LinkwitzRiley8EQEffect(); - virtual ~LinkwitzRiley8EQEffect(); static QString getId(); static EffectManifestPointer getManifest(); @@ -69,8 +68,9 @@ class LinkwitzRiley8EQEffect : public EffectProcessorImpl m_pLoFreqCorner; + std::unique_ptr m_pHiFreqCorner; + std::unique_ptr m_pEQButtonMode; DISALLOW_COPY_AND_ASSIGN(LinkwitzRiley8EQEffect); }; diff --git a/src/effects/backends/builtin/threebandbiquadeqeffect.cpp b/src/effects/backends/builtin/threebandbiquadeqeffect.cpp index 26bec1c134f..648f4f6fc1d 100644 --- a/src/effects/backends/builtin/threebandbiquadeqeffect.cpp +++ b/src/effects/backends/builtin/threebandbiquadeqeffect.cpp @@ -96,9 +96,6 @@ ThreeBandBiquadEQEffectGroupState::ThreeBandBiquadEQEffectGroupState( engineParameters.sampleRate(), kStartupHiFreq / 2, kQKillShelve); } -ThreeBandBiquadEQEffectGroupState::~ThreeBandBiquadEQEffectGroupState() { -} - void ThreeBandBiquadEQEffectGroupState::setFilters( int sampleRate, double lowFreqCorner, double highFreqCorner) { double lowCenter = getCenterFrequency(kMinimumFrequency, lowFreqCorner); @@ -122,6 +119,7 @@ void ThreeBandBiquadEQEffectGroupState::setFilters( ThreeBandBiquadEQEffect::ThreeBandBiquadEQEffect() { m_pLoFreqCorner = std::make_unique("[Mixer Profile]", "LoEQFrequency"); m_pHiFreqCorner = std::make_unique("[Mixer Profile]", "HiEQFrequency"); + m_pEQButtonMode = std::make_unique("[Mixer Profile]", "EQButtonMode"); } void ThreeBandBiquadEQEffect::loadEngineEffectParameters( @@ -134,9 +132,6 @@ void ThreeBandBiquadEQEffect::loadEngineEffectParameters( m_pKillHigh = parameters.value("killHigh"); } -ThreeBandBiquadEQEffect::~ThreeBandBiquadEQEffect() { -} - void ThreeBandBiquadEQEffect::processChannel( ThreeBandBiquadEQEffectGroupState* pState, const CSAMPLE* pInput, @@ -162,12 +157,21 @@ void ThreeBandBiquadEQEffect::processChannel( double bqGainMid = 0; double bqGainHigh = 0; if (enableState != EffectEnableState::Disabling) { - bqGainLow = knobValueToBiquadGainDb( - m_pPotLow->value(), m_pKillLow->toBool()); - bqGainMid = knobValueToBiquadGainDb( - m_pPotMid->value(), m_pKillMid->toBool()); - bqGainHigh = knobValueToBiquadGainDb( - m_pPotHigh->value(), m_pKillHigh->toBool()); + if (m_pEQButtonMode->get() == 0) { + bqGainLow = knobValueToBiquadGainDb( + m_pPotLow->value(), m_pKillLow->toBool()); + bqGainMid = knobValueToBiquadGainDb( + m_pPotMid->value(), m_pKillMid->toBool()); + bqGainHigh = knobValueToBiquadGainDb( + m_pPotHigh->value(), m_pKillHigh->toBool()); + } else { + bqGainLow = knobValueToBiquadGainDb( + m_pKillLow->toBool() ? 1 : m_pPotLow->value(), false); + bqGainMid = knobValueToBiquadGainDb( + m_pKillMid->toBool() ? 1 : m_pPotMid->value(), false); + bqGainHigh = knobValueToBiquadGainDb( + m_pKillHigh->toBool() ? 1 : m_pPotHigh->value(), false); + } } int activeFilters = 0; diff --git a/src/effects/backends/builtin/threebandbiquadeqeffect.h b/src/effects/backends/builtin/threebandbiquadeqeffect.h index 5d69d40593d..f2a177bdb46 100644 --- a/src/effects/backends/builtin/threebandbiquadeqeffect.h +++ b/src/effects/backends/builtin/threebandbiquadeqeffect.h @@ -15,7 +15,6 @@ class ThreeBandBiquadEQEffectGroupState final : public EffectState { public: ThreeBandBiquadEQEffectGroupState(const mixxx::EngineParameters& engineParameters); - ~ThreeBandBiquadEQEffectGroupState(); void setFilters( int sampleRate, double lowFreqCorner, double highFreqCorner); @@ -43,7 +42,6 @@ class ThreeBandBiquadEQEffectGroupState final : public EffectState { class ThreeBandBiquadEQEffect : public EffectProcessorImpl { public: ThreeBandBiquadEQEffect(); - ~ThreeBandBiquadEQEffect() override; static QString getId(); static EffectManifestPointer getManifest(); @@ -79,4 +77,5 @@ class ThreeBandBiquadEQEffect : public EffectProcessorImpl m_pLoFreqCorner; std::unique_ptr m_pHiFreqCorner; + std::unique_ptr m_pEQButtonMode; }; diff --git a/src/effects/effectsmanager.cpp b/src/effects/effectsmanager.cpp index 36c107e344d..cbf8bfe9468 100644 --- a/src/effects/effectsmanager.cpp +++ b/src/effects/effectsmanager.cpp @@ -27,7 +27,8 @@ EffectsManager::EffectsManager( : m_pConfig(pConfig), m_pChannelHandleFactory(pChannelHandleFactory), m_loEqFreq(ConfigKey("[Mixer Profile]", "LoEQFrequency"), 0., 22040), - m_hiEqFreq(ConfigKey("[Mixer Profile]", "HiEQFrequency"), 0., 22040) { + m_hiEqFreq(ConfigKey("[Mixer Profile]", "HiEQFrequency"), 0., 22040), + m_eqButtonMode(ConfigKey("[Mixer Profile]", "EQButtonMode"), true, 0) { qRegisterMetaType("EffectChainMixMode"); m_pBackendManager = EffectsBackendManagerPointer(new EffectsBackendManager()); diff --git a/src/effects/effectsmanager.h b/src/effects/effectsmanager.h index 2e45b256405..8c5426e88f4 100644 --- a/src/effects/effectsmanager.h +++ b/src/effects/effectsmanager.h @@ -5,6 +5,7 @@ #include #include "control/controlpotmeter.h" +#include "control/controlpushbutton.h" #include "effects/backends/effectsbackendmanager.h" #include "effects/presets/effectchainpresetmanager.h" #include "engine/channelhandle.h" @@ -105,5 +106,8 @@ class EffectsManager { ControlPotmeter m_loEqFreq; ControlPotmeter m_hiEqFreq; + // 0 is kill, 1 bypass + ControlPushButton m_eqButtonMode; + DISALLOW_COPY_AND_ASSIGN(EffectsManager); }; From f278af251df6baccf9dc06512f5a47f6b5d2fcc8 Mon Sep 17 00:00:00 2001 From: Ferran Pujol Camins Date: Fri, 30 Sep 2022 23:21:58 +0200 Subject: [PATCH 02/10] Add UI to change eq button mode --- src/preferences/dialog/dlgprefeq.cpp | 24 +++ src/preferences/dialog/dlgprefeq.h | 5 +- src/preferences/dialog/dlgprefeqdlg.ui | 268 ++++++++++++++----------- 3 files changed, 176 insertions(+), 121 deletions(-) diff --git a/src/preferences/dialog/dlgprefeq.cpp b/src/preferences/dialog/dlgprefeq.cpp index b6df75433c3..4621d4ce920 100644 --- a/src/preferences/dialog/dlgprefeq.cpp +++ b/src/preferences/dialog/dlgprefeq.cpp @@ -45,9 +45,11 @@ DlgPrefEQ::DlgPrefEQ( : DlgPreferencePage(pParent), m_COLoFreq(kConfigGroup, QStringLiteral("LoEQFrequency")), m_COHiFreq(kConfigGroup, QStringLiteral("HiEQFrequency")), + m_COButtonMode(kConfigGroup, QStringLiteral("EQButtonMode")), m_pConfig(pConfig), m_lowEqFreq(0.0), m_highEqFreq(0.0), + m_buttonMode(0), m_pChainPresetManager(pEffectsManager->getChainPresetManager()), m_pEffectsManager(pEffectsManager), m_pBackendManager(pEffectsManager->getBackendManager()), @@ -79,6 +81,18 @@ DlgPrefEQ::DlgPrefEQ( connect(SliderLoEQ, &QSlider::sliderMoved, this, &DlgPrefEQ::slotUpdateLoEQ); connect(SliderLoEQ, &QSlider::sliderReleased, this, &DlgPrefEQ::slotUpdateLoEQ); + if (m_COButtonMode.get() == 0) { + radioButtonKillMode->setChecked(true); + } else { + radioButtonBypassMode->setChecked(true); + } + + connect(eqButtonModebuttonGroup, + QOverload::of(&QButtonGroup::buttonClicked), + this, + QOverload::of( + &DlgPrefEQ::slotUpdateEqButtonMode)); + connect(CheckBoxEqAutoReset, &QCheckBox::stateChanged, this, &DlgPrefEQ::slotUpdateEqAutoReset); connect(CheckBoxGainAutoReset, &QCheckBox::stateChanged, @@ -590,6 +604,14 @@ void DlgPrefEQ::slotUpdateLoEQ() { slotApply(); } +void DlgPrefEQ::slotUpdateEqButtonMode(QAbstractButton* selectedButton) { + if (selectedButton == radioButtonKillMode) { + m_buttonMode = 0; + } else { + m_buttonMode = 1; + } +} + void DlgPrefEQ::slotApplyMainEQParameter(int value) { EffectSlotPointer pEffectSlot(m_pEffectMainEQ); if (!pEffectSlot.isNull()) { @@ -630,6 +652,7 @@ int DlgPrefEQ::getSliderPosition(double eqFreq, int minValue, int maxValue) { void DlgPrefEQ::slotApply() { m_COLoFreq.set(m_lowEqFreq); m_COHiFreq.set(m_highEqFreq); + m_COButtonMode.set(m_buttonMode); m_pConfig->set(ConfigKey(kConfigGroup, "EqAutoReset"), ConfigValue(m_bEqAutoReset ? 1 : 0)); m_pConfig->set(ConfigKey(kConfigGroup, "GainAutoReset"), @@ -641,6 +664,7 @@ void DlgPrefEQ::slotApply() { void DlgPrefEQ::slotUpdate() { slotUpdateLoEQ(); slotUpdateHiEQ(); + slotUpdateEqButtonMode(eqButtonModebuttonGroup->checkedButton()); slotPopulateDeckEffectSelectors(); CheckBoxEqAutoReset->setChecked(m_bEqAutoReset); CheckBoxGainAutoReset->setChecked(m_bGainAutoReset); diff --git a/src/preferences/dialog/dlgprefeq.h b/src/preferences/dialog/dlgprefeq.h index bc3398263de..41d023ae5ea 100644 --- a/src/preferences/dialog/dlgprefeq.h +++ b/src/preferences/dialog/dlgprefeq.h @@ -36,10 +36,9 @@ class DlgPrefEQ : public DlgPreferencePage, public Ui::DlgPrefEQDlg { void slotSingleEqChecked(int checked); // Slot for toggling between advanced and basic views void slotPopulateDeckEffectSelectors(); - // Update Hi EQ void slotUpdateHiEQ(); - // Update Lo EQ void slotUpdateLoEQ(); + void slotUpdateEqButtonMode(QAbstractButton* selectedButton); void slotUpdateEqAutoReset(int); void slotUpdateGainAutoReset(int); @@ -75,8 +74,10 @@ class DlgPrefEQ : public DlgPreferencePage, public Ui::DlgPrefEQDlg { ControlProxy m_COLoFreq; ControlProxy m_COHiFreq; + ControlProxy m_COButtonMode; UserSettingsPointer m_pConfig; double m_lowEqFreq, m_highEqFreq; + int m_buttonMode; EffectChainPresetManagerPointer m_pChainPresetManager; std::shared_ptr m_pEffectsManager; diff --git a/src/preferences/dialog/dlgprefeqdlg.ui b/src/preferences/dialog/dlgprefeqdlg.ui index 61b37caef7a..bff6606c7ba 100644 --- a/src/preferences/dialog/dlgprefeqdlg.ui +++ b/src/preferences/dialog/dlgprefeqdlg.ui @@ -7,7 +7,7 @@ 0 0 540 - 523 + 668 @@ -19,88 +19,86 @@ Deck Equalizers - - - - - Only allow EQ knobs to control EQ-specific effects - - - true - - - Uncheck to allow any effect to be loaded into the EQ knobs. - - - - - - - Use the same EQ filter for all decks - - - true - - - Uncheck to allow different decks to use different EQ effects. - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - 75 - true - - - - Equalizer Plugin - - - 3 - - - - - - - - 75 - true - - - - 3 - - - Quick Effect - - - - - - - + + + + + Uncheck to allow any effect to be loaded into the EQ knobs. + + + Only allow EQ knobs to control EQ-specific effects + + + true + + + + + + + Uncheck to allow different decks to use different EQ effects. + + + Use the same EQ filter for all decks + + + true + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + true + + + + Equalizer Plugin + + + 3 + + + + + + + + true + + + + Quick Effect + + + 3 + + + + + + + @@ -305,6 +303,39 @@ + + + + EQ Buttons Mode + + + + + + + + Kill + + + eqButtonModebuttonGroup + + + + + + + Bypass + + + eqButtonModebuttonGroup + + + + + + + + @@ -366,38 +397,38 @@ Miscellaneous - - - - - Resets the equalizers to their default values when loading a track. - - - Reset equalizers on track load - - - - - - - Resets the deck gain to unity when loading a track. - - - Reset gain on track load - - - - - - - Bypass EQ effect processing - - - When checked, EQs are not processed, improving performance on slower computers. - - - - + + + + + Resets the equalizers to their default values when loading a track. + + + Reset equalizers on track load + + + + + + + Resets the deck gain to unity when loading a track. + + + Reset gain on track load + + + + + + + When checked, EQs are not processed, improving performance on slower computers. + + + Bypass EQ effect processing + + + + @@ -419,18 +450,17 @@ CheckBoxEqOnly CheckBoxSingleEqEffect - SliderHiEQ SliderLoEQ comboBoxMainEq pbResetMainEq - CheckBoxEqAutoReset CheckBoxGainAutoReset CheckBoxBypass + + + From 8cea73a221d4a996a9e03d11310f07720f811f79 Mon Sep 17 00:00:00 2001 From: Ferran Pujol Camins Date: Fri, 30 Sep 2022 23:38:31 +0200 Subject: [PATCH 03/10] Update waveforms to work well with new eq mode --- .../qtwaveformrendererfilteredsignal.cpp | 6 +- .../waveformrendererfilteredsignal.cpp | 8 +-- .../renderers/waveformrenderersignalbase.cpp | 56 ++++++++----------- .../renderers/waveformrenderersignalbase.h | 7 ++- 4 files changed, 34 insertions(+), 43 deletions(-) diff --git a/src/waveform/renderers/qtwaveformrendererfilteredsignal.cpp b/src/waveform/renderers/qtwaveformrendererfilteredsignal.cpp index 6fc54b48274..a0b708fb9b6 100644 --- a/src/waveform/renderers/qtwaveformrendererfilteredsignal.cpp +++ b/src/waveform/renderers/qtwaveformrendererfilteredsignal.cpp @@ -313,7 +313,7 @@ void QtWaveformRendererFilteredSignal::draw(QPainter* painter, QPaintEvent* /*ev int numberOfPoints = buildPolygon(); - if (m_pLowKillControlObject && m_pLowKillControlObject->get() > 0.1) { + if (m_pLowButtonControlObject && m_pLowButtonControlObject->get() > 0.1) { painter->setPen(QPen(m_lowKilledBrush, 0.0)); painter->setBrush(QColor(150,150,150,20)); } else { @@ -322,7 +322,7 @@ void QtWaveformRendererFilteredSignal::draw(QPainter* painter, QPaintEvent* /*ev } painter->drawPolygon(&m_polygon[0][0], numberOfPoints); - if (m_pMidKillControlObject && m_pMidKillControlObject->get() > 0.1) { + if (m_pMidButtonControlObject && m_pMidButtonControlObject->get() > 0.1) { painter->setPen(QPen(m_midKilledBrush, 0.0)); painter->setBrush(QColor(150,150,150,20)); } else { @@ -331,7 +331,7 @@ void QtWaveformRendererFilteredSignal::draw(QPainter* painter, QPaintEvent* /*ev } painter->drawPolygon(&m_polygon[1][0], numberOfPoints); - if (m_pHighKillControlObject && m_pHighKillControlObject->get() > 0.1) { + if (m_pHighButtonControlObject && m_pHighButtonControlObject->get() > 0.1) { painter->setPen(QPen(m_highKilledBrush, 0.0)); painter->setBrush(QColor(150,150,150,20)); } else { diff --git a/src/waveform/renderers/waveformrendererfilteredsignal.cpp b/src/waveform/renderers/waveformrendererfilteredsignal.cpp index d36b56e289c..e76d295926d 100644 --- a/src/waveform/renderers/waveformrendererfilteredsignal.cpp +++ b/src/waveform/renderers/waveformrendererfilteredsignal.cpp @@ -225,15 +225,15 @@ void WaveformRendererFilteredSignal::draw(QPainter* painter, double lineThickness = math_max(1.0, 1.0 / m_waveformRenderer->getVisualSamplePerPixel()); painter->setPen(QPen(QBrush(m_pColors->getLowColor()), lineThickness, Qt::SolidLine, Qt::FlatCap)); - if (m_pLowKillControlObject && m_pLowKillControlObject->get() == 0.0) { - painter->drawLines(&m_lowLines[0], actualLowLineNumber); + if (m_pLowButtonControlObject && m_pLowButtonControlObject->get() == 0.0) { + painter->drawLines(&m_lowLines[0], actualLowLineNumber); } painter->setPen(QPen(QBrush(m_pColors->getMidColor()), lineThickness, Qt::SolidLine, Qt::FlatCap)); - if (m_pMidKillControlObject && m_pMidKillControlObject->get() == 0.0) { + if (m_pMidButtonControlObject && m_pMidButtonControlObject->get() == 0.0) { painter->drawLines(&m_midLines[0], actualMidLineNumber); } painter->setPen(QPen(QBrush(m_pColors->getHighColor()), lineThickness, Qt::SolidLine, Qt::FlatCap)); - if (m_pHighKillControlObject && m_pHighKillControlObject->get() == 0.0) { + if (m_pHighButtonControlObject && m_pHighButtonControlObject->get() == 0.0) { painter->drawLines(&m_highLines[0], actualHighLineNumber); } } diff --git a/src/waveform/renderers/waveformrenderersignalbase.cpp b/src/waveform/renderers/waveformrenderersignalbase.cpp index dd6838e3faa..c946e2021c8 100644 --- a/src/waveform/renderers/waveformrenderersignalbase.cpp +++ b/src/waveform/renderers/waveformrenderersignalbase.cpp @@ -16,9 +16,10 @@ WaveformRendererSignalBase::WaveformRendererSignalBase( m_pLowFilterControlObject(nullptr), m_pMidFilterControlObject(nullptr), m_pHighFilterControlObject(nullptr), - m_pLowKillControlObject(nullptr), - m_pMidKillControlObject(nullptr), - m_pHighKillControlObject(nullptr), + m_pLowButtonControlObject(nullptr), + m_pMidButtonControlObject(nullptr), + m_pHighButtonControlObject(nullptr), + m_pEQButtonMode(nullptr), m_alignment(Qt::AlignCenter), m_orientation(Qt::Horizontal), m_pColors(nullptr), @@ -54,27 +55,14 @@ WaveformRendererSignalBase::~WaveformRendererSignalBase() { } void WaveformRendererSignalBase::deleteControls() { - if (m_pEQEnabled) { - delete m_pEQEnabled; - } - if (m_pLowFilterControlObject) { - delete m_pLowFilterControlObject; - } - if (m_pMidFilterControlObject) { - delete m_pMidFilterControlObject; - } - if (m_pHighFilterControlObject) { - delete m_pHighFilterControlObject; - } - if (m_pLowKillControlObject) { - delete m_pLowKillControlObject; - } - if (m_pMidKillControlObject) { - delete m_pMidKillControlObject; - } - if (m_pHighKillControlObject) { - delete m_pHighKillControlObject; - } + delete m_pEQEnabled; + delete m_pLowFilterControlObject; + delete m_pMidFilterControlObject; + delete m_pHighFilterControlObject; + delete m_pLowButtonControlObject; + delete m_pMidButtonControlObject; + delete m_pHighButtonControlObject; + delete m_pEQButtonMode; } bool WaveformRendererSignalBase::init() { @@ -89,12 +77,14 @@ bool WaveformRendererSignalBase::init() { m_waveformRenderer->getGroup(), "filterMid"); m_pHighFilterControlObject = new ControlProxy( m_waveformRenderer->getGroup(), "filterHigh"); - m_pLowKillControlObject = new ControlProxy( + m_pLowButtonControlObject = new ControlProxy( m_waveformRenderer->getGroup(), "filterLowKill"); - m_pMidKillControlObject = new ControlProxy( + m_pMidButtonControlObject = new ControlProxy( m_waveformRenderer->getGroup(), "filterMidKill"); - m_pHighKillControlObject = new ControlProxy( + m_pHighButtonControlObject = new ControlProxy( m_waveformRenderer->getGroup(), "filterHighKill"); + m_pEQButtonMode = new ControlProxy( + "[Mixer Profile]", "EQButtonMode"); return onInit(); } @@ -202,16 +192,16 @@ void WaveformRendererSignalBase::getGains(float* pAllGain, float* pLowGain, highGain *= static_cast( factory->getVisualGain(WaveformWidgetFactory::High)); - if (m_pLowKillControlObject && m_pLowKillControlObject->get() > 0.0) { - lowGain = 0; + if (m_pLowButtonControlObject && m_pLowButtonControlObject->get() > 0.0) { + lowGain = m_pEQButtonMode->get(); } - if (m_pMidKillControlObject && m_pMidKillControlObject->get() > 0.0) { - midGain = 0; + if (m_pMidButtonControlObject && m_pMidButtonControlObject->get() > 0.0) { + midGain = m_pEQButtonMode->get(); } - if (m_pHighKillControlObject && m_pHighKillControlObject->get() > 0.0) { - highGain = 0; + if (m_pHighButtonControlObject && m_pHighButtonControlObject->get() > 0.0) { + highGain = m_pEQButtonMode->get(); } } diff --git a/src/waveform/renderers/waveformrenderersignalbase.h b/src/waveform/renderers/waveformrenderersignalbase.h index 0caf0f39811..919da53ddfa 100644 --- a/src/waveform/renderers/waveformrenderersignalbase.h +++ b/src/waveform/renderers/waveformrenderersignalbase.h @@ -29,9 +29,10 @@ class WaveformRendererSignalBase : public WaveformRendererAbstract { ControlProxy* m_pLowFilterControlObject; ControlProxy* m_pMidFilterControlObject; ControlProxy* m_pHighFilterControlObject; - ControlProxy* m_pLowKillControlObject; - ControlProxy* m_pMidKillControlObject; - ControlProxy* m_pHighKillControlObject; + ControlProxy* m_pLowButtonControlObject; + ControlProxy* m_pMidButtonControlObject; + ControlProxy* m_pHighButtonControlObject; + ControlProxy* m_pEQButtonMode; Qt::Alignment m_alignment; Qt::Orientation m_orientation; From 721ee6c40ec5a6ff5f43c96030637fd570b5beab Mon Sep 17 00:00:00 2001 From: Ferran Pujol Camins Date: Fri, 30 Sep 2022 23:43:55 +0200 Subject: [PATCH 04/10] Some renaming --- src/mixer/basetrackplayer.cpp | 6 +++--- .../renderers/waveformrenderersignalbase.cpp | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/mixer/basetrackplayer.cpp b/src/mixer/basetrackplayer.cpp index 509040fd37a..bde99af6f5c 100644 --- a/src/mixer/basetrackplayer.cpp +++ b/src/mixer/basetrackplayer.cpp @@ -712,9 +712,9 @@ void BaseTrackPlayerImpl::setupEqControls() { m_pLowFilter = make_parented(group, "filterLow", this); m_pMidFilter = make_parented(group, "filterMid", this); m_pHighFilter = make_parented(group, "filterHigh", this); - m_pLowFilterKill = make_parented(group, "filterLowKill", this); - m_pMidFilterKill = make_parented(group, "filterMidKill", this); - m_pHighFilterKill = make_parented(group, "filterHighKill", this); + m_pLowFilterKill = make_parented(group, "button_parameter1", this); + m_pMidFilterKill = make_parented(group, "button_parameter2", this); + m_pHighFilterKill = make_parented(group, "button_parameter3", this); } void BaseTrackPlayerImpl::slotVinylControlEnabled(double v) { diff --git a/src/waveform/renderers/waveformrenderersignalbase.cpp b/src/waveform/renderers/waveformrenderersignalbase.cpp index c946e2021c8..1a59bb78a0d 100644 --- a/src/waveform/renderers/waveformrenderersignalbase.cpp +++ b/src/waveform/renderers/waveformrenderersignalbase.cpp @@ -69,20 +69,22 @@ bool WaveformRendererSignalBase::init() { deleteControls(); //create controls + const QString eqGroup = QString("[EqualizerRack1_%1_Effect1]") + .arg(m_waveformRenderer->getGroup()); m_pEQEnabled = new ControlProxy( m_waveformRenderer->getGroup(), "filterWaveformEnable"); m_pLowFilterControlObject = new ControlProxy( - m_waveformRenderer->getGroup(), "filterLow"); + eqGroup, "parameter1"); m_pMidFilterControlObject = new ControlProxy( - m_waveformRenderer->getGroup(), "filterMid"); + eqGroup, "parameter2"); m_pHighFilterControlObject = new ControlProxy( - m_waveformRenderer->getGroup(), "filterHigh"); + eqGroup, "parameter3"); m_pLowButtonControlObject = new ControlProxy( - m_waveformRenderer->getGroup(), "filterLowKill"); + eqGroup, "button_parameter1"); m_pMidButtonControlObject = new ControlProxy( - m_waveformRenderer->getGroup(), "filterMidKill"); + eqGroup, "button_parameter2"); m_pHighButtonControlObject = new ControlProxy( - m_waveformRenderer->getGroup(), "filterHighKill"); + eqGroup, "button_parameter3"); m_pEQButtonMode = new ControlProxy( "[Mixer Profile]", "EQButtonMode"); From bdb46f69d9caeefa6a28a9be64d02cab05a79b54 Mon Sep 17 00:00:00 2001 From: Ferran Pujol Camins Date: Fri, 30 Sep 2022 23:59:30 +0200 Subject: [PATCH 05/10] Fix warning --- src/waveform/renderers/waveformrenderersignalbase.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/waveform/renderers/waveformrenderersignalbase.cpp b/src/waveform/renderers/waveformrenderersignalbase.cpp index 1a59bb78a0d..cf7eb11e744 100644 --- a/src/waveform/renderers/waveformrenderersignalbase.cpp +++ b/src/waveform/renderers/waveformrenderersignalbase.cpp @@ -195,15 +195,15 @@ void WaveformRendererSignalBase::getGains(float* pAllGain, float* pLowGain, factory->getVisualGain(WaveformWidgetFactory::High)); if (m_pLowButtonControlObject && m_pLowButtonControlObject->get() > 0.0) { - lowGain = m_pEQButtonMode->get(); + lowGain = static_cast(m_pEQButtonMode->get()); } if (m_pMidButtonControlObject && m_pMidButtonControlObject->get() > 0.0) { - midGain = m_pEQButtonMode->get(); + midGain = static_cast(m_pEQButtonMode->get()); } if (m_pHighButtonControlObject && m_pHighButtonControlObject->get() > 0.0) { - highGain = m_pEQButtonMode->get(); + highGain = static_cast(m_pEQButtonMode->get()); } } From 9f0bd28b195b3d132ba9610f489f88c0fc291b5d Mon Sep 17 00:00:00 2001 From: Ferran Pujol Camins Date: Sat, 1 Oct 2022 00:32:15 +0200 Subject: [PATCH 06/10] Rename control picker items --- src/controllers/controlpickermenu.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/controllers/controlpickermenu.cpp b/src/controllers/controlpickermenu.cpp index e329ff1d587..39282086163 100644 --- a/src/controllers/controlpickermenu.cpp +++ b/src/controllers/controlpickermenu.cpp @@ -110,9 +110,9 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent) // Since 3-band is by far the most common, stick with that. const int kMaxEqs = 3; QList eqNames; - eqNames.append(tr("Low EQ")); - eqNames.append(tr("Mid EQ")); - eqNames.append(tr("High EQ")); + eqNames.append(tr("EQ Low")); + eqNames.append(tr("EQ Mid")); + eqNames.append(tr("EQ High")); for (int deck = 1; deck <= iNumDecks; ++deck) { QMenu* deckMenu = addSubmenu(QString("Deck %1").arg(deck), eqMenu); for (int effect = kMaxEqs - 1; effect >= 0; --effect) { @@ -131,8 +131,8 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent) control = "button_parameter%1"; addControl(group, control.arg(effect + 1), - tr("Kill %1").arg(eqNames[effect]), - tr("Kill %1").arg(eqNames[effect]), + tr("%1 Button").arg(eqNames[effect]), + tr("%1 Button").arg(eqNames[effect]), bandMenu, false, tr("Deck %1").arg(deck)); From a70982397c96d53002fdfab23ca659d3480bbc9e Mon Sep 17 00:00:00 2001 From: Ferran Pujol Camins Date: Sat, 1 Oct 2022 13:01:10 +0200 Subject: [PATCH 07/10] Fix tests --- src/mixer/basetrackplayer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mixer/basetrackplayer.cpp b/src/mixer/basetrackplayer.cpp index bde99af6f5c..fe32bbcb9c4 100644 --- a/src/mixer/basetrackplayer.cpp +++ b/src/mixer/basetrackplayer.cpp @@ -708,10 +708,11 @@ EngineDeck* BaseTrackPlayerImpl::getEngineDeck() const { } void BaseTrackPlayerImpl::setupEqControls() { - const QString group = getGroup(); - m_pLowFilter = make_parented(group, "filterLow", this); - m_pMidFilter = make_parented(group, "filterMid", this); - m_pHighFilter = make_parented(group, "filterHigh", this); + const QString group = QString("[EqualizerRack1_%1_Effect1]").arg(getGroup()); + + m_pLowFilter = make_parented(group, "parameter1", this); + m_pMidFilter = make_parented(group, "parameter2", this); + m_pHighFilter = make_parented(group, "parameter3", this); m_pLowFilterKill = make_parented(group, "button_parameter1", this); m_pMidFilterKill = make_parented(group, "button_parameter2", this); m_pHighFilterKill = make_parented(group, "button_parameter3", this); From ee31905cee6824d63564175c88fa1aa1217d30bb Mon Sep 17 00:00:00 2001 From: Ferran Pujol Camins Date: Mon, 3 Oct 2022 21:39:33 +0200 Subject: [PATCH 08/10] Remove unused file --- src/widget/weffectparameterbase.cpp | 40 ----------------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/widget/weffectparameterbase.cpp diff --git a/src/widget/weffectparameterbase.cpp b/src/widget/weffectparameterbase.cpp deleted file mode 100644 index 941e1e4dccd..00000000000 --- a/src/widget/weffectparameterbase.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "widget/weffectparameterbase.h" - -#include - -#include "effects/effectsmanager.h" -#include "moc_weffectparameterbase.cpp" - -WEffectParameterBase::WEffectParameterBase(QWidget* pParent, EffectsManager* pEffectsManager) - : WLabel(pParent), - m_pEffectsManager(pEffectsManager) { - parameterUpdated(); -} - -void WEffectParameterBase::setEffectParameterSlot( - EffectParameterSlotBasePointer pEffectParameterSlot) { - m_pEffectParameterSlot = pEffectParameterSlot; - if (m_pEffectParameterSlot) { - connect(m_pEffectParameterSlot.data(), - &EffectParameterSlotBase::updated, - this, - &WEffectParameterBase::parameterUpdated); - } - parameterUpdated(); -} - -void WEffectParameterBase::parameterUpdated() { - if (m_pEffectParameterSlot) { - if (!m_pEffectParameterSlot->shortName().isEmpty()) { - setText(m_pEffectParameterSlot->shortName()); - } else { - setText(m_pEffectParameterSlot->name()); - } - setBaseTooltip(QString("%1\n%2").arg( - m_pEffectParameterSlot->name(), - m_pEffectParameterSlot->description())); - } else { - setText(EffectsManager::kNoEffectString); - setBaseTooltip(kNoEffectString); - } -} From ccef417808b0f5b3e610f3bde3b23b34b2f18756 Mon Sep 17 00:00:00 2001 From: Ferran Pujol Camins Date: Mon, 3 Oct 2022 23:11:44 +0200 Subject: [PATCH 09/10] Update eq button tooltips when mode changes --- CMakeLists.txt | 1 + .../Deere/equalizer_rack_parameter_left.xml | 4 ++-- .../Deere/equalizer_rack_parameter_right.xml | 4 ++-- res/skins/LateNight/mixer/eq_knob_4decks.xml | 4 ++-- res/skins/LateNight/mixer/eq_knob_left.xml | 4 ++-- res/skins/LateNight/mixer/eq_knob_right.xml | 4 ++-- res/skins/Shade/mixer_panel.xml | 24 +++++++++---------- res/skins/Tango/mixer/eq_button.xml | 4 ++-- src/effects/backends/builtin/equalizer_util.h | 21 +++++++++++++--- .../backends/effectmanifestparameter.h | 14 +++++++---- src/skin/legacy/legacyskinparser.cpp | 14 +++++++++++ src/skin/legacy/legacyskinparser.h | 1 + src/widget/weffectpushbutton.h | 2 +- src/widget/wequalizerpushbutton.cpp | 13 ++++++++++ src/widget/wequalizerpushbutton.h | 17 +++++++++++++ 15 files changed, 99 insertions(+), 32 deletions(-) create mode 100644 src/widget/wequalizerpushbutton.cpp create mode 100644 src/widget/wequalizerpushbutton.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 42f81a39621..de53ed83239 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1021,6 +1021,7 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL src/widget/weffectparameterknobcomposed.cpp src/widget/weffectparameternamebase.cpp src/widget/weffectpushbutton.cpp + src/widget/wequalizerpushbutton.cpp src/widget/weffectselector.cpp src/widget/wfindonwebmenu.cpp src/widget/whotcuebutton.cpp diff --git a/res/skins/Deere/equalizer_rack_parameter_left.xml b/res/skins/Deere/equalizer_rack_parameter_left.xml index ad2df1b208e..1a0e10bc4b5 100644 --- a/res/skins/Deere/equalizer_rack_parameter_left.xml +++ b/res/skins/Deere/equalizer_rack_parameter_left.xml @@ -19,7 +19,7 @@ me,me - + EqualizerRack_effect_button_parameter 15f,20f EQKillButton @@ -41,7 +41,7 @@ [Skin],show_eq_kill_buttons visible - + 0me,1min diff --git a/res/skins/Deere/equalizer_rack_parameter_right.xml b/res/skins/Deere/equalizer_rack_parameter_right.xml index 2e33904572b..819d20739c6 100644 --- a/res/skins/Deere/equalizer_rack_parameter_right.xml +++ b/res/skins/Deere/equalizer_rack_parameter_right.xml @@ -42,7 +42,7 @@ - + EqualizerRack_effect_button_parameter 15f,20f EQKillButton @@ -64,7 +64,7 @@ [Skin],show_eq_kill_buttons visible - + 0me,1min diff --git a/res/skins/LateNight/mixer/eq_knob_4decks.xml b/res/skins/LateNight/mixer/eq_knob_4decks.xml index e048da3acf4..404d88df71a 100644 --- a/res/skins/LateNight/mixer/eq_knob_4decks.xml +++ b/res/skins/LateNight/mixer/eq_knob_4decks.xml @@ -27,7 +27,7 @@ 0min,5f - + filterKill EQKillButton_ 18f,18f @@ -53,7 +53,7 @@ [Skin],show_eq_kill_buttons visible - + diff --git a/res/skins/LateNight/mixer/eq_knob_left.xml b/res/skins/LateNight/mixer/eq_knob_left.xml index 551f9788f41..0740a44f4bd 100644 --- a/res/skins/LateNight/mixer/eq_knob_left.xml +++ b/res/skins/LateNight/mixer/eq_knob_left.xml @@ -18,7 +18,7 @@ 18f,34f 0min,5f - + filterKill EQKillButton_ 18f,18f @@ -40,7 +40,7 @@ ,button_parameter LeftButton - + [Skin],show_eq_kill_buttons diff --git a/res/skins/LateNight/mixer/eq_knob_right.xml b/res/skins/LateNight/mixer/eq_knob_right.xml index cb2ed24d228..9f530a47a62 100644 --- a/res/skins/LateNight/mixer/eq_knob_right.xml +++ b/res/skins/LateNight/mixer/eq_knob_right.xml @@ -68,7 +68,7 @@ 0min,5f - + filterKill EQKillButton_ 18f,18f @@ -90,7 +90,7 @@ ,button_parameter LeftButton - + diff --git a/res/skins/Shade/mixer_panel.xml b/res/skins/Shade/mixer_panel.xml index 91855abdec2..186382e59f0 100644 --- a/res/skins/Shade/mixer_panel.xml +++ b/res/skins/Shade/mixer_panel.xml @@ -322,7 +322,7 @@ Button- Frequency Kill ********************************************** --> - + [EqualizerRack1_[Channel1]] 1 3 @@ -347,8 +347,8 @@ [EqualizerRack1_[Channel1]_Effect1],button_parameter3_loaded visible - - + + [EqualizerRack1_[Channel1]] 1 2 @@ -373,8 +373,8 @@ [EqualizerRack1_[Channel1]_Effect1],button_parameter2_loaded visible - - + + [EqualizerRack1_[Channel1]] 1 1 @@ -399,9 +399,9 @@ [EqualizerRack1_[Channel1]_Effect1],button_parameter1_loaded visible - + - + [EqualizerRack1_[Channel1]] 1 3 @@ -426,8 +426,8 @@ [EqualizerRack1_[Channel2]_Effect1],button_parameter3_loaded visible - - + + [EqualizerRack1_[Channel1]] 1 2 @@ -452,8 +452,8 @@ [EqualizerRack1_[Channel2]_Effect1],button_parameter2_loaded visible - - + + [EqualizerRack1_[Channel1]] 1 1 @@ -478,7 +478,7 @@ [EqualizerRack1_[Channel2]_Effect1],button_parameter1_loaded visible - + Battery diff --git a/res/skins/Tango/mixer/eq_button.xml b/res/skins/Tango/mixer/eq_button.xml index 68d1d5f368b..50fa67c1ee9 100644 --- a/res/skins/Tango/mixer/eq_button.xml +++ b/res/skins/Tango/mixer/eq_button.xml @@ -14,7 +14,7 @@ Variables: [QuickEffectRack1_[ChannelA]_EffectY] --> diff --git a/src/effects/backends/builtin/equalizer_util.h b/src/effects/backends/builtin/equalizer_util.h index fe4d252ebf3..5b4b309164d 100644 --- a/src/effects/backends/builtin/equalizer_util.h +++ b/src/effects/backends/builtin/equalizer_util.h @@ -2,6 +2,7 @@ #include +#include "control/pollingcontrolproxy.h" #include "effects/backends/effectmanifest.h" class EqualizerUtil { @@ -16,6 +17,8 @@ class EqualizerUtil { maximum = 2.0; } + PollingControlProxy eqButtonMode(ConfigKey("[Mixer Profile]", "EQButtonMode")); + EffectManifestParameterPointer low = pManifest->addParameter(); low->setId("low"); low->setName(QObject::tr("Low")); @@ -28,7 +31,11 @@ class EqualizerUtil { EffectManifestParameterPointer killLow = pManifest->addParameter(); killLow->setId("killLow"); killLow->setName(QObject::tr("Kill Low")); - killLow->setDescription(QObject::tr("Kill the Low Filter")); + killLow->setDescription([eqButtonMode]() { + return eqButtonMode.get() == 0 + ? QObject::tr("Kill the Low Filter") + : QObject::tr("Bypass the Low Filter"); + }); killLow->setValueScaler(EffectManifestParameter::ValueScaler::Toggle); killLow->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown); killLow->setRange(0, 0, 1); @@ -45,7 +52,11 @@ class EqualizerUtil { EffectManifestParameterPointer killMid = pManifest->addParameter(); killMid->setId("killMid"); killMid->setName(QObject::tr("Kill Mid")); - killMid->setDescription(QObject::tr("Kill the Mid Filter")); + killLow->setDescription([eqButtonMode]() { + return eqButtonMode.get() == 0 + ? QObject::tr("Kill the Mid Filter") + : QObject::tr("Bypass the Mid Filter"); + }); killMid->setValueScaler(EffectManifestParameter::ValueScaler::Toggle); killMid->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown); killMid->setRange(0, 0, 1); @@ -62,7 +73,11 @@ class EqualizerUtil { EffectManifestParameterPointer killHigh = pManifest->addParameter(); killHigh->setId("killHigh"); killHigh->setName(QObject::tr("Kill High")); - killHigh->setDescription(QObject::tr("Kill the High Filter")); + killLow->setDescription([eqButtonMode]() { + return eqButtonMode.get() == 0 + ? QObject::tr("Kill the High Filter") + : QObject::tr("Bypass the High Filter"); + }); killHigh->setValueScaler(EffectManifestParameter::ValueScaler::Toggle); killHigh->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown); killHigh->setRange(0, 0, 1); diff --git a/src/effects/backends/effectmanifestparameter.h b/src/effects/backends/effectmanifestparameter.h index ed711957f9e..5e533fdebc6 100644 --- a/src/effects/backends/effectmanifestparameter.h +++ b/src/effects/backends/effectmanifestparameter.h @@ -131,11 +131,17 @@ class EffectManifestParameter { m_shortName = shortName; } - const QString& description() const { - return m_description; + QString description() const { + return m_description(); } + void setDescription(const QString& description) { - m_description = description; + m_description = [description]() { return description; }; + } + + template + void setDescription(F description) { + m_description = std::function(description); } int index() const { @@ -252,7 +258,7 @@ class EffectManifestParameter { QString m_id; QString m_name; QString m_shortName; - QString m_description; + std::function m_description = []() { return QString(); }; int m_iIndex; ParameterType m_parameterType; diff --git a/src/skin/legacy/legacyskinparser.cpp b/src/skin/legacy/legacyskinparser.cpp index cef36e7b912..66cd70ce443 100644 --- a/src/skin/legacy/legacyskinparser.cpp +++ b/src/skin/legacy/legacyskinparser.cpp @@ -28,6 +28,7 @@ #include "util/timer.h" #include "util/valuetransformer.h" #include "util/xml.h" +#include "widget/wequalizerpushbutton.h" #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include "waveform/vsyncthread.h" #endif @@ -516,6 +517,8 @@ QList LegacySkinParser::parseNode(const QDomElement& node) { result = wrapWidget(parseStandardWidget(node)); } else if (nodeName == "EffectPushButton") { result = wrapWidget(parseEffectPushButton(node)); + } else if (nodeName == "EqualizerPushButton") { + result = wrapWidget(parseEqualizerPushButton(node)); } else if (nodeName == "HotcueButton") { result = wrapWidget(parseHotcueButton(node)); } else if (nodeName == "ComboBox") { @@ -1772,6 +1775,17 @@ QWidget* LegacySkinParser::parseEffectPushButton(const QDomElement& element) { return pWidget; } +QWidget* LegacySkinParser::parseEqualizerPushButton(const QDomElement& element) { + WEffectPushButton* pWidget = new WEqualizerPushButton(m_pParent, m_pEffectsManager); + commonWidgetSetup(element, pWidget); + pWidget->setup(element, *m_pContext); + pWidget->installEventFilter(m_pKeyboard); + pWidget->installEventFilter( + m_pControllerManager->getControllerLearningEventFilter()); + pWidget->Init(); + return pWidget; +} + QWidget* LegacySkinParser::parseEffectParameterName(const QDomElement& node) { WEffectParameterNameBase* pEffectParameter = new WEffectKnobParameterName(m_pParent, m_pEffectsManager); diff --git a/src/skin/legacy/legacyskinparser.h b/src/skin/legacy/legacyskinparser.h index 1a5d06b5727..1cbb6beac84 100644 --- a/src/skin/legacy/legacyskinparser.h +++ b/src/skin/legacy/legacyskinparser.h @@ -92,6 +92,7 @@ class LegacySkinParser : public QObject, public SkinParser { QWidget* parseEffectParameterKnobComposed(const QDomElement& node); QWidget* parseEffectButtonParameterName(const QDomElement& node); QWidget* parseEffectPushButton(const QDomElement& node); + QWidget* parseEqualizerPushButton(const QDomElement& node); QWidget* parseEffectSelector(const QDomElement& node); QWidget* parseHotcueButton(const QDomElement& node); diff --git a/src/widget/weffectpushbutton.h b/src/widget/weffectpushbutton.h index adb514affe6..2e1b65bb56b 100644 --- a/src/widget/weffectpushbutton.h +++ b/src/widget/weffectpushbutton.h @@ -25,7 +25,7 @@ class WEffectPushButton : public WPushButton { void mousePressEvent(QMouseEvent* e) override; void mouseReleaseEvent(QMouseEvent* e) override; - private slots: + protected slots: void parameterUpdated(); void slotActionChosen(QAction* action); diff --git a/src/widget/wequalizerpushbutton.cpp b/src/widget/wequalizerpushbutton.cpp new file mode 100644 index 00000000000..0eda5bad3bd --- /dev/null +++ b/src/widget/wequalizerpushbutton.cpp @@ -0,0 +1,13 @@ +#include "wequalizerpushbutton.h" + +#include "control/controlproxy.h" + +WEqualizerPushButton::WEqualizerPushButton(QWidget* pParent, EffectsManager* pEffectsManager) + : WEffectPushButton(pParent, pEffectsManager), + m_eqButtonMode(ConfigKey("[Mixer Profile]", "EQButtonMode")) { +} + +void WEqualizerPushButton::setup(const QDomNode& node, const SkinContext& context) { + WEffectPushButton::setup(node, context); + m_eqButtonMode.connectValueChanged(this, &WEqualizerPushButton::parameterUpdated); +} diff --git a/src/widget/wequalizerpushbutton.h b/src/widget/wequalizerpushbutton.h new file mode 100644 index 00000000000..e1d9dff5e3d --- /dev/null +++ b/src/widget/wequalizerpushbutton.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +#include "widget/weffectpushbutton.h" + +// A specialization of WEffectPushButton that updates itself when the EQ Button Mode settings changes. +// This is needed to update the tooltips of the button with information on the new mode. +class WEqualizerPushButton : public WEffectPushButton { + public: + WEqualizerPushButton(QWidget* pParent, EffectsManager* pEffectsManager); + + void setup(const QDomNode& node, const SkinContext& context) override; + + private: + ControlProxy m_eqButtonMode; +}; From f82eeba4250d0004ea1151ac67d88d919f14f9b3 Mon Sep 17 00:00:00 2001 From: Ferran Pujol Camins Date: Thu, 13 Oct 2022 00:34:32 +0200 Subject: [PATCH 10/10] Expose both kill and bypass as eq effect params --- src/controllers/controlpickermenu.cpp | 4 +- .../backends/builtin/bessel4lvmixeqeffect.cpp | 28 ++++--- .../backends/builtin/bessel4lvmixeqeffect.h | 5 +- .../backends/builtin/bessel8lvmixeqeffect.cpp | 28 ++++--- .../backends/builtin/bessel8lvmixeqeffect.h | 5 +- .../builtin/biquadfullkilleqeffect.cpp | 53 +++++------- .../backends/builtin/biquadfullkilleqeffect.h | 5 +- src/effects/backends/builtin/equalizer_util.h | 50 ++++++++--- .../builtin/linkwitzriley8eqeffect.cpp | 33 ++++++-- .../backends/builtin/linkwitzriley8eqeffect.h | 5 +- .../builtin/threebandbiquadeqeffect.cpp | 28 +++---- .../builtin/threebandbiquadeqeffect.h | 5 +- src/effects/chains/equalizereffectchain.cpp | 84 ++++++++++++++++--- src/effects/chains/equalizereffectchain.h | 13 ++- src/mixer/basetrackplayer.cpp | 15 ++-- .../qtwaveformrendererfilteredsignal.cpp | 6 +- .../waveformrendererfilteredsignal.cpp | 6 +- .../renderers/waveformrenderersignalbase.cpp | 54 +++++++----- .../renderers/waveformrenderersignalbase.h | 10 ++- 19 files changed, 290 insertions(+), 147 deletions(-) diff --git a/src/controllers/controlpickermenu.cpp b/src/controllers/controlpickermenu.cpp index 39282086163..069207acf1e 100644 --- a/src/controllers/controlpickermenu.cpp +++ b/src/controllers/controlpickermenu.cpp @@ -131,8 +131,8 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent) control = "button_parameter%1"; addControl(group, control.arg(effect + 1), - tr("%1 Button").arg(eqNames[effect]), - tr("%1 Button").arg(eqNames[effect]), + tr("Kill %1").arg(eqNames[effect]), + tr("Kill %1").arg(eqNames[effect]), bandMenu, false, tr("Deck %1").arg(deck)); diff --git a/src/effects/backends/builtin/bessel4lvmixeqeffect.cpp b/src/effects/backends/builtin/bessel4lvmixeqeffect.cpp index 82ea3ae2c78..e977e802763 100644 --- a/src/effects/backends/builtin/bessel4lvmixeqeffect.cpp +++ b/src/effects/backends/builtin/bessel4lvmixeqeffect.cpp @@ -31,7 +31,6 @@ EffectManifestPointer Bessel4LVMixEQEffect::getManifest() { Bessel4LVMixEQEffect::Bessel4LVMixEQEffect() { m_pLoFreqCorner = std::make_unique("[Mixer Profile]", "LoEQFrequency"); m_pHiFreqCorner = std::make_unique("[Mixer Profile]", "HiEQFrequency"); - m_pEQButtonMode = std::make_unique("[Mixer Profile]", "EQButtonMode"); } void Bessel4LVMixEQEffect::loadEngineEffectParameters( @@ -42,6 +41,9 @@ void Bessel4LVMixEQEffect::loadEngineEffectParameters( m_pKillLow = parameters.value("killLow"); m_pKillMid = parameters.value("killMid"); m_pKillHigh = parameters.value("killHigh"); + m_pBypassLow = parameters.value("bypassLow"); + m_pBypassMid = parameters.value("bypassMid"); + m_pBypassHigh = parameters.value("bypassHigh"); } void Bessel4LVMixEQEffect::processChannel( @@ -60,20 +62,26 @@ void Bessel4LVMixEQEffect::processChannel( double fLow; double fMid; double fHigh; - if (!m_pKillLow->toBool()) { - fLow = m_pPotLow->value(); + if (m_pBypassLow->toBool()) { + fLow = 1; + } else if (m_pKillLow->toBool()) { + fLow = 0; } else { - fLow = m_pEQButtonMode->get() == 0 ? 0 : 1; + fLow = m_pPotLow->value(); } - if (!m_pKillMid->toBool()) { - fMid = m_pPotMid->value(); + if (m_pBypassMid->toBool()) { + fMid = 1; + } else if (m_pKillMid->toBool()) { + fMid = 0; } else { - fMid = m_pEQButtonMode->get() == 0 ? 0 : 1; + fMid = m_pPotMid->value(); } - if (!m_pKillHigh->toBool()) { - fHigh = m_pPotHigh->value(); + if (m_pBypassHigh->toBool()) { + fHigh = 1; + } else if (m_pKillHigh->toBool()) { + fHigh = 0; } else { - fHigh = m_pEQButtonMode->get() == 0 ? 0 : 1; + fHigh = m_pPotHigh->value(); } pState->processChannel(pInput, pOutput, diff --git a/src/effects/backends/builtin/bessel4lvmixeqeffect.h b/src/effects/backends/builtin/bessel4lvmixeqeffect.h index 97b22e06c72..4c0226820b5 100644 --- a/src/effects/backends/builtin/bessel4lvmixeqeffect.h +++ b/src/effects/backends/builtin/bessel4lvmixeqeffect.h @@ -50,9 +50,12 @@ class Bessel4LVMixEQEffect : public EffectProcessorImpl m_pLoFreqCorner; std::unique_ptr m_pHiFreqCorner; - std::unique_ptr m_pEQButtonMode; DISALLOW_COPY_AND_ASSIGN(Bessel4LVMixEQEffect); }; diff --git a/src/effects/backends/builtin/bessel8lvmixeqeffect.cpp b/src/effects/backends/builtin/bessel8lvmixeqeffect.cpp index ea61c9b79a6..0b57faf5d8d 100644 --- a/src/effects/backends/builtin/bessel8lvmixeqeffect.cpp +++ b/src/effects/backends/builtin/bessel8lvmixeqeffect.cpp @@ -31,7 +31,6 @@ EffectManifestPointer Bessel8LVMixEQEffect::getManifest() { Bessel8LVMixEQEffect::Bessel8LVMixEQEffect() { m_pLoFreqCorner = std::make_unique("[Mixer Profile]", "LoEQFrequency"); m_pHiFreqCorner = std::make_unique("[Mixer Profile]", "HiEQFrequency"); - m_pEQButtonMode = std::make_unique("[Mixer Profile]", "EQButtonMode"); } void Bessel8LVMixEQEffect::loadEngineEffectParameters( @@ -42,6 +41,9 @@ void Bessel8LVMixEQEffect::loadEngineEffectParameters( m_pKillLow = parameters.value("killLow"); m_pKillMid = parameters.value("killMid"); m_pKillHigh = parameters.value("killHigh"); + m_pBypassLow = parameters.value("bypassLow"); + m_pBypassMid = parameters.value("bypassMid"); + m_pBypassHigh = parameters.value("bypassHigh"); } void Bessel8LVMixEQEffect::processChannel( @@ -60,20 +62,26 @@ void Bessel8LVMixEQEffect::processChannel( double fLow; double fMid; double fHigh; - if (!m_pKillLow->toBool()) { - fLow = m_pPotLow->value(); + if (m_pBypassLow->toBool()) { + fLow = 1; + } else if (m_pKillLow->toBool()) { + fLow = 0; } else { - fLow = m_pEQButtonMode->get() == 0 ? 0 : 1; + fLow = m_pPotLow->value(); } - if (!m_pKillMid->toBool()) { - fMid = m_pPotMid->value(); + if (m_pBypassMid->toBool()) { + fMid = 1; + } else if (m_pKillMid->toBool()) { + fMid = 0; } else { - fMid = m_pEQButtonMode->get() == 0 ? 0 : 1; + fMid = m_pPotMid->value(); } - if (!m_pKillHigh->toBool()) { - fHigh = m_pPotHigh->value(); + if (m_pBypassHigh->toBool()) { + fHigh = 1; + } else if (m_pKillHigh->toBool()) { + fHigh = 0; } else { - fHigh = m_pEQButtonMode->get() == 0 ? 0 : 1; + fHigh = m_pPotHigh->value(); } pState->processChannel(pInput, pOutput, diff --git a/src/effects/backends/builtin/bessel8lvmixeqeffect.h b/src/effects/backends/builtin/bessel8lvmixeqeffect.h index 88b9388431b..50209d42cb1 100644 --- a/src/effects/backends/builtin/bessel8lvmixeqeffect.h +++ b/src/effects/backends/builtin/bessel8lvmixeqeffect.h @@ -52,9 +52,12 @@ class Bessel8LVMixEQEffect : public EffectProcessorImpl m_pLoFreqCorner; std::unique_ptr m_pHiFreqCorner; - std::unique_ptr m_pEQButtonMode; DISALLOW_COPY_AND_ASSIGN(Bessel8LVMixEQEffect); }; diff --git a/src/effects/backends/builtin/biquadfullkilleqeffect.cpp b/src/effects/backends/builtin/biquadfullkilleqeffect.cpp index 6a23627d966..2ddda7190ca 100644 --- a/src/effects/backends/builtin/biquadfullkilleqeffect.cpp +++ b/src/effects/backends/builtin/biquadfullkilleqeffect.cpp @@ -145,7 +145,6 @@ void BiquadFullKillEQEffectGroupState::setFilters( BiquadFullKillEQEffect::BiquadFullKillEQEffect() { m_pLoFreqCorner = std::make_unique("[Mixer Profile]", "LoEQFrequency"); m_pHiFreqCorner = std::make_unique("[Mixer Profile]", "HiEQFrequency"); - m_pEQButtonMode = std::make_unique("[Mixer Profile]", "EQButtonMode"); } void BiquadFullKillEQEffect::loadEngineEffectParameters( @@ -156,6 +155,9 @@ void BiquadFullKillEQEffect::loadEngineEffectParameters( m_pKillLow = parameters.value("killLow"); m_pKillMid = parameters.value("killMid"); m_pKillHigh = parameters.value("killHigh"); + m_pBypassLow = parameters.value("bypassLow"); + m_pBypassMid = parameters.value("bypassMid"); + m_pBypassHigh = parameters.value("bypassHigh"); } void BiquadFullKillEQEffect::processChannel( @@ -183,21 +185,15 @@ void BiquadFullKillEQEffect::processChannel( double bqGainMid = 0; double bqGainHigh = 0; if (enableState != EffectEnableState::Disabling) { - if (m_pEQButtonMode->get() == 0) { - bqGainLow = knobValueToBiquadGainDb( - m_pPotLow->value(), m_pKillLow->toBool()); - bqGainMid = knobValueToBiquadGainDb( - m_pPotMid->value(), m_pKillMid->toBool()); - bqGainHigh = knobValueToBiquadGainDb( - m_pPotHigh->value(), m_pKillHigh->toBool()); - } else { - bqGainLow = knobValueToBiquadGainDb( - m_pKillLow->toBool() ? 1 : m_pPotLow->value(), false); - bqGainMid = knobValueToBiquadGainDb( - m_pKillMid->toBool() ? 1 : m_pPotMid->value(), false); - bqGainHigh = knobValueToBiquadGainDb( - m_pKillHigh->toBool() ? 1 : m_pPotHigh->value(), false); - } + bqGainLow = knobValueToBiquadGainDb( + m_pBypassLow->toBool() ? 1 : m_pPotLow->value(), + m_pKillLow->toBool() && !m_pBypassLow->toBool()); + bqGainMid = knobValueToBiquadGainDb( + m_pBypassMid->toBool() ? 1 : m_pPotMid->value(), + m_pKillMid->toBool() && !m_pBypassMid->toBool()); + bqGainHigh = knobValueToBiquadGainDb( + m_pBypassHigh->toBool() ? 1 : m_pPotHigh->value(), + m_pKillHigh->toBool() && !m_pBypassHigh->toBool()); } int activeFilters = 0; @@ -401,22 +397,15 @@ void BiquadFullKillEQEffect::processChannel( pState->m_lvMixIso->processChannelAndPause( pOutput, pOutput, engineParameters.samplesPerBuffer()); } else { - double fLow, fMid, fHigh; - if (m_pEQButtonMode->get() == 0) { - fLow = knobValueToBesselRatio( - m_pPotLow->value(), m_pKillLow->toBool()); - fMid = knobValueToBesselRatio( - m_pPotMid->value(), m_pKillMid->toBool()); - fHigh = knobValueToBesselRatio( - m_pPotHigh->value(), m_pKillHigh->toBool()); - } else { - fLow = knobValueToBesselRatio( - m_pKillLow->toBool() ? 1 : m_pPotLow->value(), false); - fMid = knobValueToBesselRatio( - m_pKillMid->toBool() ? 1 : m_pPotMid->value(), false); - fHigh = knobValueToBesselRatio( - m_pKillHigh->toBool() ? 1 : m_pPotHigh->value(), false); - } + double fLow = knobValueToBesselRatio( + m_pBypassLow->toBool() ? 1 : m_pPotLow->value(), + m_pKillLow->toBool() && !m_pBypassLow->toBool()); + double fMid = knobValueToBesselRatio( + m_pBypassMid->toBool() ? 1 : m_pPotMid->value(), + m_pKillMid->toBool() && !m_pBypassMid->toBool()); + double fHigh = knobValueToBesselRatio( + m_pBypassHigh->toBool() ? 1 : m_pPotHigh->value(), + m_pKillHigh->toBool() && !m_pBypassHigh->toBool()); pState->m_lvMixIso->processChannel(pOutput, pOutput, diff --git a/src/effects/backends/builtin/biquadfullkilleqeffect.h b/src/effects/backends/builtin/biquadfullkilleqeffect.h index 30344e34d56..cfdada00aa1 100644 --- a/src/effects/backends/builtin/biquadfullkilleqeffect.h +++ b/src/effects/backends/builtin/biquadfullkilleqeffect.h @@ -94,7 +94,10 @@ class BiquadFullKillEQEffect : public EffectProcessorImpl m_pLoFreqCorner; std::unique_ptr m_pHiFreqCorner; - std::unique_ptr m_pEQButtonMode; }; diff --git a/src/effects/backends/builtin/equalizer_util.h b/src/effects/backends/builtin/equalizer_util.h index 5b4b309164d..b7c4839f60c 100644 --- a/src/effects/backends/builtin/equalizer_util.h +++ b/src/effects/backends/builtin/equalizer_util.h @@ -32,14 +32,23 @@ class EqualizerUtil { killLow->setId("killLow"); killLow->setName(QObject::tr("Kill Low")); killLow->setDescription([eqButtonMode]() { - return eqButtonMode.get() == 0 - ? QObject::tr("Kill the Low Filter") - : QObject::tr("Bypass the Low Filter"); + return QObject::tr("Kill the Low Filter"); }); killLow->setValueScaler(EffectManifestParameter::ValueScaler::Toggle); killLow->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown); killLow->setRange(0, 0, 1); + EffectManifestParameterPointer bypassLow = pManifest->addParameter(); + bypassLow->setId("bypassLow"); + bypassLow->setName(QObject::tr("Bypass Low")); + bypassLow->setShortName(QObject::tr("Byp. Low")); + bypassLow->setDescription([eqButtonMode]() { + return QObject::tr("Bypass the Low Filter"); + }); + bypassLow->setValueScaler(EffectManifestParameter::ValueScaler::Toggle); + bypassLow->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown); + bypassLow->setRange(0, 0, 1); + EffectManifestParameterPointer mid = pManifest->addParameter(); mid->setId("mid"); mid->setName(QObject::tr("Mid")); @@ -52,15 +61,24 @@ class EqualizerUtil { EffectManifestParameterPointer killMid = pManifest->addParameter(); killMid->setId("killMid"); killMid->setName(QObject::tr("Kill Mid")); - killLow->setDescription([eqButtonMode]() { - return eqButtonMode.get() == 0 - ? QObject::tr("Kill the Mid Filter") - : QObject::tr("Bypass the Mid Filter"); + killMid->setDescription([eqButtonMode]() { + return QObject::tr("Kill the Mid Filter"); }); killMid->setValueScaler(EffectManifestParameter::ValueScaler::Toggle); killMid->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown); killMid->setRange(0, 0, 1); + EffectManifestParameterPointer bypassMid = pManifest->addParameter(); + bypassMid->setId("bypassMid"); + bypassMid->setName(QObject::tr("Bypass Mid")); + bypassMid->setShortName(QObject::tr("Byp. Mid")); + bypassMid->setDescription([eqButtonMode]() { + return QObject::tr("Bypass the Mid Filter"); + }); + bypassMid->setValueScaler(EffectManifestParameter::ValueScaler::Toggle); + bypassMid->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown); + bypassMid->setRange(0, 0, 1); + EffectManifestParameterPointer high = pManifest->addParameter(); high->setId("high"); high->setName(QObject::tr("High")); @@ -73,14 +91,24 @@ class EqualizerUtil { EffectManifestParameterPointer killHigh = pManifest->addParameter(); killHigh->setId("killHigh"); killHigh->setName(QObject::tr("Kill High")); - killLow->setDescription([eqButtonMode]() { - return eqButtonMode.get() == 0 - ? QObject::tr("Kill the High Filter") - : QObject::tr("Bypass the High Filter"); + killHigh->setDescription([eqButtonMode]() { + return QObject::tr("Kill the High Filter"); }); killHigh->setValueScaler(EffectManifestParameter::ValueScaler::Toggle); killHigh->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown); killHigh->setRange(0, 0, 1); + + EffectManifestParameterPointer bypassHigh = pManifest->addParameter(); + bypassHigh->setId("bypassHigh"); + bypassHigh->setName(QObject::tr("Bypass High")); + bypassHigh->setShortName(QObject::tr("Byp. Hi.")); + bypassHigh->setDescription([eqButtonMode]() { + // TODO: do we need a closure here still? + return QObject::tr("Bypass the High Filter"); + }); + bypassHigh->setValueScaler(EffectManifestParameter::ValueScaler::Toggle); + bypassHigh->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown); + bypassHigh->setRange(0, 0, 1); } static QString adjustFrequencyShelvesTip() { diff --git a/src/effects/backends/builtin/linkwitzriley8eqeffect.cpp b/src/effects/backends/builtin/linkwitzriley8eqeffect.cpp index eef096ce0ea..0753aab68c3 100644 --- a/src/effects/backends/builtin/linkwitzriley8eqeffect.cpp +++ b/src/effects/backends/builtin/linkwitzriley8eqeffect.cpp @@ -70,7 +70,6 @@ void LinkwitzRiley8EQEffectGroupState::setFilters(int sampleRate, int lowFreq, i LinkwitzRiley8EQEffect::LinkwitzRiley8EQEffect() { m_pLoFreqCorner = std::make_unique("[Mixer Profile]", "LoEQFrequency"); m_pHiFreqCorner = std::make_unique("[Mixer Profile]", "HiEQFrequency"); - m_pEQButtonMode = std::make_unique("[Mixer Profile]", "EQButtonMode"); } void LinkwitzRiley8EQEffect::loadEngineEffectParameters( @@ -81,6 +80,9 @@ void LinkwitzRiley8EQEffect::loadEngineEffectParameters( m_pKillLow = parameters.value("killLow"); m_pKillMid = parameters.value("killMid"); m_pKillHigh = parameters.value("killHigh"); + m_pBypassLow = parameters.value("bypassLow"); + m_pBypassMid = parameters.value("bypassMid"); + m_pBypassHigh = parameters.value("bypassHigh"); } void LinkwitzRiley8EQEffect::processChannel( @@ -92,16 +94,29 @@ void LinkwitzRiley8EQEffect::processChannel( const GroupFeatureState& groupFeatures) { Q_UNUSED(groupFeatures); - float fButtonOnValue = static_cast(m_pEQButtonMode->get()); - float fLow = fButtonOnValue, fMid = fButtonOnValue, fHigh = fButtonOnValue; - if (!m_pKillLow->toBool()) { - fLow = static_cast(m_pPotLow->value()); + double fLow; + double fMid; + double fHigh; + if (m_pBypassLow->toBool()) { + fLow = 1; + } else if (m_pKillLow->toBool()) { + fLow = 0; + } else { + fLow = m_pPotLow->value(); } - if (!m_pKillMid->toBool()) { - fMid = static_cast(m_pPotMid->value()); + if (m_pBypassMid->toBool()) { + fMid = 1; + } else if (m_pKillMid->toBool()) { + fMid = 0; + } else { + fMid = m_pPotMid->value(); } - if (!m_pKillHigh->toBool()) { - fHigh = static_cast(m_pPotHigh->value()); + if (m_pBypassHigh->toBool()) { + fHigh = 1; + } else if (m_pKillHigh->toBool()) { + fHigh = 0; + } else { + fHigh = m_pPotHigh->value(); } if (pState->m_oldSampleRate != engineParameters.sampleRate() || diff --git a/src/effects/backends/builtin/linkwitzriley8eqeffect.h b/src/effects/backends/builtin/linkwitzriley8eqeffect.h index 728128fb2ec..499ec8c3c24 100644 --- a/src/effects/backends/builtin/linkwitzriley8eqeffect.h +++ b/src/effects/backends/builtin/linkwitzriley8eqeffect.h @@ -68,9 +68,12 @@ class LinkwitzRiley8EQEffect : public EffectProcessorImpl m_pLoFreqCorner; std::unique_ptr m_pHiFreqCorner; - std::unique_ptr m_pEQButtonMode; DISALLOW_COPY_AND_ASSIGN(LinkwitzRiley8EQEffect); }; diff --git a/src/effects/backends/builtin/threebandbiquadeqeffect.cpp b/src/effects/backends/builtin/threebandbiquadeqeffect.cpp index 648f4f6fc1d..a92d61c0e14 100644 --- a/src/effects/backends/builtin/threebandbiquadeqeffect.cpp +++ b/src/effects/backends/builtin/threebandbiquadeqeffect.cpp @@ -119,7 +119,6 @@ void ThreeBandBiquadEQEffectGroupState::setFilters( ThreeBandBiquadEQEffect::ThreeBandBiquadEQEffect() { m_pLoFreqCorner = std::make_unique("[Mixer Profile]", "LoEQFrequency"); m_pHiFreqCorner = std::make_unique("[Mixer Profile]", "HiEQFrequency"); - m_pEQButtonMode = std::make_unique("[Mixer Profile]", "EQButtonMode"); } void ThreeBandBiquadEQEffect::loadEngineEffectParameters( @@ -130,6 +129,9 @@ void ThreeBandBiquadEQEffect::loadEngineEffectParameters( m_pKillLow = parameters.value("killLow"); m_pKillMid = parameters.value("killMid"); m_pKillHigh = parameters.value("killHigh"); + m_pBypassLow = parameters.value("bypassLow"); + m_pBypassMid = parameters.value("bypassMid"); + m_pBypassHigh = parameters.value("bypassHigh"); } void ThreeBandBiquadEQEffect::processChannel( @@ -157,21 +159,15 @@ void ThreeBandBiquadEQEffect::processChannel( double bqGainMid = 0; double bqGainHigh = 0; if (enableState != EffectEnableState::Disabling) { - if (m_pEQButtonMode->get() == 0) { - bqGainLow = knobValueToBiquadGainDb( - m_pPotLow->value(), m_pKillLow->toBool()); - bqGainMid = knobValueToBiquadGainDb( - m_pPotMid->value(), m_pKillMid->toBool()); - bqGainHigh = knobValueToBiquadGainDb( - m_pPotHigh->value(), m_pKillHigh->toBool()); - } else { - bqGainLow = knobValueToBiquadGainDb( - m_pKillLow->toBool() ? 1 : m_pPotLow->value(), false); - bqGainMid = knobValueToBiquadGainDb( - m_pKillMid->toBool() ? 1 : m_pPotMid->value(), false); - bqGainHigh = knobValueToBiquadGainDb( - m_pKillHigh->toBool() ? 1 : m_pPotHigh->value(), false); - } + bqGainLow = knobValueToBiquadGainDb( + m_pBypassLow->toBool() ? 1 : m_pPotLow->value(), + m_pKillLow->toBool() && !m_pBypassLow->toBool()); + bqGainMid = knobValueToBiquadGainDb( + m_pBypassMid->toBool() ? 1 : m_pPotMid->value(), + m_pKillMid->toBool() && !m_pBypassMid->toBool()); + bqGainHigh = knobValueToBiquadGainDb( + m_pBypassHigh->toBool() ? 1 : m_pPotHigh->value(), + m_pKillHigh->toBool() && !m_pBypassHigh->toBool()); } int activeFilters = 0; diff --git a/src/effects/backends/builtin/threebandbiquadeqeffect.h b/src/effects/backends/builtin/threebandbiquadeqeffect.h index f2a177bdb46..f932dbbabd1 100644 --- a/src/effects/backends/builtin/threebandbiquadeqeffect.h +++ b/src/effects/backends/builtin/threebandbiquadeqeffect.h @@ -75,7 +75,10 @@ class ThreeBandBiquadEQEffect : public EffectProcessorImpl m_pLoFreqCorner; std::unique_ptr m_pHiFreqCorner; - std::unique_ptr m_pEQButtonMode; }; diff --git a/src/effects/chains/equalizereffectchain.cpp b/src/effects/chains/equalizereffectchain.cpp index 4b5e7ce3476..cecaaeaf59c 100644 --- a/src/effects/chains/equalizereffectchain.cpp +++ b/src/effects/chains/equalizereffectchain.cpp @@ -1,5 +1,4 @@ #include "effects/chains/equalizereffectchain.h" - #include "effects/effectslot.h" EqualizerEffectChain::EqualizerEffectChain(const QString& group, @@ -10,14 +9,25 @@ EqualizerEffectChain::EqualizerEffectChain(const QString& group, SignalProcessingStage::Prefader, pEffectsManager, pEffectsMessenger), + m_eqButtonMode(ConfigKey("[Mixer Profile]", "EQButtonMode")), m_pCOFilterWaveform( - new ControlObject(ConfigKey(group, "filterWaveformEnable"))) { + new ControlObject(ConfigKey(group, "filterWaveformEnable"))), + m_pCOFilterLowKill( + new ControlPushButton(ConfigKey(group, "filterLowKill"))), + m_pCOFilterMidKill( + new ControlPushButton(ConfigKey(group, "filterMidKill"))), + m_pCOFilterHighKill( + new ControlPushButton(ConfigKey(group, "filterHighKill"))) { // Add a single effect slot addEffectSlot(formatEffectSlotGroup(group)); m_effectSlots[0]->setEnabled(true); // DlgPrefEq loads the Effect with loadEffectToGroup - setupLegacyAliasesForGroup(group); + m_pCOFilterLowKill->setButtonMode(ControlPushButton::POWERWINDOW); + m_pCOFilterMidKill->setButtonMode(ControlPushButton::POWERWINDOW); + m_pCOFilterHighKill->setButtonMode(ControlPushButton::POWERWINDOW); + + setupAliasesForGroup(group); } void EqualizerEffectChain::setFilterWaveform(bool state) { @@ -33,11 +43,55 @@ QString EqualizerEffectChain::formatEffectSlotGroup(const QString& group) { .arg(group); } -void EqualizerEffectChain::setupLegacyAliasesForGroup(const QString& group) { - // Create aliases for legacy EQ controls. +void EqualizerEffectChain::slotFilterLowKillChanged(double value) { + EffectSlotPointer pEffectSlot = getEffectSlot(0); + if (pEffectSlot) { + const QString& effectSlotGroup = pEffectSlot->getGroup(); + PollingControlProxy effectButton(ConfigKey(effectSlotGroup, + m_eqButtonMode.toBool() ? "button_parameter2" + : "button_parameter1")); + VERIFY_OR_DEBUG_ASSERT(effectButton.valid()) { + return; + } + effectButton.set(value); + } +} + +void EqualizerEffectChain::slotFilterMidKillChanged(double value) { EffectSlotPointer pEffectSlot = getEffectSlot(0); if (pEffectSlot) { const QString& effectSlotGroup = pEffectSlot->getGroup(); + PollingControlProxy effectButton(ConfigKey(effectSlotGroup, + m_eqButtonMode.toBool() ? "button_parameter4" + : "button_parameter3")); + VERIFY_OR_DEBUG_ASSERT(effectButton.valid()) { + return; + } + effectButton.set(value); + } +} + +void EqualizerEffectChain::slotFilterHighKillChanged(double value) { + EffectSlotPointer pEffectSlot = getEffectSlot(0); + if (pEffectSlot) { + const QString& effectSlotGroup = pEffectSlot->getGroup(); + PollingControlProxy effectButton(ConfigKey(effectSlotGroup, + m_eqButtonMode.toBool() ? "button_parameter6" + : "button_parameter5")); + VERIFY_OR_DEBUG_ASSERT(effectButton.valid()) { + return; + } + effectButton.set(value); + } +} + +void EqualizerEffectChain::setupAliasesForGroup(const QString& group) { + // Create aliases for controller EQ controls. + EffectSlotPointer pEffectSlot = getEffectSlot(0); + if (pEffectSlot) { + const QString& effectSlotGroup = pEffectSlot->getGroup(); + PollingControlProxy eqButtonMode(ConfigKey("[Mixer Profile]", "EQButtonMode")); + ControlDoublePrivate::insertAlias(ConfigKey(group, "filterLow"), ConfigKey(effectSlotGroup, "parameter1")); @@ -47,14 +101,18 @@ void EqualizerEffectChain::setupLegacyAliasesForGroup(const QString& group) { ControlDoublePrivate::insertAlias(ConfigKey(group, "filterHigh"), ConfigKey(effectSlotGroup, "parameter3")); - ControlDoublePrivate::insertAlias(ConfigKey(group, "filterLowKill"), - ConfigKey(effectSlotGroup, "button_parameter1")); - - ControlDoublePrivate::insertAlias(ConfigKey(group, "filterMidKill"), - ConfigKey(effectSlotGroup, "button_parameter2")); - - ControlDoublePrivate::insertAlias(ConfigKey(group, "filterHighKill"), - ConfigKey(effectSlotGroup, "button_parameter3")); + connect(m_pCOFilterLowKill.get(), + &ControlObject::valueChanged, + this, + &EqualizerEffectChain::slotFilterLowKillChanged); + connect(m_pCOFilterMidKill.get(), + &ControlObject::valueChanged, + this, + &EqualizerEffectChain::slotFilterMidKillChanged); + connect(m_pCOFilterHighKill.get(), + &ControlObject::valueChanged, + this, + &EqualizerEffectChain::slotFilterHighKillChanged); ControlDoublePrivate::insertAlias(ConfigKey(group, "filterLow_loaded"), ConfigKey(effectSlotGroup, "parameter1_loaded")); diff --git a/src/effects/chains/equalizereffectchain.h b/src/effects/chains/equalizereffectchain.h index 98a15973838..fd08c051f6a 100644 --- a/src/effects/chains/equalizereffectchain.h +++ b/src/effects/chains/equalizereffectchain.h @@ -1,5 +1,6 @@ #pragma once +#include "control/pollingcontrolproxy.h" #include "effects/chains/pergroupeffectchain.h" /// EqualizerEffectChain is specifically for the equalizers only. @@ -20,7 +21,17 @@ class EqualizerEffectChain : public PerGroupEffectChain { static QString formatEffectChainGroup(const QString& group); static QString formatEffectSlotGroup(const QString& group); + private slots: + void slotFilterLowKillChanged(double value); + void slotFilterMidKillChanged(double value); + void slotFilterHighKillChanged(double value); + private: - void setupLegacyAliasesForGroup(const QString& group); + void setupAliasesForGroup(const QString& group); + PollingControlProxy m_eqButtonMode; + std::unique_ptr m_pCOFilterWaveform; + std::unique_ptr m_pCOFilterLowKill; + std::unique_ptr m_pCOFilterMidKill; + std::unique_ptr m_pCOFilterHighKill; }; diff --git a/src/mixer/basetrackplayer.cpp b/src/mixer/basetrackplayer.cpp index fe32bbcb9c4..509040fd37a 100644 --- a/src/mixer/basetrackplayer.cpp +++ b/src/mixer/basetrackplayer.cpp @@ -708,14 +708,13 @@ EngineDeck* BaseTrackPlayerImpl::getEngineDeck() const { } void BaseTrackPlayerImpl::setupEqControls() { - const QString group = QString("[EqualizerRack1_%1_Effect1]").arg(getGroup()); - - m_pLowFilter = make_parented(group, "parameter1", this); - m_pMidFilter = make_parented(group, "parameter2", this); - m_pHighFilter = make_parented(group, "parameter3", this); - m_pLowFilterKill = make_parented(group, "button_parameter1", this); - m_pMidFilterKill = make_parented(group, "button_parameter2", this); - m_pHighFilterKill = make_parented(group, "button_parameter3", this); + const QString group = getGroup(); + m_pLowFilter = make_parented(group, "filterLow", this); + m_pMidFilter = make_parented(group, "filterMid", this); + m_pHighFilter = make_parented(group, "filterHigh", this); + m_pLowFilterKill = make_parented(group, "filterLowKill", this); + m_pMidFilterKill = make_parented(group, "filterMidKill", this); + m_pHighFilterKill = make_parented(group, "filterHighKill", this); } void BaseTrackPlayerImpl::slotVinylControlEnabled(double v) { diff --git a/src/waveform/renderers/qtwaveformrendererfilteredsignal.cpp b/src/waveform/renderers/qtwaveformrendererfilteredsignal.cpp index a0b708fb9b6..6fc54b48274 100644 --- a/src/waveform/renderers/qtwaveformrendererfilteredsignal.cpp +++ b/src/waveform/renderers/qtwaveformrendererfilteredsignal.cpp @@ -313,7 +313,7 @@ void QtWaveformRendererFilteredSignal::draw(QPainter* painter, QPaintEvent* /*ev int numberOfPoints = buildPolygon(); - if (m_pLowButtonControlObject && m_pLowButtonControlObject->get() > 0.1) { + if (m_pLowKillControlObject && m_pLowKillControlObject->get() > 0.1) { painter->setPen(QPen(m_lowKilledBrush, 0.0)); painter->setBrush(QColor(150,150,150,20)); } else { @@ -322,7 +322,7 @@ void QtWaveformRendererFilteredSignal::draw(QPainter* painter, QPaintEvent* /*ev } painter->drawPolygon(&m_polygon[0][0], numberOfPoints); - if (m_pMidButtonControlObject && m_pMidButtonControlObject->get() > 0.1) { + if (m_pMidKillControlObject && m_pMidKillControlObject->get() > 0.1) { painter->setPen(QPen(m_midKilledBrush, 0.0)); painter->setBrush(QColor(150,150,150,20)); } else { @@ -331,7 +331,7 @@ void QtWaveformRendererFilteredSignal::draw(QPainter* painter, QPaintEvent* /*ev } painter->drawPolygon(&m_polygon[1][0], numberOfPoints); - if (m_pHighButtonControlObject && m_pHighButtonControlObject->get() > 0.1) { + if (m_pHighKillControlObject && m_pHighKillControlObject->get() > 0.1) { painter->setPen(QPen(m_highKilledBrush, 0.0)); painter->setBrush(QColor(150,150,150,20)); } else { diff --git a/src/waveform/renderers/waveformrendererfilteredsignal.cpp b/src/waveform/renderers/waveformrendererfilteredsignal.cpp index e76d295926d..702c9b70163 100644 --- a/src/waveform/renderers/waveformrendererfilteredsignal.cpp +++ b/src/waveform/renderers/waveformrendererfilteredsignal.cpp @@ -225,15 +225,15 @@ void WaveformRendererFilteredSignal::draw(QPainter* painter, double lineThickness = math_max(1.0, 1.0 / m_waveformRenderer->getVisualSamplePerPixel()); painter->setPen(QPen(QBrush(m_pColors->getLowColor()), lineThickness, Qt::SolidLine, Qt::FlatCap)); - if (m_pLowButtonControlObject && m_pLowButtonControlObject->get() == 0.0) { + if (m_pLowKillControlObject && m_pLowKillControlObject->get() == 0.0) { painter->drawLines(&m_lowLines[0], actualLowLineNumber); } painter->setPen(QPen(QBrush(m_pColors->getMidColor()), lineThickness, Qt::SolidLine, Qt::FlatCap)); - if (m_pMidButtonControlObject && m_pMidButtonControlObject->get() == 0.0) { + if (m_pMidKillControlObject && m_pMidKillControlObject->get() == 0.0) { painter->drawLines(&m_midLines[0], actualMidLineNumber); } painter->setPen(QPen(QBrush(m_pColors->getHighColor()), lineThickness, Qt::SolidLine, Qt::FlatCap)); - if (m_pHighButtonControlObject && m_pHighButtonControlObject->get() == 0.0) { + if (m_pHighKillControlObject && m_pHighKillControlObject->get() == 0.0) { painter->drawLines(&m_highLines[0], actualHighLineNumber); } } diff --git a/src/waveform/renderers/waveformrenderersignalbase.cpp b/src/waveform/renderers/waveformrenderersignalbase.cpp index cf7eb11e744..547449acbb2 100644 --- a/src/waveform/renderers/waveformrenderersignalbase.cpp +++ b/src/waveform/renderers/waveformrenderersignalbase.cpp @@ -16,10 +16,12 @@ WaveformRendererSignalBase::WaveformRendererSignalBase( m_pLowFilterControlObject(nullptr), m_pMidFilterControlObject(nullptr), m_pHighFilterControlObject(nullptr), - m_pLowButtonControlObject(nullptr), - m_pMidButtonControlObject(nullptr), - m_pHighButtonControlObject(nullptr), - m_pEQButtonMode(nullptr), + m_pLowKillControlObject(nullptr), + m_pMidKillControlObject(nullptr), + m_pHighKillControlObject(nullptr), + m_pLowBypassControlObject(nullptr), + m_pMidBypassControlObject(nullptr), + m_pHighBypassControlObject(nullptr), m_alignment(Qt::AlignCenter), m_orientation(Qt::Horizontal), m_pColors(nullptr), @@ -59,10 +61,12 @@ void WaveformRendererSignalBase::deleteControls() { delete m_pLowFilterControlObject; delete m_pMidFilterControlObject; delete m_pHighFilterControlObject; - delete m_pLowButtonControlObject; - delete m_pMidButtonControlObject; - delete m_pHighButtonControlObject; - delete m_pEQButtonMode; + delete m_pLowKillControlObject; + delete m_pMidKillControlObject; + delete m_pHighKillControlObject; + delete m_pLowBypassControlObject; + delete m_pMidBypassControlObject; + delete m_pHighBypassControlObject; } bool WaveformRendererSignalBase::init() { @@ -79,14 +83,18 @@ bool WaveformRendererSignalBase::init() { eqGroup, "parameter2"); m_pHighFilterControlObject = new ControlProxy( eqGroup, "parameter3"); - m_pLowButtonControlObject = new ControlProxy( + m_pLowKillControlObject = new ControlProxy( eqGroup, "button_parameter1"); - m_pMidButtonControlObject = new ControlProxy( - eqGroup, "button_parameter2"); - m_pHighButtonControlObject = new ControlProxy( + m_pMidKillControlObject = new ControlProxy( eqGroup, "button_parameter3"); - m_pEQButtonMode = new ControlProxy( - "[Mixer Profile]", "EQButtonMode"); + m_pHighKillControlObject = new ControlProxy( + eqGroup, "button_parameter5"); + m_pLowBypassControlObject = new ControlProxy( + eqGroup, "button_parameter2"); + m_pMidBypassControlObject = new ControlProxy( + eqGroup, "button_parameter4"); + m_pHighBypassControlObject = new ControlProxy( + eqGroup, "button_parameter6"); return onInit(); } @@ -194,16 +202,22 @@ void WaveformRendererSignalBase::getGains(float* pAllGain, float* pLowGain, highGain *= static_cast( factory->getVisualGain(WaveformWidgetFactory::High)); - if (m_pLowButtonControlObject && m_pLowButtonControlObject->get() > 0.0) { - lowGain = static_cast(m_pEQButtonMode->get()); + if (m_pLowBypassControlObject && m_pLowBypassControlObject->get() > 0.0) { + lowGain = 1.0; + } else if (m_pLowKillControlObject && m_pLowKillControlObject->get() > 0.0) { + lowGain = 0.0; } - if (m_pMidButtonControlObject && m_pMidButtonControlObject->get() > 0.0) { - midGain = static_cast(m_pEQButtonMode->get()); + if (m_pMidBypassControlObject && m_pMidBypassControlObject->get() > 0.0) { + midGain = 1.0; + } else if (m_pMidKillControlObject && m_pMidKillControlObject->get() > 0.0) { + midGain = 0.0; } - if (m_pHighButtonControlObject && m_pHighButtonControlObject->get() > 0.0) { - highGain = static_cast(m_pEQButtonMode->get()); + if (m_pHighBypassControlObject && m_pHighBypassControlObject->get() > 0.0) { + highGain = 1.0; + } else if (m_pHighKillControlObject && m_pHighKillControlObject->get() > 0.0) { + highGain = 0.0; } } diff --git a/src/waveform/renderers/waveformrenderersignalbase.h b/src/waveform/renderers/waveformrenderersignalbase.h index 919da53ddfa..ffbc7da1471 100644 --- a/src/waveform/renderers/waveformrenderersignalbase.h +++ b/src/waveform/renderers/waveformrenderersignalbase.h @@ -29,10 +29,12 @@ class WaveformRendererSignalBase : public WaveformRendererAbstract { ControlProxy* m_pLowFilterControlObject; ControlProxy* m_pMidFilterControlObject; ControlProxy* m_pHighFilterControlObject; - ControlProxy* m_pLowButtonControlObject; - ControlProxy* m_pMidButtonControlObject; - ControlProxy* m_pHighButtonControlObject; - ControlProxy* m_pEQButtonMode; + ControlProxy* m_pLowKillControlObject; + ControlProxy* m_pMidKillControlObject; + ControlProxy* m_pHighKillControlObject; + ControlProxy* m_pLowBypassControlObject; + ControlProxy* m_pMidBypassControlObject; + ControlProxy* m_pHighBypassControlObject; Qt::Alignment m_alignment; Qt::Orientation m_orientation;