From: Mark Slee Date: Fri, 25 Oct 2013 01:04:39 +0000 (-0700) Subject: Set display mode from APC buttons X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=88a3dd9e2f04a56b85544fa04887a80084412cd9;p=SugarCubes.git Set display mode from APC buttons --- diff --git a/_MIDI.pde b/_MIDI.pde index 5e52369..99c60d2 100644 --- a/_MIDI.pde +++ b/_MIDI.pde @@ -513,13 +513,23 @@ public class APC40MidiInput extends GenericDeviceMidiInput { return true; case 91: // play - case 97: // left bank - midiEngine.setFocusedDeck(0); + if (shiftOn) { + midiEngine.setFocusedDeck(GLucose.LEFT_DECK); + } else { + uiCrossfader.setDisplayMode("A"); + } return true; - + + case 92: // stop + uiCrossfader.setDisplayMode("COMP"); + return true; + case 93: // rec - case 96: // right bank - midiEngine.setFocusedDeck(1); + if (shiftOn) { + midiEngine.setFocusedDeck(GLucose.RIGHT_DECK); + } else { + uiCrossfader.setDisplayMode("B"); + } return true; case 94: // up bank diff --git a/_UIImplementation.pde b/_UIImplementation.pde index bd303dd..ac28fd6 100644 --- a/_UIImplementation.pde +++ b/_UIImplementation.pde @@ -142,6 +142,11 @@ class UICrossfader extends UIWindow { (displayMode = new UIToggleSet(4, titleHeight + 36, w-9, 20)).setOptions(new String[] { "A", "COMP", "B" }).setValue("COMP").addToContainer(this); } + public UICrossfader setDisplayMode(String value) { + displayMode.setValue(value); + return this; + } + public String getDisplayMode() { return displayMode.getValue(); }