Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EQ Rack #330

Closed
wants to merge 90 commits into from
Closed
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
bbf6999
Add eqeffect.cpp to sources list
badescunicu May 20, 2014
458b8b7
Create an effect with a 3 band EQ
badescunicu May 20, 2014
d91b153
Register EqEffect
badescunicu May 21, 2014
4c0d2fb
Fix comment
badescunicu May 21, 2014
5781325
[Coding Style] Each member of a class should be on its own line
badescunicu May 21, 2014
2a4b063
Remove the link between the super knob and eq knobs
badescunicu May 21, 2014
1299acb
Use the initializer list for old_low, old_mid, old_high, old_dry
badescunicu May 21, 2014
5cb622f
Use a ControlObjectSlave to get the sample rate from the EqEffect
badescunicu May 23, 2014
dd092b6
Make the sample rate accessible from descendants of GroupEffectProcessor
badescunicu May 23, 2014
e46bf37
Connect the frequency corners from preferences to the EQ Effect
badescunicu May 23, 2014
def4866
Initialize m_loFreq and m_hiFreq with 0 in initializer list
badescunicu May 23, 2014
16f52cb
Fix typo in control.h
badescunicu May 24, 2014
2589688
Do ramping after setFrequencyCorners() (not working properly yet)
badescunicu May 30, 2014
ee31d2e
Do a cross fade without using an additional buffer (not working prope…
badescunicu May 30, 2014
d49aaa8
Do not create new filters in setFilters(). Update previously created …
badescunicu Jun 1, 2014
8859eff
Change the sample rate in setFrequencyCorners(). If frequency corners…
badescunicu Jun 1, 2014
03bdf87
Pass the sample rate to setFrequencyCorners()
badescunicu Jun 1, 2014
5890140
Use memset and memcpy for copying and initializing buffers
badescunicu Jun 2, 2014
199146a
Rename EqEffect to EQDefault
badescunicu Jun 2, 2014
4752eba
Rename EQ knobs to LOW, MID and HIGH
badescunicu Jun 2, 2014
2d878c4
Add descriptions to Default EQ and remove redundant includes
badescunicu Jun 2, 2014
ab66eee
Attempt at switch type parameters
badescunicu Jun 6, 2014
a61f12a
Update the underlying EffectParameter separately for each type of par…
badescunicu Jun 16, 2014
df366e2
Fix typo in computing m_maximum
badescunicu Jun 17, 2014
25559ed
Correct mistake in effectbuttonparameterslot
badescunicu Jun 17, 2014
50ee860
Add a new EffectRack with 4 EQDefault effects. Each EQ is responsible…
badescunicu Jun 19, 2014
7122847
Fix comments
badescunicu Jun 19, 2014
ee07447
Dynamic creation of EQ (each time a deck is added)
badescunicu Jun 19, 2014
574d8ea
Pack the creation of a new EQ inside a method of EffectsManager
badescunicu Jun 20, 2014
0c9dabc
Minor coding style improvement
badescunicu Jun 20, 2014
f0bfd6f
Fix createElement argument in effect.cpp
badescunicu Jun 22, 2014
66bb4ed
Add 4 check boxes for controlling which effect to load onto the EQ Ef…
badescunicu Jun 26, 2014
e8dcab8
Pass a pointer to the EffectsManager to DlgPreferences
badescunicu Jun 26, 2014
4bf1845
Update the Effects loaded onto the Rack when the user checks a box
badescunicu Jun 26, 2014
9aeb025
Use ControlObjectSlave instead of ControlObjectThread for setting the…
badescunicu Jun 27, 2014
e6f9f4d
Add a slot inside EffectRack for loading an effect on an given effect…
badescunicu Jun 27, 2014
06d34aa
Add an EffectRack* and initialize it
badescunicu Jun 27, 2014
615d2e9
Create a new signal in dlgprefeq and connect it to a slot of the EQ R…
badescunicu Jun 27, 2014
c463b8f
Remove the connection for CheckBoxes
badescunicu Jun 27, 2014
2b18b73
Create a slot inside dlgprefeq.cpp for dynamically creating ComboBoxes
badescunicu Jun 27, 2014
b87b610
Temporary hack for having access to DlgPrefEQ
badescunicu Jun 27, 2014
2f30f76
Add another ComboBox if the number of decks has increased
badescunicu Jun 27, 2014
7a03def
Remove the hard coded check boxes
badescunicu Jun 27, 2014
eeb35dc
Dynamically update the required Deck with the selected Effect
badescunicu Jun 27, 2014
5cda4b7
Delete used QComboBoxes in destructor
badescunicu Jun 28, 2014
8b81768
Check if qobject_cast was successful
badescunicu Jun 28, 2014
94177af
Maintain coding style consistency; remove additional empty lines
badescunicu Jun 28, 2014
fb64948
Remove the hard coded check boxes from dlgprefeqdlg.ui
badescunicu Jun 28, 2014
776323c
Connect [Master],num_decks' value changed signal to the slot which ad…
badescunicu Jun 28, 2014
f72071f
Remove the hard coded initialization of the EQ Effect Rack
badescunicu Jun 28, 2014
872341d
Remove temporary hack for accessing DlgPrefEQ as it is no longer needed
badescunicu Jun 29, 2014
be04f6a
Add labels for each QComboBox
badescunicu Jun 29, 2014
9e4ef33
Add a QLabel to dlgprefeqdlg.ui
badescunicu Jun 29, 2014
aa97b18
Remove effect instantiation in addEffectChainSlotForEQ; now dlgprefeq…
badescunicu Jun 29, 2014
657658b
Store user's configuration of the Effect Rack
badescunicu Jun 29, 2014
b20cb78
m_pConfig is deleted inside mixxx.cpp; this was causing an incorrect …
badescunicu Jun 30, 2014
3fa8cc7
Introduce a check box for configuring the Effect Rack (basic/advanced…
badescunicu Jun 30, 2014
b18c59e
Add a flag in EffectManifest to keep track if an effect is an Equaliz…
badescunicu Jun 30, 2014
babb40c
Add another method in EffectsManager class which returns the availabl…
badescunicu Jun 30, 2014
5aef2b0
Use getAvailableEQEffects inside DlgPrefEQ
badescunicu Jun 30, 2014
ce76dd8
Mark EQDefault as an EQ Effect
badescunicu Jun 30, 2014
a27f92a
Add methods for retrieving the available effects names
badescunicu Jun 30, 2014
80c960f
Use itemData() field for storing the effect ID. currentText() is stor…
badescunicu Jun 30, 2014
c7bfc2f
Rename a couple of methods and variables
badescunicu Jun 30, 2014
bda0da7
Modify getAvailableEffectNames and getAvailableEQEffectNames to retur…
badescunicu Jul 1, 2014
1e95377
Use the newly modified methods to fix the link between combo box's te…
badescunicu Jul 1, 2014
fa36e3c
Instantiate controls needed by equalizers inside EffectsManager
badescunicu Jul 2, 2014
b64f3cb
Remove EngineFilterBlock from EngineDeck
badescunicu Jul 2, 2014
2dbece9
Merge master and fix conflicts
badescunicu Aug 11, 2014
afcc172
Mark Butterworth8EQEffect as an EQ Effect
badescunicu Aug 11, 2014
b5c9f2f
Create aliases needed for the EQ Rack
badescunicu Aug 11, 2014
b89544d
Use a loop to create aliases needed for the EQ rack
badescunicu Aug 13, 2014
6cc37d4
Merge branch 'master' of github.com:badescunicu/mixxx into eq_rack
badescunicu Aug 13, 2014
6c59fa0
Remove the radio buttons from EQ Preferences and enable internal EQ
badescunicu Aug 13, 2014
d016e61
Remove EngineFilterBlock
badescunicu Aug 13, 2014
3875241
Add a Bypass check box to EQ Preferences and implement the logic behi…
badescunicu Aug 14, 2014
b02cc8b
Create the aliases inside EffectsManager::addEqualizer instead of har…
badescunicu Aug 16, 2014
b04311f
Merge branch 'master' of github.com:badescunicu/mixxx into eq_rack
badescunicu Aug 16, 2014
94b4013
Fix conflicts
badescunicu Sep 4, 2014
40a5eb6
Fix for logarithmic control hint
badescunicu Sep 5, 2014
795e47b
Set kEffectDebugOutput to false
badescunicu Sep 5, 2014
feb19f0
Remove commented out line from enginedeck.cpp
badescunicu Sep 5, 2014
818c873
Fix some coding style issues and mark a couple of strings for translate
badescunicu Sep 10, 2014
e82a1ab
Remove effectprocessor.cpp because it was not used throughout the cod…
badescunicu Sep 10, 2014
358e074
Add getEQEffectRack method to EffectsManager
badescunicu Sep 10, 2014
0343ab6
Use getEQEffectRack method inside DlgPrefEQ
badescunicu Sep 10, 2014
fb70322
Add getEQEffectRackNumber method to EffectsManager
badescunicu Sep 12, 2014
490dcd6
Rename checkBox_bypass to CheckBoxBypass
badescunicu Sep 12, 2014
e47fe35
Use another approach at bypassing the EQ Rack
badescunicu Sep 12, 2014
ef107cc
Store the effects' ids as configs instead of their names
badescunicu Sep 12, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,6 @@ def sources(self, build):
"engine/enginebufferscale.cpp",
"engine/enginebufferscaledummy.cpp",
"engine/enginebufferscalelinear.cpp",
"engine/enginefilterblock.cpp",
"engine/enginefilterbiquad1.cpp",
"engine/enginefilterbessel4.cpp",
"engine/enginefilterbutterworth4.cpp",
Expand Down
2 changes: 0 additions & 2 deletions src/configobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ template <class ValueType> bool ConfigObject<ValueType>::Parse()
return true;
}


template <class ValueType> void ConfigObject<ValueType>::clear()
{
//Delete the pointers, because that's what we did before we
Expand Down Expand Up @@ -396,7 +395,6 @@ QString ConfigObject<ValueType>::getResourcePath() {
return qResourcePath;
}


template <class ValueType> ConfigObject<ValueType>::ConfigObject(QDomNode node) {

if (!node.isNull() && node.isElement()) {
Expand Down
1 change: 0 additions & 1 deletion src/configobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class ConfigValue {
friend bool operator==(const ConfigValue & s1, const ConfigValue & s2);
};


class ConfigValueKbd : public ConfigValue {
public:
ConfigValueKbd();
Expand Down
10 changes: 5 additions & 5 deletions src/controleffectknob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ ControlEffectKnob::ControlEffectKnob(ConfigKey key, double dMinValue, double dMa

void ControlEffectKnob::setBehaviour(EffectManifestParameter::ControlHint type,
double dMinValue, double dMaxValue) {
if ( m_pControl == NULL) {
if (m_pControl == NULL) {
return;
}

if (type == EffectManifestParameter::CONTROL_KNOB_LINEAR) {
m_pControl->setBehavior(new ControlLinPotmeterBehavior(
dMinValue, dMaxValue, false));
} else if (type == EffectManifestParameter::CONTROL_KNOB_LOGARITHMIC) {
if (m_dMinValue == 0) {
if (m_dMaxValue == 1.0) {
if (dMinValue == 0) {
if (dMaxValue == 1.0) {
// Volume like control
m_pControl->setBehavior(
new ControlAudioTaperPotBehavior(-20, 0, 1));
} else {
// Gain like control
m_pControl->setBehavior(
new ControlAudioTaperPotBehavior(-12, ratio2db(m_dMaxValue), 0.5));
new ControlAudioTaperPotBehavior(-12, ratio2db(dMaxValue), 0.5));
}
} else {
m_pControl->setBehavior(
new ControlLogPotmeterBehavior(m_dMinValue, m_dMaxValue));
new ControlLogPotmeterBehavior(dMinValue, dMaxValue));
}
}
}
228 changes: 189 additions & 39 deletions src/dlgprefeq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@

#include <QWidget>
#include <QString>
#include <QHBoxLayout>

#include "dlgprefeq.h"
#include "engine/enginefilterbessel4.h"
#include "controlobject.h"
#include "controlobjectslave.h"
#include "util/math.h"

#define CONFIG_KEY "[Mixer Profile]"
Expand All @@ -29,15 +31,22 @@
const int kFrequencyUpperLimit = 20050;
const int kFrequencyLowerLimit = 16;

DlgPrefEQ::DlgPrefEQ(QWidget* pParent, ConfigObject<ConfigValue>* pConfig)
DlgPrefEQ::DlgPrefEQ(QWidget* pParent, EffectsManager* pEffectsManager,
ConfigObject<ConfigValue>* pConfig)
: DlgPreferencePage(pParent),
m_COTLoFreq(CONFIG_KEY, "LoEQFrequency"),
m_COTHiFreq(CONFIG_KEY, "HiEQFrequency"),
m_COTLoFi(CONFIG_KEY, "LoFiEQs"),
m_COTEnableEq(CONFIG_KEY, ENABLE_INTERNAL_EQ),
m_pConfig(pConfig),
m_lowEqFreq(0.0),
m_highEqFreq(0.0) {
m_highEqFreq(0.0),
m_pEffectsManager(pEffectsManager) {

// Initialize the EQ Effect Rack
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Get the EQ Effect Rack
It is already initialized

int iEqRackNumber = m_pEffectsManager->getEffectChainManager()
->getEffectRacksSize();
m_pEQEffectRack = m_pEffectsManager->getEffectRack(iEqRackNumber - 1).data();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot know is this is true after later changes. We may ask the EffectChainManager via a new function
m_pEffectsManager->getEQEffectRack()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we cannot use the shared pointer here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to pass the raw pointer to connect below.


setupUi(this);

// Connection
Expand All @@ -49,16 +58,132 @@ DlgPrefEQ::DlgPrefEQ(QWidget* pParent, ConfigObject<ConfigValue>* pConfig)
connect(SliderLoEQ, SIGNAL(sliderMoved(int)), this, SLOT(slotUpdateLoEQ()));
connect(SliderLoEQ, SIGNAL(sliderReleased()), this, SLOT(slotUpdateLoEQ()));

connect(radioButton_bypass, SIGNAL(clicked()), this, SLOT(slotEqChanged()));
connect(radioButton_bessel4, SIGNAL(clicked()), this, SLOT(slotEqChanged()));
connect(radioButton_butterworth8, SIGNAL(clicked()), this, SLOT(slotEqChanged()));
connect(checkBox_bypass, SIGNAL(stateChanged(int)), this, SLOT(slotBypass(int)));

connect(CheckBoxShowAllEffects, SIGNAL(stateChanged(int)),
this, SLOT(slotShowAllEffects()));

connect(this, SIGNAL(effectOnChainSlot(const unsigned int,
const unsigned int, QString)),
m_pEQEffectRack, SLOT(slotLoadEffectOnChainSlot(const unsigned int,
const unsigned int, QString)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please align all line breaks here.


// Set to basic view if a previous configuration is missing
CheckBoxShowAllEffects->setChecked(m_pConfig->getValueString(
ConfigKey(CONFIG_KEY, "AdvancedView"), QString("no")) == QString("yes"));

// Add drop down lists for current decks and connect num_decks control
// to slotAddComboBox
m_pNumDecks = new ControlObjectSlave("[Master]", "num_decks", this);
m_pNumDecks->connectValueChanged(SLOT(slotAddComboBox(double)));
slotAddComboBox(m_pNumDecks->get());

loadSettings();
slotUpdate();
slotApply();
}

DlgPrefEQ::~DlgPrefEQ() {
qDeleteAll(m_deckEffectSelectors);
m_deckEffectSelectors.clear();
}

void DlgPrefEQ::slotAddComboBox(double numDecks) {
while (m_deckEffectSelectors.size() < static_cast<int>(numDecks)) {
QHBoxLayout* innerHLayout = new QHBoxLayout();
QLabel* label = new QLabel(QString("Deck %1").
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be translate-able

arg(m_deckEffectSelectors.size() + 1), this);

// Create the drop down list and populate it with the available effects
QComboBox* box = new QComboBox(this);
QList<QPair<QString, QString> > availableEffectNames =
m_pEffectsManager->getAvailableEffectNames().toList();
for (int i = 0; i < availableEffectNames.size(); ++i) {
box->addItem(availableEffectNames[i].second);
box->setItemData(i, QVariant(availableEffectNames[i].first));
}
// Add an empty effect entry
box->addItem("None");
box->setItemData(availableEffectNames.size(), "none");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be translate-able

m_deckEffectSelectors.append(box);
connect(box, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotEffectChangedOnDeck(int)));

// Create the drop down list for basic view
// Add EQ Effects only
QComboBox* simpleBox = new QComboBox(this);
QList<QPair<QString, QString> > availableEQEffectNames =
m_pEffectsManager->getAvailableEQEffectNames().toList();
for (int i = 0; i < availableEQEffectNames.size(); ++i) {
simpleBox->addItem(availableEQEffectNames[i].second);
simpleBox->setItemData(i, QVariant(availableEQEffectNames[i].first));
}
// Add an empty effect entry
simpleBox->addItem("None");
simpleBox->setItemData(availableEQEffectNames.size(), "none");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be translate-able

m_deckBasicEffectSelectors.append(simpleBox);
connect(simpleBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotBasicEffectChangedOnDeck(int)));

// Set the configured effect for box and simpleBox or Butterworth8 EQ
// if none is configured
QString configuredEffect;
int selectedEffectIndex;
configuredEffect = m_pConfig->getValueString(ConfigKey(CONFIG_KEY,
QString("EffectForDeck%1").arg(m_deckEffectSelectors.size())),
QString("Butterworth8 EQ"));
selectedEffectIndex = box->findText(configuredEffect);
box->setCurrentIndex(selectedEffectIndex);

configuredEffect = m_pConfig->getValueString(ConfigKey(CONFIG_KEY,
QString("BasicEffectForDeck%1").arg(m_deckBasicEffectSelectors.size())),
QString("Butterworth8 EQ"));
selectedEffectIndex = simpleBox->findText(configuredEffect);
simpleBox->setCurrentIndex(selectedEffectIndex);

// Force the selected effect on the Effect Rack based on user's preference
bool advancedView = CheckBoxShowAllEffects->isChecked();
if (advancedView) {
simpleBox->setVisible(false);
emit(effectOnChainSlot(m_deckEffectSelectors.size() - 1, 0,
box->itemData(box->currentIndex()).toString()));
} else {
box->setVisible(false);
emit(effectOnChainSlot(m_deckBasicEffectSelectors.size() - 1, 0,
simpleBox->itemData(simpleBox->currentIndex()).toString()));
}

// Setup the GUI
innerHLayout->addWidget(label);
innerHLayout->addWidget(box);
innerHLayout->addWidget(simpleBox);
innerHLayout->addStretch();
verticalLayout_2->addLayout(innerHLayout);
}
}

void DlgPrefEQ::slotShowAllEffects() {
if (!CheckBoxShowAllEffects->isChecked()) {
m_pConfig->set(ConfigKey(CONFIG_KEY, "AdvancedView"), QString("no"));
foreach (QComboBox* box, m_deckEffectSelectors) {
box->setVisible(false);
}
foreach (QComboBox* basicBox, m_deckBasicEffectSelectors) {
basicBox->setVisible(true);
emit(effectOnChainSlot(m_deckBasicEffectSelectors.indexOf(basicBox),
0, basicBox->itemData(basicBox->currentIndex()).toString()));
}
} else {
m_pConfig->set(ConfigKey(CONFIG_KEY, "AdvancedView"), QString("yes"));
foreach (QComboBox* box, m_deckEffectSelectors) {
box->setVisible(true);
emit(effectOnChainSlot(m_deckEffectSelectors.indexOf(box),
0, box->itemData(box->currentIndex()).toString()));
}
foreach (QComboBox* basicBox, m_deckBasicEffectSelectors) {
basicBox->setVisible(false);
}
}
}

void DlgPrefEQ::loadSettings() {
Expand Down Expand Up @@ -93,19 +218,7 @@ void DlgPrefEQ::loadSettings() {

if (m_pConfig->getValueString(
ConfigKey(CONFIG_KEY, ENABLE_INTERNAL_EQ), "yes") == QString("yes")) {
radioButton_bypass->setChecked(false);
if (m_pConfig->getValueString(
ConfigKey(CONFIG_KEY, "LoFiEQs")) == QString("yes")) {
radioButton_bessel4->setChecked(true);
radioButton_butterworth8->setChecked(false);
} else {
radioButton_bessel4->setChecked(false);
radioButton_butterworth8->setChecked(true);
}
} else {
radioButton_bypass->setChecked(true);
radioButton_bessel4->setChecked(false);
radioButton_butterworth8->setChecked(false);
checkBox_bypass->setChecked(false);
}
}

Expand All @@ -118,32 +231,38 @@ void DlgPrefEQ::setDefaultShelves()
}

void DlgPrefEQ::slotResetToDefaults() {
radioButton_bypass->setChecked(false);
radioButton_butterworth8->setChecked(false);
radioButton_bessel4->setChecked(true);
slotEqChanged();
setDefaultShelves();
loadSettings();
slotUpdate();
slotApply();
}

void DlgPrefEQ::slotEqChanged() {
if (radioButton_bypass->isChecked()) {
m_pConfig->set(ConfigKey(CONFIG_KEY, ENABLE_INTERNAL_EQ), QString("no"));
} else {
m_pConfig->set(ConfigKey(CONFIG_KEY, ENABLE_INTERNAL_EQ), QString("yes"));
}

if (radioButton_bessel4->isChecked()) {
m_pConfig->set(ConfigKey(CONFIG_KEY, "LoFiEQs"), ConfigValue(QString("yes")));
void DlgPrefEQ::slotEffectChangedOnDeck(int effectIndex) {
QComboBox* c = qobject_cast<QComboBox*>(sender());
// Check if qobject_cast was successful
if (c) {
int deckNumber = m_deckEffectSelectors.indexOf(c);
QString effectId = c->itemData(effectIndex).toString();
emit(effectOnChainSlot(deckNumber, 0, effectId));

// Update the configured effect for the current QComboBox
m_pConfig->set(ConfigKey(CONFIG_KEY, QString("EffectForDeck%1").
arg(deckNumber + 1)), ConfigValue(c->currentText()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, you should use the ID String of the effect.

}
}

if (radioButton_butterworth8->isChecked()) {
m_pConfig->set(ConfigKey(CONFIG_KEY, "LoFiEQs"), ConfigValue(QString("no")));
void DlgPrefEQ::slotBasicEffectChangedOnDeck(int effectIndex) {
QComboBox* c = qobject_cast<QComboBox*>(sender());
// Check if qobject_cast was successful
if (c) {
int deckNumber = m_deckBasicEffectSelectors.indexOf(c);
QString effectId = c->itemData(effectIndex).toString();
emit(effectOnChainSlot(deckNumber, 0, effectId));

// Update the configured effect for the current QComboBox
m_pConfig->set(ConfigKey(CONFIG_KEY, QString("BasicEffectForDeck%1").
arg(deckNumber + 1)), ConfigValue(c->currentText()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid some duplicated code here?

}

slotApply();
}

void DlgPrefEQ::slotUpdateHiEQ()
Expand Down Expand Up @@ -208,16 +327,47 @@ void DlgPrefEQ::slotApply() {
m_COTLoFreq.slotSet(m_lowEqFreq);
m_COTHiFreq.slotSet(m_highEqFreq);

m_COTLoFi.slotSet((m_pConfig->getValueString(
ConfigKey(CONFIG_KEY, "LoFiEQs")) == QString("yes")));
m_COTEnableEq.slotSet((m_pConfig->getValueString(
ConfigKey(CONFIG_KEY, ENABLE_INTERNAL_EQ), "yes") == QString("yes")));
}

void DlgPrefEQ::slotUpdate() {
slotUpdateLoEQ();
slotUpdateHiEQ();
slotEqChanged();
}

void DlgPrefEQ::slotBypass(int state) {
if (state) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer here to keep the selected effect. You can just disable the EQ Effects by the enable CO
Or the whole effect Chain by the chain enable CO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks for the idea. It is much better this way.

m_pConfig->set(ConfigKey(CONFIG_KEY, ENABLE_INTERNAL_EQ), QString("no"));
// Load none on each deck
int noneIndex;
foreach(QComboBox* box, m_deckEffectSelectors) {
noneIndex = box->findText(QString("None"));
box->setCurrentIndex(noneIndex);
box->setEnabled(false);
}
foreach(QComboBox* box, m_deckBasicEffectSelectors) {
noneIndex = box->findText(QString("None"));
box->setCurrentIndex(noneIndex);
box->setEnabled(false);
}
} else {
m_pConfig->set(ConfigKey(CONFIG_KEY, ENABLE_INTERNAL_EQ), QString("yes"));
// Load Butterworth8 EQ on each slot after enabling the EQ
int defaultEqIndex;
foreach(QComboBox* box, m_deckEffectSelectors) {
defaultEqIndex = box->findText(QString("Butterworth8 EQ"));
box->setCurrentIndex(defaultEqIndex);
box->setEnabled(true);
}
foreach(QComboBox* box, m_deckBasicEffectSelectors) {
defaultEqIndex = box->findText(QString("Butterworth8 EQ"));
box->setCurrentIndex(defaultEqIndex);
box->setEnabled(true);
}
}

slotApply();
}

double DlgPrefEQ::getEqFreq(int sliderVal, int minValue, int maxValue) {
Expand Down
Loading