Skip to content

Commit

Permalink
Effects: replace m_isQuickEffectChain with EffectsManager::chainIsQui…
Browse files Browse the repository at this point in the history
…ckEffectChain
  • Loading branch information
ronso0 committed Sep 1, 2022
1 parent 0234c55 commit 79aee27
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/effects/chains/quickeffectchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ QuickEffectChain::QuickEffectChain(const QString& group,
SignalProcessingStage::Postfader,
pEffectsManager,
pEffectsMessenger) {
m_isQuickEffectChain = true;
for (int i = 0; i < kNumEffectsPerUnit; ++i) {
addEffectSlot(formatEffectSlotGroup(group, i));
m_effectSlots.at(i)->setEnabled(true);
Expand Down
7 changes: 6 additions & 1 deletion src/effects/effectchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,12 @@ void EffectChain::loadChainPreset(EffectChainPresetPointer pPreset) {
// after loading an effect. Thus, if this is not a Quick Effetc chain, we
// just clear the preset name which in turn clears the chain's preset
// selector and chain name label.
m_presetName = m_isQuickEffectChain ? kNoEffectString : QString();

// Check if this is a QuickEffectChain
m_presetName = m_pEffectsManager->chainIsQuickEffectChain(this)
? kNoEffectString
: QString();

emit chainPresetChanged(m_presetName);
setControlLoadedPresetIndex(std::nullopt);
return;
Expand Down
1 change: 0 additions & 1 deletion src/effects/effectchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class EffectChain : public QObject {

protected:
EffectSlotPointer addEffectSlot(const QString& group);
bool m_isQuickEffectChain = false;

virtual int numPresets() const;

Expand Down
4 changes: 4 additions & 0 deletions src/effects/effectsmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ EffectChainPointer EffectsManager::getEffectChain(
return m_effectChainSlotsByGroup.value(group);
}

bool EffectsManager::chainIsQuickEffectChain(const EffectChain* pEffectChain) const {
return dynamic_cast<const QuickEffectChain*>(pEffectChain) != nullptr;
}

bool EffectsManager::isAdoptMetaknobSettingEnabled() const {
return m_pConfig->getValue(ConfigKey("[Effects]", "AdoptMetaknobValue"), true);
}
Expand Down
2 changes: 2 additions & 0 deletions src/effects/effectsmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class EffectsManager {
EffectChainPointer getStandardEffectChain(int unitNumber) const;
EffectChainPointer getOutputEffectChain() const;

bool chainIsQuickEffectChain(const EffectChain* pEffectChain) const;

EngineEffectsManager* getEngineEffectsManager() const {
return m_pEngineEffectsManager;
}
Expand Down

0 comments on commit 79aee27

Please sign in to comment.