diff options
author | Sean M. Pappalardo <pegasus@renegadetech.com> | 2015-12-09 17:38:59 -0800 |
---|---|---|
committer | Sean M. Pappalardo <pegasus@renegadetech.com> | 2015-12-11 07:40:49 -0800 |
commit | 0f21e54330fc3787028d6e2e9ff9858ed1a9da48 (patch) | |
tree | bd83f45fd574acdbf42b0f9d209bdb1ae6566552 /src/controllers | |
parent | e4024b4c2a01e65e3bf2f1d386f5bc71f9d96b6f (diff) |
Cherry-picked a second commit from st_fix to fix my mess.
Diffstat (limited to 'src/controllers')
-rw-r--r-- | src/controllers/controllerengine.cpp | 5 | ||||
-rw-r--r-- | src/controllers/controllerengine.h | 2 | ||||
-rw-r--r-- | src/controllers/softtakeover.cpp | 6 | ||||
-rw-r--r-- | src/controllers/softtakeover.h | 5 |
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); |