+
+ // Build output driver
+ 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");
+
+ // Build overlay UI
+ debugUI = new DebugUI(pandaMappings);
+ overlays = new UIContext[] {
+ uiPatternA = new UIPatternDeck(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.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),
+
+ 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),
+ };
+ uiMapping.setVisible(false);
+ logTime("Built overlay UI");
+
+ // Load logo image
+ logo = loadImage("data/logo.png");
+
+ // Setup camera
+ midX = TRAILER_WIDTH/2.;
+ midY = glucose.model.yMax/2;
+ midZ = TRAILER_DEPTH/2.;
+ eyeR = -290;
+ eyeA = .15;
+ eyeY = midY + 70;
+ eyeX = midX + eyeR*sin(eyeA);
+ eyeZ = midZ + eyeR*cos(eyeA);
+
+ // Add mouse scrolling event support
+ addMouseWheelListener(new java.awt.event.MouseWheelListener() {
+ public void mouseWheelMoved(java.awt.event.MouseWheelEvent mwe) {
+ mouseWheel(mwe.getWheelRotation());
+ }});