X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=_Internals.pde;h=cdd4ba5ac64d755b4665fc4f5070e2b15b48fb72;hb=e0cfbe20b2d0211c67ce6b44d9cb0931dd7af83e;hp=79d12e5574bd631b284ca351ce3196036c0cc876;hpb=2b068dd5d83e070da10318a9ab4017a7ce86d2ca;p=SugarCubes.git diff --git a/_Internals.pde b/_Internals.pde index 79d12e5..cdd4ba5 100644 --- a/_Internals.pde +++ b/_Internals.pde @@ -30,6 +30,7 @@ import ddf.minim.*; import ddf.minim.analysis.*; import processing.opengl.*; import rwmidi.*; +import java.lang.reflect.*; final int VIEWPORT_WIDTH = 900; final int VIEWPORT_HEIGHT = 700; @@ -39,8 +40,8 @@ final float TRAILER_WIDTH = 240; final float TRAILER_DEPTH = 97; final float TRAILER_HEIGHT = 33; -final int MaxCubeHeight = 5; -final int NumBackTowers = 11; +final int MaxCubeHeight = 7; +final int NumBackTowers = 18; int targetFramerate = 60; int startMillis, lastMillis; @@ -49,6 +50,7 @@ int startMillis, lastMillis; GLucose glucose; HeronLX lx; LXPattern[] patterns; +Effects effects; MappingTool mappingTool; PandaDriver[] pandaBoards; PresetManager presetManager; @@ -70,6 +72,7 @@ UICrossfader uiCrossfader; UIMidi uiMidi; UIMapping uiMapping; UIDebugText uiDebugText; +UISpeed uiSpeed; // Camera variables float eyeR, eyeA, eyeX, eyeY, eyeZ, midX, midY, midZ; @@ -100,7 +103,19 @@ LXPattern[] _rightPatterns(GLucose glucose) { } return rightPatterns; } - + +LXEffect[] _effectsArray(Effects effects) { + List effectList = new ArrayList(); + for (Field f : effects.getClass().getDeclaredFields()) { + try { + Object val = f.get(effects); + if (val instanceof LXEffect) { + effectList.add((LXEffect)val); + } + } catch (IllegalAccessException iax) {} + } + return effectList.toArray(new LXEffect[]{}); +} void logTime(String evt) { int now = millis(); @@ -131,7 +146,7 @@ void setup() { logTime("Built patterns"); glucose.setTransitions(transitions(glucose)); logTime("Built transitions"); - glucose.lx.addEffects(effects(glucose)); + glucose.lx.addEffects(_effectsArray(effects = new Effects())); logTime("Built effects"); // Preset manager @@ -159,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), @@ -208,9 +223,9 @@ void draw() { simulationColors = sendColors = glucose.getColors(); String displayMode = uiCrossfader.getDisplayMode(); if (displayMode == "A") { - simulationColors = lx.engine.getDeck(0).getColors(); + simulationColors = lx.engine.getDeck(GLucose.LEFT_DECK).getColors(); } else if (displayMode == "B") { - simulationColors = lx.engine.getDeck(1).getColors(); + simulationColors = lx.engine.getDeck(GLucose.RIGHT_DECK).getColors(); } if (debugMode) { debugUI.maskColors(simulationColors); @@ -471,7 +486,7 @@ void keyPressed() { frameRate(++targetFramerate); break; case 'b': - EFF_boom.trigger(); + effects.boom.trigger(); break; case 'd': if (!midiEngine.isQwertyEnabled()) {