X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=Internals.pde;h=3c1c603f18ba7d3c4d33e67be8eb471a06714776;hb=b08d4085e9f822f6eb43e17bfa8ef80cb2fb5ab5;hp=5a74a3742bc9a8a453521776bd9407f9741e4b32;hpb=b5d6d7a0a56238e37d648489a1d95bb1dc351091;p=SugarCubes.git diff --git a/Internals.pde b/Internals.pde index 5a74a37..3c1c603 100644 --- a/Internals.pde +++ b/Internals.pde @@ -29,6 +29,7 @@ import ddf.minim.analysis.*; import processing.opengl.*; import rwmidi.*; import java.lang.reflect.*; +import java.net.*; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -56,7 +57,7 @@ Effects effects; LXEffect[] effectsArr; DiscreteParameter selectedEffect; MappingTool mappingTool; -GrizzlyOutput[] grizzlies; +IPOutput[] outputs = {}; PresetManager presetManager; MidiEngine midiEngine; @@ -64,6 +65,7 @@ MidiEngine midiEngine; boolean mappingMode = false; boolean debugMode = false; boolean simulationOn = true; +boolean structureOn = false; boolean diagnosticsOn = false; LXPattern restoreToPattern = null; PImage logo; @@ -170,16 +172,15 @@ void setup() { logTime("Setup MIDI devices"); // Build output driver - grizzlies = new GrizzlyOutput[]{}; try { - grizzlies = buildGrizzlies(); - for (LXOutput output : grizzlies) { + outputs = buildOutputs(); + for (LXOutput output : outputs) { lx.addOutput(output); } } catch (Exception x) { x.printStackTrace(); } - logTime("Built Grizzly Outputs"); + logTime("Built Grizzly + Panda Outputs"); // Mapping tool mappingTool = new MappingTool(lx); @@ -202,7 +203,7 @@ void setup() { // Right controls new UIPatternDeck(lx.ui, lx.engine.getDeck(RIGHT_DECK), "PATTERN B", width-144, 4, 140, 324), uiMidi = new UIMidi(midiEngine, width-144, 332, 140, 158), - new UIOutput(grizzlies, width-144, 494, 140, 106), + new UIOutput(outputs, width-144, 494, 140, 106), // Crossfader uiCrossfader = new UICrossfader(width/2-90, height-90, 180, 86), @@ -223,6 +224,9 @@ void setup() { println("Total setup: " + (millis() - startMillis) + "ms"); println("Hit the 'o' key to toggle live output"); + + lx.engine.framesPerSecond.setValue(60); + lx.engine.setThreaded(true); } public SCPattern getPattern() { @@ -359,7 +363,7 @@ void drawDiagnostics(long drawNanos, long simulationNanos, long uiNanos, long ga noStroke(); int xp = x; float hv = 0; - for (long val : new long[] {lx.timer.drawNanos, simulationNanos, uiNanos, gammaNanos, lx.timer.outputNanos }) { + for (long val : new long[] {lx.timer.drawNanos, simulationNanos, uiNanos, gammaNanos, lx.engine.timer.outputNanos }) { fill(lx.hsb(hv % 360, 100, 80)); rect(xp, y, val * ws, h-1); hv += 140; @@ -499,7 +503,7 @@ void keyPressed() { break; case 'o': case 'p': - for (LXOutput output : grizzlies) { + for (LXOutput output : outputs) { output.enabled.toggle(); } break; @@ -513,6 +517,11 @@ void keyPressed() { simulationOn = !simulationOn; } break; + case 'S': + if (!midiEngine.isQwertyEnabled()) { + structureOn = !structureOn; + } + break; } }