Skip to content

Commit

Permalink
Merge pull request #4456 from Be-ing/chain_preset_co
Browse files Browse the repository at this point in the history
EffectChain: name ControlObjects consistently with chain_preset
  • Loading branch information
Be-ing committed Oct 19, 2021
2 parents 6367bf2 + 9e8209a commit 0925269
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
20 changes: 13 additions & 7 deletions src/effects/effectchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,32 @@ EffectChain::EffectChain(const QString& group,
&EffectChain::slotControlLoadedChainPresetRequest);

m_pControlNextChainPreset = std::make_unique<ControlPushButton>(
ConfigKey(m_group, "next_chain"));
ConfigKey(m_group, "next_chain_preset"));
connect(m_pControlNextChainPreset.get(),
&ControlObject::valueChanged,
this,
&EffectChain::slotControlNextChainPreset);
ControlDoublePrivate::insertAlias(ConfigKey(m_group, "next_chain"),
ConfigKey(m_group, "next_chain_preset"));

m_pControlPrevChainPreset = std::make_unique<ControlPushButton>(
ConfigKey(m_group, "prev_chain"));
ConfigKey(m_group, "prev_chain_preset"));
connect(m_pControlPrevChainPreset.get(),
&ControlObject::valueChanged,
this,
&EffectChain::slotControlPrevChainPreset);
ControlDoublePrivate::insertAlias(ConfigKey(m_group, "prev_chain"),
ConfigKey(m_group, "prev_chain_preset"));

// Ignoring no-ops is important since this is for +/- tickers.
m_pControlChainSelector = std::make_unique<ControlEncoder>(
ConfigKey(m_group, "chain_selector"), false);
connect(m_pControlChainSelector.get(),
m_pControlChainPresetSelector = std::make_unique<ControlEncoder>(
ConfigKey(m_group, "chain_preset_selector"), false);
connect(m_pControlChainPresetSelector.get(),
&ControlObject::valueChanged,
this,
&EffectChain::slotControlChainSelector);
&EffectChain::slotControlChainPresetSelector);
ControlDoublePrivate::insertAlias(ConfigKey(m_group, "chain_selector"),
ConfigKey(m_group, "chain_preset_preset"));

// ControlObjects for skin <-> controller mapping interaction.
// Refer to comment in header for full explanation.
Expand Down Expand Up @@ -316,7 +322,7 @@ void EffectChain::slotControlChainSuperParameter(double v, bool force) {
}
}

void EffectChain::slotControlChainSelector(double value) {
void EffectChain::slotControlChainPresetSelector(double value) {
int index = presetIndex();
if (value > 0) {
index++;
Expand Down
4 changes: 2 additions & 2 deletions src/effects/effectchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class EffectChain : public QObject {

private slots:
void slotControlLoadedChainPresetRequest(double value);
void slotControlChainSelector(double value);
void slotControlChainPresetSelector(double value);
void slotControlNextChainPreset(double value);
void slotControlPrevChainPreset(double value);
void slotChannelStatusChanged(double value, const ChannelHandleAndGroup& handleGroup);
Expand All @@ -136,7 +136,7 @@ class EffectChain : public QObject {
std::unique_ptr<ControlPushButton> m_pControlChainEnabled;
std::unique_ptr<ControlPushButton> m_pControlChainMixMode;
std::unique_ptr<ControlObject> m_pControlLoadedChainPreset;
std::unique_ptr<ControlEncoder> m_pControlChainSelector;
std::unique_ptr<ControlEncoder> m_pControlChainPresetSelector;
std::unique_ptr<ControlPushButton> m_pControlNextChainPreset;
std::unique_ptr<ControlPushButton> m_pControlPrevChainPreset;

Expand Down

0 comments on commit 0925269

Please sign in to comment.