PresetManager presetManager;
MidiEngine midiEngine;
// Display configuration mode
boolean mappingMode = false;
boolean debugMode = false;
PresetManager presetManager;
MidiEngine midiEngine;
// Display configuration mode
boolean mappingMode = false;
boolean debugMode = false;
boolean simulationOn = true;
boolean diagnosticsOn = false;
LXPattern restoreToPattern = null;
boolean simulationOn = true;
boolean diagnosticsOn = false;
LXPattern restoreToPattern = null;
- PandaMapping[] pandaMappings = buildPandaList();
- pandaBoards = new PandaDriver[pandaMappings.length];
- int pbi = 0;
- for (PandaMapping pm : pandaMappings) {
- pandaBoards[pbi++] = new PandaDriver(pm.ip, glucose.model, pm);
- }
- mappingTool = new MappingTool(glucose, pandaMappings);
- logTime("Built PandaDriver");
-
- debugUI = new DebugUI(pandaMappings);
- UIContext[] contexts = new UIContext[] {
+ UILayer[] layers = new UILayer[] {
+ // Camera layer
+ new UICameraLayer(lx.ui)
+ .setCenter(TRAILER_WIDTH/2., glucose.model.yMax/2, TRAILER_DEPTH/2.)
+ .setRadius(290).addComponent(new UICubesLayer()),
+
+ // Left controls
uiPatternA = new UIPatternDeck(lx.ui, lx.engine.getDeck(GLucose.LEFT_DECK), "PATTERN A", 4, 4, 140, 324),
new UIBlendMode(4, 332, 140, 86),
new UIEffects(4, 422, 140, 144),
new UITempo(4, 570, 140, 50),
uiSpeed = new UISpeed(4, 624, 140, 50),
uiPatternA = new UIPatternDeck(lx.ui, lx.engine.getDeck(GLucose.LEFT_DECK), "PATTERN A", 4, 4, 140, 324),
new UIBlendMode(4, 332, 140, 86),
new UIEffects(4, 422, 140, 144),
new UITempo(4, 570, 140, 50),
uiSpeed = new UISpeed(4, 624, 140, 50),
new UIPatternDeck(lx.ui, lx.engine.getDeck(GLucose.RIGHT_DECK), "PATTERN B", width-144, 4, 140, 324),
uiMidi = new UIMidi(midiEngine, width-144, 332, 140, 158),
new UIPatternDeck(lx.ui, lx.engine.getDeck(GLucose.RIGHT_DECK), "PATTERN B", width-144, 4, 140, 324),
uiMidi = new UIMidi(midiEngine, width-144, 332, 140, 158),
- new UIOutput(width-144, 494, 140, 106),
+ new UIOutput(grizzlies, width-144, 494, 140, 106),
uiCrossfader = new UICrossfader(width/2-90, height-90, 180, 86),
uiCrossfader = new UICrossfader(width/2-90, height-90, 180, 86),
uiDebugText = new UIDebugText(148, height-138, width-304, 44),
uiMapping = new UIMapping(mappingTool, 4, 4, 140, 324)
};
uiDebugText = new UIDebugText(148, height-138, width-304, 44),
uiMapping = new UIMapping(mappingTool, 4, 4, 140, 324)
};
- uiMapping.setVisible(false);
- lx.ui.addLayer(new UICameraLayer(lx.ui).setCenter(TRAILER_WIDTH/2., glucose.model.yMax/2, TRAILER_DEPTH/2.).setRadius(290).addComponent(new UICubesLayer()));
- for (UIContext context : contexts) {
- lx.ui.addLayer(context);
+ uiMapping.setVisible(false);
+ for (UILayer layer : layers) {
+ lx.ui.addLayer(layer);
long gammaStart = System.nanoTime();
// Gamma correction here. Apply a cubic to the brightness
// for better representation of dynamic range
long gammaStart = System.nanoTime();
// Gamma correction here. Apply a cubic to the brightness
// for better representation of dynamic range
// TODO(mcslee): fix
long drawNanos = System.nanoTime() - drawStart;
long simulationNanos = 0, uiNanos = 0;
if (diagnosticsOn) {
// TODO(mcslee): fix
long drawNanos = System.nanoTime() - drawStart;
long simulationNanos = 0, uiNanos = 0;
if (diagnosticsOn) {
- drawDiagnostics(drawNanos, simulationNanos, uiNanos, gammaNanos, sendNanos);
+ drawDiagnostics(drawNanos, simulationNanos, uiNanos, gammaNanos);
} else if (displayMode == "B") {
simulationColors = lx.engine.getDeck(GLucose.RIGHT_DECK).getColors();
}
} else if (displayMode == "B") {
simulationColors = lx.engine.getDeck(GLucose.RIGHT_DECK).getColors();
}
-void drawDiagnostics(long drawNanos, long simulationNanos, long uiNanos, long gammaNanos, long sendNanos) {
+void drawDiagnostics(long drawNanos, long simulationNanos, long uiNanos, long gammaNanos) {
- for (long val : new long[] {lx.timer.drawNanos, simulationNanos, uiNanos, gammaNanos, sendNanos }) {
+ for (long val : new long[] {lx.timer.drawNanos, simulationNanos, uiNanos, gammaNanos, lx.timer.outputNanos }) {
fill(lx.hsb(hv % 360, 100, 80));
rect(xp, y, val * ws, h-1);
hv += 140;
fill(lx.hsb(hv % 360, 100, 80));
rect(xp, y, val * ws, h-1);
hv += 140;