summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-12-02 21:11:43 +0100
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-12-02 21:11:43 +0100
commitb207bd38e1574cb75315a2c66e7a598c22fc55ca (patch)
tree05b3a58ac8261e1f43a944018e48c15171032052 /src/control
parent8e18359de7cfc2521045671007ec6115c150dd55 (diff)
parent532b713e0e570083c8ecd5708942cacb66835838 (diff)
Merge branch '2.3' of github.com:mixxxdj/mixxx into cleanup-headers
Diffstat (limited to 'src/control')
-rw-r--r--src/control/control.cpp2
-rw-r--r--src/control/control.h2
-rw-r--r--src/control/controlaudiotaperpot.cpp8
-rw-r--r--src/control/controlaudiotaperpot.h2
-rw-r--r--src/control/controleffectknob.cpp2
-rw-r--r--src/control/controleffectknob.h2
-rw-r--r--src/control/controlencoder.cpp2
-rw-r--r--src/control/controlencoder.h2
-rw-r--r--src/control/controlindicator.cpp2
-rw-r--r--src/control/controlindicator.h2
-rw-r--r--src/control/controllinpotmeter.cpp10
-rw-r--r--src/control/controllinpotmeter.h8
-rw-r--r--src/control/controllogpotmeter.cpp4
-rw-r--r--src/control/controllogpotmeter.h2
-rw-r--r--src/control/controlobject.cpp7
-rw-r--r--src/control/controlobject.h8
-rw-r--r--src/control/controlobjectscript.cpp4
-rw-r--r--src/control/controlobjectscript.h2
-rw-r--r--src/control/controlpotmeter.cpp14
-rw-r--r--src/control/controlpotmeter.h14
-rw-r--r--src/control/controlpushbutton.cpp2
-rw-r--r--src/control/controlpushbutton.h2
-rw-r--r--src/control/controlttrotary.cpp3
-rw-r--r--src/control/controlttrotary.h2
24 files changed, 61 insertions, 47 deletions
diff --git a/src/control/control.cpp b/src/control/control.cpp
index 9b0ae2f9f9..6f988913f3 100644
--- a/src/control/control.cpp
+++ b/src/control/control.cpp
@@ -18,7 +18,7 @@ QHash<ConfigKey, ConfigKey> ControlDoublePrivate::s_qCOAliasHash
MMutex ControlDoublePrivate::s_qCOHashMutex;
ControlDoublePrivate::ControlDoublePrivate(
- ConfigKey key,
+ const ConfigKey& key,
ControlObject* pCreatorCO,
bool bIgnoreNops,
bool bTrack,
diff --git a/src/control/control.h b/src/control/control.h
index da89fafb06..9f2f89c395 100644
--- a/src/control/control.h
+++ b/src/control/control.h
@@ -160,7 +160,7 @@ class ControlDoublePrivate : public QObject {
private:
ControlDoublePrivate(
- ConfigKey key,
+ const ConfigKey& key,
ControlObject* pCreatorCO,
bool bIgnoreNops,
bool bTrack,
diff --git a/src/control/controlaudiotaperpot.cpp b/src/control/controlaudiotaperpot.cpp
index d0e55f4d38..9264b67774 100644
--- a/src/control/controlaudiotaperpot.cpp
+++ b/src/control/controlaudiotaperpot.cpp
@@ -1,11 +1,11 @@
#include "control/controlaudiotaperpot.h"
-ControlAudioTaperPot::ControlAudioTaperPot(ConfigKey key,
- double minDB, double maxDB,
- double neutralParameter)
+ControlAudioTaperPot::ControlAudioTaperPot(const ConfigKey& key,
+ double minDB,
+ double maxDB,
+ double neutralParameter)
: ControlPotmeter(key) {
-
// Override ControlPotmeters default value of 0.5
setDefaultValue(1.0);
set(1.0);
diff --git a/src/control/controlaudiotaperpot.h b/src/control/controlaudiotaperpot.h
index 6c01567c45..e61f283594 100644
--- a/src/control/controlaudiotaperpot.h
+++ b/src/control/controlaudiotaperpot.h
@@ -11,5 +11,5 @@ class ControlAudioTaperPot : public ControlPotmeter {
// minDB is the Start value of the pure db scale it cranked to -Infinity by the linear part of the AudioTaperPot
// maxDB is the Upper gain Value
// neutralParameter is a knob position between 0 and 1 where the gain is 1 (0dB)
- ControlAudioTaperPot(ConfigKey key, double minDB, double maxDB, double neutralParameter);
+ ControlAudioTaperPot(const ConfigKey& key, double minDB, double maxDB, double neutralParameter);
};
diff --git a/src/control/controleffectknob.cpp b/src/control/controleffectknob.cpp
index 169cade841..cf01306458 100644
--- a/src/control/controleffectknob.cpp
+++ b/src/control/controleffectknob.cpp
@@ -3,7 +3,7 @@
#include "util/math.h"
#include "effects/effectmanifestparameter.h"
-ControlEffectKnob::ControlEffectKnob(ConfigKey key, double dMinValue, double dMaxValue)
+ControlEffectKnob::ControlEffectKnob(const ConfigKey& key, double dMinValue, double dMaxValue)
: ControlPotmeter(key, dMinValue, dMaxValue) {
}
diff --git a/src/control/controleffectknob.h b/src/control/controleffectknob.h
index d46918ff6f..43e7cc3720 100644
--- a/src/control/controleffectknob.h
+++ b/src/control/controleffectknob.h
@@ -6,7 +6,7 @@
class ControlEffectKnob : public ControlPotmeter {
Q_OBJECT
public:
- ControlEffectKnob(ConfigKey key, double dMinValue = 0.0, double dMaxValue = 1.0);
+ ControlEffectKnob(const ConfigKey& key, double dMinValue = 0.0, double dMaxValue = 1.0);
void setBehaviour(EffectManifestParameter::ControlHint type,
double dMinValue, double dMaxValue);
diff --git a/src/control/controlencoder.cpp b/src/control/controlencoder.cpp
index be6778c915..3dd146a6e9 100644
--- a/src/control/controlencoder.cpp
+++ b/src/control/controlencoder.cpp
@@ -1,6 +1,6 @@
#include "control/controlencoder.h"
-ControlEncoder::ControlEncoder(ConfigKey key, bool bIgnoreNops)
+ControlEncoder::ControlEncoder(const ConfigKey& key, bool bIgnoreNops)
: ControlObject(key, bIgnoreNops) {
if (m_pControl) {
m_pControl->setBehavior(new ControlEncoderBehavior());
diff --git a/src/control/controlencoder.h b/src/control/controlencoder.h
index bbfc14523d..75b2cb2015 100644
--- a/src/control/controlencoder.h
+++ b/src/control/controlencoder.h
@@ -6,5 +6,5 @@
class ControlEncoder : public ControlObject {
Q_OBJECT
public:
- ControlEncoder(ConfigKey key, bool bIgnoreNops=true);
+ ControlEncoder(const ConfigKey& key, bool bIgnoreNops = true);
};
diff --git a/src/control/controlindicator.cpp b/src/control/controlindicator.cpp
index 1109f2b971..2d655b02b0 100644
--- a/src/control/controlindicator.cpp
+++ b/src/control/controlindicator.cpp
@@ -2,7 +2,7 @@
#include "control/controlproxy.h"
#include "util/math.h"
-ControlIndicator::ControlIndicator(ConfigKey key)
+ControlIndicator::ControlIndicator(const ConfigKey& key)
: ControlObject(key, false),
m_blinkValue(OFF),
m_nextSwitchTime(0.0) {
diff --git a/src/control/controlindicator.h b/src/control/controlindicator.h
index a232683074..3cfbead987 100644
--- a/src/control/controlindicator.h
+++ b/src/control/controlindicator.h
@@ -14,7 +14,7 @@ class ControlIndicator : public ControlObject {
RATIO1TO1_250MS = 3, // used for Pioneer cue
};
- ControlIndicator(ConfigKey key);
+ ControlIndicator(const ConfigKey& key);
virtual ~ControlIndicator();
void setBlinkValue(enum BlinkValue bv);
diff --git a/src/control/controllinpotmeter.cpp b/src/control/controllinpotmeter.cpp
index c3ab24cca5..deaa65f91a 100644
--- a/src/control/controllinpotmeter.cpp
+++ b/src/control/controllinpotmeter.cpp
@@ -1,9 +1,11 @@
#include "control/controllinpotmeter.h"
-ControlLinPotmeter::ControlLinPotmeter(ConfigKey key,
- double dMinValue, double dMaxValue,
- double dStep, double dSmallStep,
- bool allowOutOfBounds)
+ControlLinPotmeter::ControlLinPotmeter(const ConfigKey& key,
+ double dMinValue,
+ double dMaxValue,
+ double dStep,
+ double dSmallStep,
+ bool allowOutOfBounds)
: ControlPotmeter(key, dMinValue, dMaxValue, allowOutOfBounds) {
if (m_pControl) {
m_pControl->setBehavior(
diff --git a/src/control/controllinpotmeter.h b/src/control/controllinpotmeter.h
index acbb1b50bb..bf6d8d4997 100644
--- a/src/control/controllinpotmeter.h
+++ b/src/control/controllinpotmeter.h
@@ -6,8 +6,10 @@ class ControlLinPotmeter : public ControlPotmeter {
Q_OBJECT
public:
// dStep = 0 and dSmallStep = 0 defaults to 10 and 100 steps
- ControlLinPotmeter(ConfigKey key,
- double dMinValue = 0.0, double dMaxValue = 1.0,
- double dStep = 0, double dSmallStep = 0,
+ ControlLinPotmeter(const ConfigKey& key,
+ double dMinValue = 0.0,
+ double dMaxValue = 1.0,
+ double dStep = 0,
+ double dSmallStep = 0,
bool allowOutOfBounds = false);
};
diff --git a/src/control/controllogpotmeter.cpp b/src/control/controllogpotmeter.cpp
index 99784b7d1d..724d9c4b4a 100644
--- a/src/control/controllogpotmeter.cpp
+++ b/src/control/controllogpotmeter.cpp
@@ -1,7 +1,7 @@
#include "control/controllogpotmeter.h"
-ControlLogpotmeter::ControlLogpotmeter(ConfigKey key, double dMaxValue, double minDB)
- : ControlPotmeter(key, 0, dMaxValue) {
+ControlLogpotmeter::ControlLogpotmeter(const ConfigKey& key, double dMaxValue, double minDB)
+ : ControlPotmeter(key, 0, dMaxValue) {
// Override ControlPotmeters default value of 0.5
setDefaultValue(1.0);
set(1.0);
diff --git a/src/control/controllogpotmeter.h b/src/control/controllogpotmeter.h
index b7e551da4e..5d5a04cc2f 100644
--- a/src/control/controllogpotmeter.h
+++ b/src/control/controllogpotmeter.h
@@ -6,5 +6,5 @@
class ControlLogpotmeter : public ControlPotmeter {
Q_OBJECT
public:
- ControlLogpotmeter(ConfigKey key, double dMaxValue, double minDB);
+ ControlLogpotmeter(const ConfigKey& key, double dMaxValue, double minDB);
};
diff --git a/src/control/controlobject.cpp b/src/control/controlobject.cpp
index 500a938485..9a21944b15 100644
--- a/src/control/controlobject.cpp
+++ b/src/control/controlobject.cpp
@@ -11,8 +11,11 @@
ControlObject::ControlObject() {
}
-ControlObject::ControlObject(ConfigKey key, bool bIgnoreNops, bool bTrack,
- bool bPersist, double defaultValue)
+ControlObject::ControlObject(const ConfigKey& key,
+ bool bIgnoreNops,
+ bool bTrack,
+ bool bPersist,
+ double defaultValue)
: m_key(key) {
// Don't bother looking up the control if key is invalid. Prevents log spew.
if (m_key.isValid()) {
diff --git a/src/control/controlobject.h b/src/control/controlobject.h
index 79cccba3ef..cfd2dd39d5 100644
--- a/src/control/controlobject.h
+++ b/src/control/controlobject.h
@@ -18,9 +18,11 @@ class ControlObject : public QObject {
// bPersist: Store value on exit, load on startup.
// defaultValue: default value of CO. If CO is persistent and there is no valid
// value found in the config, this is also the initial value.
- ControlObject(ConfigKey key,
- bool bIgnoreNops = true, bool bTrack = false,
- bool bPersist = false, double defaultValue = 0.0);
+ ControlObject(const ConfigKey& key,
+ bool bIgnoreNops = true,
+ bool bTrack = false,
+ bool bPersist = false,
+ double defaultValue = 0.0);
virtual ~ControlObject();
// Returns a pointer to the ControlObject matching the given ConfigKey
diff --git a/src/control/controlobjectscript.cpp b/src/control/controlobjectscript.cpp
index 429a4d0230..ae6438e87e 100644
--- a/src/control/controlobjectscript.cpp
+++ b/src/control/controlobjectscript.cpp
@@ -66,7 +66,7 @@ bool ControlObjectScript::removeScriptConnection(const ScriptConnection& conn) {
void ControlObjectScript::disconnectAllConnectionsToFunction(const QScriptValue& function) {
// Make a local copy of m_scriptConnections because items are removed within the loop.
- const QList<ScriptConnection> connections = m_scriptConnections;
+ const QVector<ScriptConnection> connections = m_scriptConnections;
for (const auto& conn: connections) {
if (conn.callback.strictlyEquals(function)) {
removeScriptConnection(conn);
@@ -79,7 +79,7 @@ void ControlObjectScript::slotValueChanged(double value, QObject*) {
// This allows a script to disconnect a callback from inside the
// the callback. Otherwise the this may crash since the disconnect call
// happens during conn.function.call() in the middle of the loop below.
- const QList<ScriptConnection> connections = m_scriptConnections;
+ const QVector<ScriptConnection> connections = m_scriptConnections;
for (auto&& conn: connections) {
conn.executeCallback(value);
}
diff --git a/src/control/controlobjectscript.h b/src/control/controlobjectscript.h
index c190698bae..2aac51ae62 100644
--- a/src/control/controlobjectscript.h
+++ b/src/control/controlobjectscript.h
@@ -37,5 +37,5 @@ class ControlObjectScript : public ControlProxy {
void slotValueChanged(double v, QObject*);
private:
- QList<ScriptConnection> m_scriptConnections;
+ QVector<ScriptConnection> m_scriptConnections;
};
diff --git a/src/control/controlpotmeter.cpp b/src/control/controlpotmeter.cpp
index 9d3948ed78..989ac9f8bb 100644
--- a/src/control/controlpotmeter.cpp
+++ b/src/control/controlpotmeter.cpp
@@ -2,12 +2,14 @@
#include "control/controlpotmeter.h"
#include "control/controlproxy.h"
-ControlPotmeter::ControlPotmeter(ConfigKey key, double dMinValue, double dMaxValue,
- bool allowOutOfBounds,
- bool bIgnoreNops,
- bool bTrack,
- bool bPersist,
- double defaultValue)
+ControlPotmeter::ControlPotmeter(const ConfigKey& key,
+ double dMinValue,
+ double dMaxValue,
+ bool allowOutOfBounds,
+ bool bIgnoreNops,
+ bool bTrack,
+ bool bPersist,
+ double defaultValue)
: ControlObject(key, bIgnoreNops, bTrack, bPersist, defaultValue),
m_controls(key) {
setRange(dMinValue, dMaxValue, allowOutOfBounds);
diff --git a/src/control/controlpotmeter.h b/src/control/controlpotmeter.h
index acbefc7439..1913513b91 100644
--- a/src/control/controlpotmeter.h
+++ b/src/control/controlpotmeter.h
@@ -51,12 +51,14 @@ class PotmeterControls : public QObject {
class ControlPotmeter : public ControlObject {
Q_OBJECT
public:
- ControlPotmeter(ConfigKey key, double dMinValue = 0.0, double dMaxValue = 1.0,
- bool allowOutOfBounds = false,
- bool bIgnoreNops = true,
- bool bTrack = false,
- bool bPersist = false,
- double defaultValue = 0.0);
+ ControlPotmeter(const ConfigKey& key,
+ double dMinValue = 0.0,
+ double dMaxValue = 1.0,
+ bool allowOutOfBounds = false,
+ bool bIgnoreNops = true,
+ bool bTrack = false,
+ bool bPersist = false,
+ double defaultValue = 0.0);
virtual ~ControlPotmeter();
// Sets the step count of the associated PushButtons.
diff --git a/src/control/controlpushbutton.cpp b/src/control/controlpushbutton.cpp
index 119d20433d..dec730f2eb 100644
--- a/src/control/controlpushbutton.cpp
+++ b/src/control/controlpushbutton.cpp
@@ -4,7 +4,7 @@
Purpose: Creates a new simulated latching push-button.
Input: key - Key for the configuration file
-------- ------------------------------------------------------ */
-ControlPushButton::ControlPushButton(ConfigKey key, bool bPersist, double defaultValue)
+ControlPushButton::ControlPushButton(const ConfigKey& key, bool bPersist, double defaultValue)
: ControlObject(key, false, false, bPersist, defaultValue),
m_buttonMode(PUSH),
m_iNoStates(2) {
diff --git a/src/control/controlpushbutton.h b/src/control/controlpushbutton.h
index 408ee217b5..d523ee5329 100644
--- a/src/control/controlpushbutton.h
+++ b/src/control/controlpushbutton.h
@@ -52,7 +52,7 @@ class ControlPushButton : public ControlObject {
}
}
- ControlPushButton(ConfigKey key, bool bPersist = false, double defaultValue = 0.0);
+ ControlPushButton(const ConfigKey& key, bool bPersist = false, double defaultValue = 0.0);
virtual ~ControlPushButton();
inline ButtonMode getButtonMode() const {
diff --git a/src/control/controlttrotary.cpp b/src/control/controlttrotary.cpp
index 7da1c99b24..654b1b494a 100644
--- a/src/control/controlttrotary.cpp
+++ b/src/control/controlttrotary.cpp
@@ -4,7 +4,8 @@
Purpose: Creates a new rotary encoder
Input: key
-------- ------------------------------------------------------ */
-ControlTTRotary::ControlTTRotary(ConfigKey key) : ControlObject(key) {
+ControlTTRotary::ControlTTRotary(const ConfigKey& key)
+ : ControlObject(key) {
if (m_pControl) {
m_pControl->setBehavior(
new ControlTTRotaryBehavior());
diff --git a/src/control/controlttrotary.h b/src/control/controlttrotary.h
index af495cc239..ee132fed30 100644
--- a/src/control/controlttrotary.h
+++ b/src/control/controlttrotary.h
@@ -6,5 +6,5 @@
class ControlTTRotary : public ControlObject {
Q_OBJECT
public:
- ControlTTRotary(ConfigKey key);
+ ControlTTRotary(const ConfigKey& key);
};