Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 40 additions & 40 deletions res/controllers/Denon-MC6000MK2-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ DenonMC6000MK2.MIDI_BUTTON_OFF = 0x00;

DenonMC6000MK2.isButtonPressed = function(midiValue) {
switch (midiValue) {
case DenonMC6000MK2.MIDI_BUTTON_ON:
return true;
case DenonMC6000MK2.MIDI_BUTTON_OFF:
return false;
default:
DenonMC6000MK2.logError("Unexpected MIDI button value: " + midiValue);
return undefined;
case DenonMC6000MK2.MIDI_BUTTON_ON:
return true;
case DenonMC6000MK2.MIDI_BUTTON_OFF:
return false;
default:
DenonMC6000MK2.logError("Unexpected MIDI button value: " + midiValue);
return undefined;
}
};

Expand All @@ -145,13 +145,13 @@ DenonMC6000MK2.MIDI_KNOB_DEC = 0x7F;

DenonMC6000MK2.getKnobDelta = function(midiValue) {
switch (midiValue) {
case DenonMC6000MK2.MIDI_KNOB_INC:
return 1;
case DenonMC6000MK2.MIDI_KNOB_DEC:
return -1;
default:
DenonMC6000MK2.logError("Unexpected MIDI knob value: " + midiValue);
return 0;
case DenonMC6000MK2.MIDI_KNOB_INC:
return 1;
case DenonMC6000MK2.MIDI_KNOB_DEC:
return -1;
default:
DenonMC6000MK2.logError("Unexpected MIDI knob value: " + midiValue);
return 0;
}
};

Expand Down Expand Up @@ -365,40 +365,40 @@ DenonMC6000MK2.Sampler.prototype.isPlaying = function() {

DenonMC6000MK2.Sampler.prototype.onButton = function(isButtonPressed) {
switch (DenonMC6000MK2.DEFAULT_SAMPLER_MODE) {
case DenonMC6000MK2.SAMPLER_MODE.TRIGGER:
if (isButtonPressed) {
if (this.isTrackLoaded()) {
if (this.side.getShiftState()) {
engine.setValue(this.group, "start_stop", true);
} else {
engine.setValue(this.group, "start_play", true);
}
case DenonMC6000MK2.SAMPLER_MODE.TRIGGER:
if (isButtonPressed) {
if (this.isTrackLoaded()) {
if (this.side.getShiftState()) {
engine.setValue(this.group, "start_stop", true);
} else {
this.loadSelectedTrack();
engine.setValue(this.group, "start_play", true);
}
} else {
this.loadSelectedTrack();
}
break;
case DenonMC6000MK2.SAMPLER_MODE.HOLD:
if (this.isTrackLoaded()) {
if (isButtonPressed) {
if (this.side.getShiftState()) {
engine.setValue(this.group, "eject", true);
} else {
engine.setValue(this.group, "start_play", true);
}
}
break;
case DenonMC6000MK2.SAMPLER_MODE.HOLD:
if (this.isTrackLoaded()) {
if (isButtonPressed) {
if (this.side.getShiftState()) {
engine.setValue(this.group, "eject", true);
} else {
// continue playing if shift is pressed when
// releasing the pressed button
if (!this.side.getShiftState()) {
engine.setValue(this.group, "start_stop", true);
}
engine.setValue(this.group, "start_play", true);
}
} else {
if (isButtonPressed) {
this.loadSelectedTrack();
// continue playing if shift is pressed when
// releasing the pressed button
if (!this.side.getShiftState()) {
engine.setValue(this.group, "start_stop", true);
}
}
break;
} else {
if (isButtonPressed) {
this.loadSelectedTrack();
}
}
break;
}
};

Expand Down