Skip to content

Commit

Permalink
Merge pull request #18 from daschuer/restore_metaknob_effect_switch_b…
Browse files Browse the repository at this point in the history
…ehavior

use isAdoptMetaknobValueEnabled and "[Effects]", "AdoptMetaknobValue"
  • Loading branch information
Be-ing authored Apr 3, 2018
2 parents f104162 + 0dd89ef commit f3f010e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/effects/effectchainmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,6 @@ void EffectChainManager::loadEffectChains() {
}
}

bool EffectChainManager::getAdoptMetaknobPositionSetting() const {
return m_pConfig->getValue(ConfigKey("[Effects]", "EffectLoadMetaknobBehavior"), true);
bool EffectChainManager::isAdoptMetaknobValueEnabled() const {
return m_pConfig->getValue(ConfigKey("[Effects]", "AdoptMetaknobValue"), true);
}
2 changes: 1 addition & 1 deletion src/effects/effectchainmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class EffectChainManager : public QObject {

static const int kNumStandardEffectChains = 4;

bool getAdoptMetaknobPositionSetting() const;
bool isAdoptMetaknobValueEnabled() const;

private:
QString debugString() const {
Expand Down
2 changes: 1 addition & 1 deletion src/effects/effectchainslot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void EffectChainSlot::slotChainEffectChanged(unsigned int effectSlotNumber,
pEffect = effects.at(effectSlotNumber);
}
if (pSlot != nullptr) {
pSlot->loadEffect(pEffect, m_pEffectRack->getAdoptMetaknobPositionSetting());
pSlot->loadEffect(pEffect, m_pEffectRack->isAdoptMetaknobValueEnabled());
}

m_pControlNumEffects->forceSet(math_min(
Expand Down
4 changes: 2 additions & 2 deletions src/effects/effectrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ QDomElement EffectRack::toXml(QDomDocument* doc) const {
return rackElement;
}

bool EffectRack::getAdoptMetaknobPositionSetting() const {
return m_pEffectChainManager->getAdoptMetaknobPositionSetting();
bool EffectRack::isAdoptMetaknobValueEnabled() const {
return m_pEffectChainManager->isAdoptMetaknobValueEnabled();
}

StandardEffectRack::StandardEffectRack(EffectsManager* pEffectsManager,
Expand Down
6 changes: 3 additions & 3 deletions src/effects/effectrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class EffectRack : public QObject {

QDomElement toXml(QDomDocument* doc) const;

virtual bool getAdoptMetaknobPositionSetting() const;
virtual bool isAdoptMetaknobValueEnabled() const;

public slots:
void slotClearRack(double v);
Expand Down Expand Up @@ -199,7 +199,7 @@ class QuickEffectRack : public PerGroupRack {
group);
}

bool getAdoptMetaknobPositionSetting() const override {
bool isAdoptMetaknobValueEnabled() const override {
// No visible Metaknobs to adopt
return false;
}
Expand Down Expand Up @@ -251,7 +251,7 @@ class EqualizerRack : public PerGroupRack {
group);
}

bool getAdoptMetaknobPositionSetting() const override {
bool isAdoptMetaknobValueEnabled() const override {
// No visible Metaknobs to adopt
return false;
}
Expand Down
10 changes: 5 additions & 5 deletions src/preferences/dialog/dlgprefinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ void DlgPrefInterface::slotUpdate() {
int inhibitsettings = static_cast<int>(m_mixxx->getInhibitScreensaver());
comboBoxScreensaver->setCurrentIndex(comboBoxScreensaver->findData(inhibitsettings));

bool effectLoadMetaknobBehavior = m_pConfig->getValue(
ConfigKey("[Effects]", "EffectLoadMetaknobBehavior"), true);
radioButtonKeepMetaknobPosition->setChecked(effectLoadMetaknobBehavior);
radioButtonMetaknobLoadDefault->setChecked(!effectLoadMetaknobBehavior);
bool effectAdoptMetaknobValue = m_pConfig->getValue(
ConfigKey("[Effects]", "AdoptMetaknobValue"), true);
radioButtonKeepMetaknobPosition->setChecked(effectAdoptMetaknobValue);
radioButtonMetaknobLoadDefault->setChecked(!effectAdoptMetaknobValue);
}

void DlgPrefInterface::slotResetToDefaults() {
Expand Down Expand Up @@ -367,7 +367,7 @@ void DlgPrefInterface::slotApply() {
m_pConfig->set(ConfigKey("[Config]", "StartInFullscreen"),
ConfigValue(checkBoxStartFullScreen->isChecked()));

m_pConfig->set(ConfigKey("[Effects]", "EffectLoadMetaknobBehavior"),
m_pConfig->set(ConfigKey("[Effects]", "AdoptMetaknobValue"),
ConfigValue(radioButtonKeepMetaknobPosition->isChecked()));

m_mixxx->setToolTipsCfg(m_tooltipMode);
Expand Down

0 comments on commit f3f010e

Please sign in to comment.