summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Easton <Mixxx@ShelobsLair.net>2016-01-27 00:06:35 +0000
committerCraig Easton <Mixxx@ShelobsLair.net>2016-01-27 00:06:35 +0000
commitdfac9cb79485c6978cedaa294b8b11f9a5c5225a (patch)
treead2f86d0440cb3cd8d0a8106721e599d551bdc5a
parent87a8afa6af4ccdab022dd6c47772d45a1bf070a9 (diff)
BehringerCMDStudio4a mapping v1.4
Consolodated the pitch inc/dec functions.
-rw-r--r--res/controllers/Behringer CMDStudio4a.midi.xml32
-rw-r--r--res/controllers/Behringer-CMDStudio4a-scripts.js67
2 files changed, 34 insertions, 65 deletions
diff --git a/res/controllers/Behringer CMDStudio4a.midi.xml b/res/controllers/Behringer CMDStudio4a.midi.xml
index e0695364f0..ba51a19a80 100644
--- a/res/controllers/Behringer CMDStudio4a.midi.xml
+++ b/res/controllers/Behringer CMDStudio4a.midi.xml
@@ -828,7 +828,7 @@
<!-- Pitch stuff.-->
<control>
<group>[Channel1]</group>
- <key>BehringerCMDStudio4a.pitchDec</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck A pitch- push.</description>
<status>0x90</status>
<midino>0x20</midino>
@@ -838,7 +838,7 @@
</control>
<control>
<group>[Channel1]</group>
- <key>BehringerCMDStudio4a.pitchDec</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck A pitch- release.</description>
<status>0x80</status>
<midino>0x20</midino>
@@ -848,7 +848,7 @@
</control>
<control>
<group>[Channel1]</group>
- <key>BehringerCMDStudio4a.pitchInc</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck A pitch+ push.</description>
<status>0x90</status>
<midino>0x21</midino>
@@ -858,7 +858,7 @@
</control>
<control>
<group>[Channel1]</group>
- <key>BehringerCMDStudio4a.pitchInc</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck A pitch+ release.</description>
<status>0x80</status>
<midino>0x21</midino>
@@ -868,7 +868,7 @@
</control>
<control>
<group>[Channel2]</group>
- <key>BehringerCMDStudio4a.pitchDec</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck B pitch- push.</description>
<status>0x91</status>
<midino>0x40</midino>
@@ -878,7 +878,7 @@
</control>
<control>
<group>[Channel2]</group>
- <key>BehringerCMDStudio4a.pitchDec</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck B pitch- release.</description>
<status>0x81</status>
<midino>0x40</midino>
@@ -888,7 +888,7 @@
</control>
<control>
<group>[Channel2]</group>
- <key>BehringerCMDStudio4a.pitchInc</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck B pitch+ push.</description>
<status>0x91</status>
<midino>0x41</midino>
@@ -898,7 +898,7 @@
</control>
<control>
<group>[Channel2]</group>
- <key>BehringerCMDStudio4a.pitchInc</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck B pitch+ release.</description>
<status>0x81</status>
<midino>0x41</midino>
@@ -908,7 +908,7 @@
</control>
<control>
<group>[Channel3]</group>
- <key>BehringerCMDStudio4a.pitchDec</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck C pitch- push.</description>
<status>0x92</status>
<midino>0x20</midino>
@@ -918,7 +918,7 @@
</control>
<control>
<group>[Channel3]</group>
- <key>BehringerCMDStudio4a.pitchDec</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck C pitch- release.</description>
<status>0x82</status>
<midino>0x20</midino>
@@ -928,7 +928,7 @@
</control>
<control>
<group>[Channel3]</group>
- <key>BehringerCMDStudio4a.pitchInc</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck C pitch+ push.</description>
<status>0x92</status>
<midino>0x21</midino>
@@ -938,7 +938,7 @@
</control>
<control>
<group>[Channel3]</group>
- <key>BehringerCMDStudio4a.pitchInc</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck C pitch+ release.</description>
<status>0x82</status>
<midino>0x21</midino>
@@ -948,7 +948,7 @@
</control>
<control>
<group>[Channel4]</group>
- <key>BehringerCMDStudio4a.pitchDec</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck D pitch- push.</description>
<status>0x93</status>
<midino>0x40</midino>
@@ -958,7 +958,7 @@
</control>
<control>
<group>[Channel4]</group>
- <key>BehringerCMDStudio4a.pitchDec</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck D pitch- release.</description>
<status>0x83</status>
<midino>0x40</midino>
@@ -968,7 +968,7 @@
</control>
<control>
<group>[Channel4]</group>
- <key>BehringerCMDStudio4a.pitchInc</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck D pitch+ push.</description>
<status>0x93</status>
<midino>0x41</midino>
@@ -978,7 +978,7 @@
</control>
<control>
<group>[Channel4]</group>
- <key>BehringerCMDStudio4a.pitchInc</key>
+ <key>BehringerCMDStudio4a.pitch</key>
<description>Deck D pitch+ release.</description>
<status>0x83</status>
<midino>0x41</midino>
diff --git a/res/controllers/Behringer-CMDStudio4a-scripts.js b/res/controllers/Behringer-CMDStudio4a-scripts.js
index 240bcef2f5..da0b468fe4 100644
--- a/res/controllers/Behringer-CMDStudio4a-scripts.js
+++ b/res/controllers/Behringer-CMDStudio4a-scripts.js
@@ -26,8 +26,7 @@ BehringerCMDStudio4a.delButtonState = [false,false,false,false];
BehringerCMDStudio4a.scratchButtonState = [false,false,false,false];
// Button push/release state variables.
-BehringerCMDStudio4a.pitchDecPushed = [false,false,false,false];
-BehringerCMDStudio4a.pitchIncPushed = [false,false,false,false];
+BehringerCMDStudio4a.pitchPushed = [[false,false,false,false], [false,false,false,false]];
BehringerCMDStudio4a.delPushed = false;
BehringerCMDStudio4a.delShiftUsed = false;
BehringerCMDStudio4a.fxAssignPushed = false;
@@ -208,7 +207,7 @@ BehringerCMDStudio4a.hotcue = function (channel, control, value, status, group)
// turn it on directly here, the only work-around I could
// think of was to create a (very short) timed call-back
// to turn it off!
- // Raised bug about this.
+ // Raised bug about this:
// https://bugs.launchpad.net/mixxx/+bug/1538200
// Changed timer from 50 to 100 after the pathology of this
// bug was explined in the bug report.
@@ -223,56 +222,26 @@ BehringerCMDStudio4a.hotcue = function (channel, control, value, status, group)
}
// Functions to deal with the pitch inc/dec buttons, (because they have a DEL-mode behaviour).
-BehringerCMDStudio4a.pitchDec = function (channel, control, value, status, group) {
+BehringerCMDStudio4a.pitch = function (channel, control, value, status, group) {
+ // Work out the direction.
+ var direction = ((control & 0x01) == 0) ? "down" : "up";
+ // Work out the type (and join) by looking at the DEL button state.
+ var type = BehringerCMDStudio4a.delButtonState[channel] ? "pitch" : "rate";
+ var join = BehringerCMDStudio4a.delButtonState[channel] ? "" : "_perm";
+ // Pushed or released?
if (value == 127) {
// Button pushed.
- BehringerCMDStudio4a.pitchDecPushed[channel] = true;
- if (BehringerCMDStudio4a.delButtonState[channel]) {
- // DEL mode is active, do "key" changes instead.
- // Check if the other button is pressed too, if so we reset the pitch.
- if (BehringerCMDStudio4a.pitchIncPushed[channel]) {
- engine.setValue(group, "pitch", 0);
- } else {
- engine.setValue(group, "pitch_down", 1);
- }
- } else {
- // DEL-mode is not active, just do "rate" changes.
- engine.setValue(group, "rate_perm_down", 1);
- // Check if the other button is pressed too, if so we reset the rate.
- if (BehringerCMDStudio4a.pitchIncPushed[channel]) {
- engine.setValue(group, "rate", 0);
- }
- }
- } else {
- // Button released.
- BehringerCMDStudio4a.pitchDecPushed[channel] = false;
- engine.setValue(group, "rate_perm_down", 0); // Keeps the UI in sync with the button state.
- }
-}
-BehringerCMDStudio4a.pitchInc = function (channel, control, value, status, group) {
- if (value == 127) {
- // Button pushed.
- BehringerCMDStudio4a.pitchIncPushed[channel] = true;
- if (BehringerCMDStudio4a.delButtonState[channel]) {
- // DEL-mode is active, do "key" changes instead.
- // Check if the other button is pressed too, if so we reset the pitch.
- if (BehringerCMDStudio4a.pitchDecPushed[channel]) {
- engine.setValue(group, "pitch", 0);
- } else {
- engine.setValue(group, "pitch_up", 1);
- }
- } else {
- // DEL-mode is not active, just do "rate" changes.
- engine.setValue(group, "rate_perm_up", 1);
- // Check if the other button is pressed too, if so we reset the rate.
- if (BehringerCMDStudio4a.pitchDecPushed[channel]) {
- engine.setValue(group, "rate", 0);
- }
- }
+ BehringerCMDStudio4a.pitchPushed[control & 0x01][channel] = true;
+ // Is the other button pushed too?
+ if (BehringerCMDStudio4a.pitchPushed[(~control) & 0x01][channel]) {
+ engine.setValue(group, type, 0); // Yep! reset the control.
+ } else {
+ engine.setValue(group, type+join+"_"+direction, 1);
+ }
} else {
// Button released.
- BehringerCMDStudio4a.pitchIncPushed[channel] = false;
- engine.setValue(group, "rate_perm_up", 0); // Keeps the UI in sync with the button state.
+ BehringerCMDStudio4a.pitchPushed[control & 0x01][channel] = false;
+ engine.setValue(group, "rate_perm_"+direction, 0); // Keeps the UI in sync with the button state.
}
}