summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRJ Ryan <rryan@mixxx.org>2014-03-28 10:13:50 -0400
committerRJ Ryan <rryan@mixxx.org>2014-03-28 10:13:50 -0400
commitf2516816592905e87def8c00eae33f1a4757eecb (patch)
treef640771db9cf12bf95105bdc3747b5a8f40e7268
parent45bcb3e62c162aaea9408cc41dd0629aef85b9c9 (diff)
Some minor cleanups to ControlEffectKnob.
-rw-r--r--src/controleffectknob.cpp12
-rw-r--r--src/controleffectknob.h7
-rw-r--r--src/effects/effectparameterslot.cpp4
-rw-r--r--src/widget/knobeventhandler.h2
4 files changed, 13 insertions, 12 deletions
diff --git a/src/controleffectknob.cpp b/src/controleffectknob.cpp
index 6b8429a09e..7b302c279f 100644
--- a/src/controleffectknob.cpp
+++ b/src/controleffectknob.cpp
@@ -5,24 +5,24 @@
ControlEffectKnob::ControlEffectKnob(ConfigKey key, double dMinValue, double dMaxValue)
: ControlPotmeter(key, dMinValue, dMaxValue),
- m_type(0.0) {
+ m_type(EffectManifestParameter::CONTROL_KNOB_LINEAR) {
if (m_pControl) {
m_pControl->setBehavior(
new ControlLinPotmeterBehavior(dMinValue, dMaxValue));
}
}
-void ControlEffectKnob::setType(double v) {
- if (v == m_type || m_pControl == NULL) {
+void ControlEffectKnob::setType(EffectManifestParameter::ControlHint type) {
+ if (type == m_type || m_pControl == NULL) {
return;
}
- if (v == EffectManifestParameter::CONTROL_KNOB_LINEAR) {
+ if (type == EffectManifestParameter::CONTROL_KNOB_LINEAR) {
m_pControl->setBehavior(
new ControlLinPotmeterBehavior(m_dMinValue, m_dMaxValue));
- } else if (v == EffectManifestParameter::CONTROL_KNOB_LOGARITHMIC) {
+ } else if (type == EffectManifestParameter::CONTROL_KNOB_LOGARITHMIC) {
m_pControl->setBehavior(
new ControlLogPotmeterBehavior(m_dMinValue, m_dMaxValue));
}
- m_type = v;
+ m_type = type;
}
diff --git a/src/controleffectknob.h b/src/controleffectknob.h
index 792352e064..1266b830bc 100644
--- a/src/controleffectknob.h
+++ b/src/controleffectknob.h
@@ -2,14 +2,17 @@
#define CONTROLEFFECTKNOB_H
#include "controlpotmeter.h"
+#include "effects/effectmanifestparameter.h"
class ControlEffectKnob : public ControlPotmeter {
Q_OBJECT
public:
ControlEffectKnob(ConfigKey key, double dMinValue = 0.0, double dMaxValue = 1.0);
- void setType(double type);
+
+ void setType(EffectManifestParameter::ControlHint type);
+
private:
- double m_type;
+ EffectManifestParameter::ControlHint m_type;
};
#endif // CONTROLLEFFECTKNOB_H
diff --git a/src/effects/effectparameterslot.cpp b/src/effects/effectparameterslot.cpp
index 5de58ab986..c2905ca9b8 100644
--- a/src/effects/effectparameterslot.cpp
+++ b/src/effects/effectparameterslot.cpp
@@ -97,10 +97,10 @@ void EffectParameterSlot::loadEffect(EffectPointer pEffect) {
m_pControlValue->set(dValue);
m_pControlValue->setDefaultValue(dDefault);
m_pControlValue->setRange(dMinimum, dMaximum, false);
- double type = m_pEffectParameter->getControlHint();
+ EffectManifestParameter::ControlHint type = m_pEffectParameter->getControlHint();
m_pControlValue->setType(type);
// TODO(rryan) expose this from EffectParameter
- m_pControlType->setAndConfirm(type);
+ m_pControlType->setAndConfirm(static_cast<double>(type));
// Default loaded parameters to loaded and unlinked
m_pControlLoaded->setAndConfirm(1.0);
m_pControlLinkType->set(m_pEffectParameter->getLinkType());
diff --git a/src/widget/knobeventhandler.h b/src/widget/knobeventhandler.h
index 8e64c7296c..d457af5442 100644
--- a/src/widget/knobeventhandler.h
+++ b/src/widget/knobeventhandler.h
@@ -91,8 +91,6 @@ class KnobEventHandler {
// Clamp to [0.0, 1.0]
newValue = math_max(0.0, math_min(1.0, newValue));
- qDebug() << "newValue" << newValue;
-
pWidget->setControlParameter(newValue);
pWidget->update();
e->accept();