X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=_Internals.pde;h=e2c343a243521e1c7c9096cf0c0b11c6a6e03cd7;hb=79ae8245d084fe7901933b22a44b404f9d68b925;hp=8b9163d5068b402f9b28d02f534b3e4e3614ceec;hpb=749eb72c6abd63e1f1d1253646e52b3c08954fd4;p=SugarCubes.git diff --git a/_Internals.pde b/_Internals.pde index 8b9163d..e2c343a 100644 --- a/_Internals.pde +++ b/_Internals.pde @@ -56,12 +56,8 @@ LXEffect[] effects; OverlayUI ui; ControlUI controlUI; MappingUI mappingUI; -PandaDriver pandaFront; -PandaDriver pandaRear; +PandaDriver[] pandaBoards; boolean mappingMode = false; - -boolean pandaBoardsEnabled = false; - boolean debugMode = false; DebugUI debugUI; @@ -95,10 +91,11 @@ void setup() { // Build output driver int[][] frontChannels = glucose.mapping.buildFrontChannelList(); int[][] rearChannels = glucose.mapping.buildRearChannelList(); - int[][] flippedRGB = glucose.mapping.buildFlippedRGBList(); mappingTool = new MappingTool(glucose, frontChannels, rearChannels); - pandaFront = new PandaDriver(new NetAddress("192.168.1.28", 9001), glucose.model, frontChannels, flippedRGB); - pandaRear = new PandaDriver(new NetAddress("192.168.1.29", 9001), glucose.model, rearChannels, flippedRGB); + pandaBoards = new PandaDriver[] { + new PandaDriver("10.200.1.28", glucose.model, frontChannels), + new PandaDriver("10.200.1.29", glucose.model, rearChannels), + }; logTime("Build PandaDriver"); // Build overlay UI @@ -213,9 +210,8 @@ void draw() { } // TODO(mcslee): move into GLucose engine - if (pandaBoardsEnabled) { - pandaFront.send(colors); - pandaRear.send(colors); + for (PandaDriver p : pandaBoards) { + p.send(colors); } } @@ -304,8 +300,9 @@ void keyPressed() { } break; case 'p': - pandaBoardsEnabled = !pandaBoardsEnabled; - println("PandaBoard Output: " + (pandaBoardsEnabled ? "ON" : "OFF")); + for (PandaDriver p : pandaBoards) { + p.toggle(); + } break; case 'u': uiOn = !uiOn; @@ -314,11 +311,9 @@ void keyPressed() { } int mx, my; - void mousePressed() { - if (mouseX > ui.leftPos) { - ui.mousePressed(); - } else { + ui.mousePressed(); + if (mouseX < ui.leftPos) { if (debugMode) { debugUI.mousePressed(); } @@ -343,14 +338,16 @@ void mouseDragged() { } void mouseReleased() { - if (mouseX > ui.leftPos) { - ui.mouseReleased(); - } + ui.mouseReleased(); } void mouseWheel(int delta) { - eyeR = constrain(eyeR - delta, -500, -80); - eyeX = midX + eyeR*sin(eyeA); - eyeZ = midZ + eyeR*cos(eyeA); + if (mouseX > ui.leftPos) { + ui.mouseWheel(delta); + } else { + eyeR = constrain(eyeR - delta, -500, -80); + eyeX = midX + eyeR*sin(eyeA); + eyeZ = midZ + eyeR*cos(eyeA); + } }