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

fix setting of effect parameters programatically #4471

Merged
merged 1 commit into from
Oct 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions src/effects/effectbuttonparameterslot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ void EffectButtonParameterSlot::clear() {
emit updated();
}

void EffectButtonParameterSlot::slotParameterValueChanged(double value) {
//qDebug() << debugString() << "slotParameterValueChanged" << value.toDouble();
m_pControlValue->set(value);
void EffectButtonParameterSlot::setParameter(double value) {
m_pControlValue->setParameterFrom(value, this);
}
4 changes: 1 addition & 3 deletions src/effects/effectbuttonparameterslot.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ class EffectButtonParameterSlot : public EffectParameterSlotBase {

void clear() override;

private slots:
// Solely for handling control changes
void slotParameterValueChanged(double value) override;
void setParameter(double value) override;

private:
QString debugString() const {
Expand Down
4 changes: 2 additions & 2 deletions src/effects/effectknobparameterslot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ void EffectKnobParameterSlot::clear() {
emit updated();
}

void EffectKnobParameterSlot::slotParameterValueChanged(double value) {
m_pControlValue->set(value);
void EffectKnobParameterSlot::setParameter(double value) {
m_pControlValue->setParameterFrom(value, this);
}

void EffectKnobParameterSlot::slotLinkTypeChanging(double v) {
Expand Down
3 changes: 2 additions & 1 deletion src/effects/effectknobparameterslot.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ class EffectKnobParameterSlot : public EffectParameterSlotBase {
// Clear the currently loaded effect
void clear() override;

void setParameter(double value) override;

private slots:
// Solely for handling control changes
void slotParameterValueChanged(double value) override;
void slotLinkTypeChanging(double v);
void slotLinkInverseChanged(double v);

Expand Down
3 changes: 2 additions & 1 deletion src/effects/effectparameterslotbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ class EffectParameterSlotBase : public QObject {
return m_iParameterSlotNumber;
}

virtual void setParameter(double value) = 0;

signals:
// Signal that indicates that the EffectParameterSlotBase has been updated.
void updated();

public slots:
// Solely for handling control changes
void slotValueChanged(double v);
virtual void slotParameterValueChanged(double value) = 0;

protected:
const unsigned int m_iParameterSlotNumber;
Expand Down
4 changes: 2 additions & 2 deletions src/preferences/dialog/dlgprefeq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ void DlgPrefEQ::slotUpdateMainEQParameter(int value) {

if (pParameterSlot->isLoaded()) {
double dValue = value / 100.0;
pParameterSlot->slotParameterValueChanged(dValue);
pParameterSlot->setParameter(dValue);
QLabel* valueLabel = m_mainEQValues[index];
QString valueText = QString::number(dValue);
valueLabel->setText(valueText);
Expand Down Expand Up @@ -709,7 +709,7 @@ void DlgPrefEQ::setMainEQParameter(int i, double value) {
EffectManifestParameter::ParameterType::Knob, i);

if (pParameterSlot->isLoaded()) {
pParameterSlot->slotParameterValueChanged(value);
pParameterSlot->setParameter(value);
m_mainEQSliders[i]->setValue(static_cast<int>(value * 100));

QLabel* valueLabel = m_mainEQValues[i];
Expand Down