summaryrefslogtreecommitdiffstats
path: root/src/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'src/controllers')
-rw-r--r--src/controllers/controllerengine.cpp5
-rw-r--r--src/controllers/controllerengine.h2
-rw-r--r--src/controllers/softtakeover.cpp6
-rw-r--r--src/controllers/softtakeover.h5
4 files changed, 12 insertions, 6 deletions
diff --git a/src/controllers/controllerengine.cpp b/src/controllers/controllerengine.cpp
index 7e25c7a28f..301ffe7b97 100644
--- a/src/controllers/controllerengine.cpp
+++ b/src/controllers/controllerengine.cpp
@@ -1442,11 +1442,12 @@ void ControllerEngine::softTakeover(QString group, QString name, bool set) {
/* -------- ------------------------------------------------------
Purpose: Ignores the next value for the given ControlObject
This is used when an absolute physical control is changed to
- to operate on a different ControlObject
+ to operate on a different ControlObject, allowing it to sync up
+ to the soft-takeover state without an abrupt jump.
Input: ControlObject group and key values
Output: -
-------- ------------------------------------------------------ */
-void ControllerEngine::softTakeoverIgnoreNext(QString group, QString name) {
+void ControllerEngine::softTakeoverIgnoreNextValue(QString group, QString name) {
ControlObject* pControl = ControlObject::getControl(ConfigKey(group, name));
if (!pControl) {
return;
diff --git a/src/controllers/controllerengine.h b/src/controllers/controllerengine.h
index 8c4ca6886d..02658dd0cb 100644
--- a/src/controllers/controllerengine.h
+++ b/src/controllers/controllerengine.h
@@ -107,7 +107,7 @@ class ControllerEngine : public QObject {
Q_INVOKABLE void scratchDisable(int deck, bool ramp = true);
Q_INVOKABLE bool isScratching(int deck);
Q_INVOKABLE void softTakeover(QString group, QString name, bool set);
- Q_INVOKABLE void softTakeoverIgnoreNext(QString group, QString name);
+ Q_INVOKABLE void softTakeoverIgnoreNextValue(QString group, QString name);
Q_INVOKABLE void brake(int deck, bool activate, double factor=0.9, double rate=1.0);
Q_INVOKABLE void spinback(int deck, bool activate, double factor=1.8, double rate=-10.0);
diff --git a/src/controllers/softtakeover.cpp b/src/controllers/softtakeover.cpp
index ad3b4e73ea..159eb4c483 100644
--- a/src/controllers/softtakeover.cpp
+++ b/src/controllers/softtakeover.cpp
@@ -13,6 +13,12 @@
#include "util/math.h"
#include "util/time.h"
+// 3/128 units away from the current is enough to catch fast non-sequential moves
+// but not cause an audibly noticeable jump, determined experimentally with
+// slow-refresh controllers.
+const double SoftTakeover::kDefaultTakeoverThreshold = 3.0 / 128;
+
+
SoftTakeoverCtrl::SoftTakeoverCtrl() {
}
diff --git a/src/controllers/softtakeover.h b/src/controllers/softtakeover.h
index db5bdbb34a..49dace8c46 100644
--- a/src/controllers/softtakeover.h
+++ b/src/controllers/softtakeover.h
@@ -15,9 +15,8 @@ class ControlObject;
class SoftTakeover {
public:
- // 3/128 units away from the current is enough to catch fast non-sequential moves
- // but not cause an audibly noticeable jump.
- static const double kDefaultTakeoverThreshold = 3.0 / 128;
+ // I would initialize it here but that's C++11 coolness. (Because it's a double.)
+ static const double kDefaultTakeoverThreshold;
SoftTakeover();
bool ignore(ControlObject* control, double newParameter);