From: Mark Slee Date: Thu, 31 Oct 2013 04:28:45 +0000 (-0700) Subject: Map first APC slider to overall speed X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=fa4f822dadbaad06a7cc7d9909e8e3bbc5a51ee7;p=SugarCubes.git Map first APC slider to overall speed --- diff --git a/_Internals.pde b/_Internals.pde index f809e93..61f6c7d 100644 --- a/_Internals.pde +++ b/_Internals.pde @@ -72,6 +72,7 @@ UICrossfader uiCrossfader; UIMidi uiMidi; UIMapping uiMapping; UIDebugText uiDebugText; +UISpeed uiSpeed; // Camera variables float eyeR, eyeA, eyeX, eyeY, eyeZ, midX, midY, midZ; @@ -173,7 +174,7 @@ void setup() { new UIBlendMode(4, 332, 140, 86), new UIEffects(4, 422, 140, 144), new UITempo(4, 570, 140, 50), - new UISpeed(4, 624, 140, 50), + uiSpeed = new UISpeed(4, 624, 140, 50), new UIPatternDeck(lx.engine.getDeck(GLucose.RIGHT_DECK), "PATTERN B", width-144, 4, 140, 324), uiMidi = new UIMidi(midiEngine, width-144, 332, 140, 158), diff --git a/_MIDI.pde b/_MIDI.pde index a0031f6..b75556c 100644 --- a/_MIDI.pde +++ b/_MIDI.pde @@ -411,7 +411,7 @@ public class APC40MidiInput extends GenericDeviceMidiInput { case 7: switch (channel) { case 0: - // effects.colorFucker.hueShift.setValue(value); + uiSpeed.speed.setValue(0.5 - value*0.5); return true; case 1: effects.colorFucker.desat.setValue(value); diff --git a/_UIImplementation.pde b/_UIImplementation.pde index ac28fd6..95ac57d 100644 --- a/_UIImplementation.pde +++ b/_UIImplementation.pde @@ -472,10 +472,14 @@ class UIDebugText extends UIContext { } class UISpeed extends UIWindow { + + final BasicParameter speed; + UISpeed(float x, float y, float w, float h) { super("SPEED", x, y, w, h); + speed = new BasicParameter("SPEED", 0.5); new UIParameterSlider(4, titleHeight, w-10, 20) - .setParameter(new BasicParameter("SPEED", 0.5).addListener(new LXParameter.Listener() { + .setParameter(speed.addListener(new LXParameter.Listener() { public void onParameterChanged(LXParameter parameter) { lx.setSpeed(parameter.getValuef() * 2); }