midi.sendShortMsg(0x80+channel,0x1B,0); // turn off the "control" mode button
midi.sendShortMsg(0x80+channel,0x1C,0); // turn off the "browse" mode button
StantonSCS1d.pitchChange(engine.getValue("[Channel"+StantonSCS1d.deck+"]","rate")); // So the platter speed is updated and it begins spinning if applicable
return;
}
}
// (Dis)connects the appropriate Mixxx control signals to/from functions based on the currently controlled deck and what mode the encoder knobs are in
StantonSCS1d.connectKnobSignals = function (channel, disconnect) {
var signalList = StantonSCS1d.knobSignals[StantonSCS1d.knobMode["[Channel"+StantonSCS1d.deck+"]"]-1];
for (var i=0; i<signalList.length; i++) {
var group = signalList[i][0];
if (group=="CurrentChannel") group = "[Channel"+StantonSCS1d.deck+"]";
var currentlyPlaying = engine.getValue("[Channel"+StantonSCS1d.deck+"]","play");
if (currentlyPlaying && engine.getValue("[Channel"+StantonSCS1d.deck+"]","cue_default")==1) engine.setValue("[Channel"+StantonSCS1d.deck+"]","cue_default",0);
if (StantonSCS1d.padPoints[deck][bank][0x20+i] != -0.1) {
var trackTime = ((StantonSCS1d.padPoints[deck][bank][0x20+i] * StantonSCS1d.trackDuration[deck])*1000) | 0; // OR with 0 replaces Math.floor and is faster
message = msecondstominutes(trackTime);
}
midi.sendSysexMsg(StantonSCS1d.sysex.concat([StantonSCS1d.channel, 6+i],message.toInt(), 0xF7),7+message.length); // Set LCD
var trackTime = ((StantonSCS1d.padPoints[deck][bank][control] * StantonSCS1d.trackDuration[deck])*1000) | 0; // OR with 0 replaces Math.floor and is faster
var message = msecondstominutes(trackTime);
midi.sendSysexMsg(StantonSCS1d.sysex.concat([channel, control-26],message.toInt(), 0xF7),7+message.length); // Set LCD
if (StantonSCS1d.crossFader && StantonSCS1d.modifier["pitchRange"]==1) return; // Skip if adjusting the cross-fader
if (value < -1 || value > 1) return; // FIXME: This sometimes happens after using the BPM button to set the tempo and changing the pitch range. We should find out why.
var now=new Date();
// Move slider if applicable
if (now - StantonSCS1d.state["dontMove"]>100) {
if (StantonSCS1d.debug) print ("Moving slider to "+(value*63+64));
var message= "Hotcue"+hotCue; // If empty, just display hot cue #
if (value!=-1) {
// Set display with cue point time
var samplerate = engine.getValue("[Channel"+deck+"]","track_samplerate");
var msecs = (value/2/samplerate)*1000 | 0; // OR with 0 replaces Math.floor and is faster
// Track time in milliseconds
//var trackTime = ((StantonSCS1d.padPoints[deck][bank][control] * StantonSCS1d.trackDuration[deck])*1000) | 0; // OR with 0 replaces Math.floor and is faster