summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean M. Pappalardo <pegasus@renegadetech.com>2015-12-09 17:38:59 -0800
committerSean M. Pappalardo <pegasus@renegadetech.com>2015-12-11 07:40:49 -0800
commit0f21e54330fc3787028d6e2e9ff9858ed1a9da48 (patch)
treebd83f45fd574acdbf42b0f9d209bdb1ae6566552
parente4024b4c2a01e65e3bf2f1d386f5bc71f9d96b6f (diff)
Cherry-picked a second commit from st_fix to fix my mess.
-rw-r--r--res/controllers/American-Audio-VMS4-scripts.js6
-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
5 files changed, 14 insertions, 10 deletions
diff --git a/res/controllers/American-Audio-VMS4-scripts.js b/res/controllers/American-Audio-VMS4-scripts.js
index bdc316c998..fdedcf8a88 100644
--- a/res/controllers/American-Audio-VMS4-scripts.js
+++ b/res/controllers/American-Audio-VMS4-scripts.js
@@ -228,7 +228,6 @@ VMS4.Deck.prototype.keyLockButtonHandler = function(value) {
}
VMS4.Deck.prototype.effectParamButtonHandler = function(value) {
-// // Reset pitch only on entrance to center position
// if(value == ButtonState.pressed) {
// this.controlEffectParameter=!this.controlEffectParameter;
// if (this.controlEffectParameter) {
@@ -342,7 +341,6 @@ VMS4.effectControl = function(channel, control, value, status, group) {
VMS4.effectParameterButton = function(channel, control, value, status, group) {
var deck = VMS4.GetDeck(group);
// deck.Buttons.FXParam.handleEvent(group, value);
- // Reset pitch only on entrance to center position
if(value > 0x40) {
var deckNum = VMS4.GetDeckNum(group);
deck.controlEffectParameter=!deck.controlEffectParameter;
@@ -350,13 +348,13 @@ VMS4.effectParameterButton = function(channel, control, value, status, group) {
// Super knob
deck.Buttons.FXParam.setLed(LedState.on);
// Ignore the next wet/dry value
- engine.softTakeoverIgnoreNext("[EffectRack1_EffectUnit"+deckNum+"]","mix");
+ engine.softTakeoverIgnoreNextValue("[EffectRack1_EffectUnit"+deckNum+"]","mix");
}
else {
// Wet/dry
deck.Buttons.FXParam.setLed(LedState.off);
// Ignore the next Super knob value
- engine.softTakeoverIgnoreNext("[EffectRack1_EffectUnit"+deckNum+"]","super1");
+ engine.softTakeoverIgnoreNextValue("[EffectRack1_EffectUnit"+deckNum+"]","super1");
}
}
}
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);