@@ -0,0 +1,2058 @@
+package com.haxademic.demo.hardware.dmx;%0A%0Aimport java.util.ArrayList;%0A%0Aimport com.haxademic.core.app.PAppletHax;%0Aimport com.haxademic.core.app.config.AppSettings;%0Aimport com.haxademic.core.draw.color.ColorsHax;%0Aimport com.haxademic.core.draw.filters.pshader.BrightnessFilter;%0Aimport com.haxademic.core.draw.filters.pshader.RotateFilter;%0Aimport com.haxademic.core.draw.image.ImageUtil;%0Aimport com.haxademic.core.hardware.dmx.DMXFixture;%0A%0Apublic class Demo_DmxFixturesPride%0Aextends PAppletHax %7B%0A%09public static void main(String args%5B%5D) %7B PAppletHax.main(Thread.currentThread().getStackTrace()%5B1%5D.getClassName()); %7D%0A%09%0A%09protected ArrayList%3CDMXFixture%3E fixture;%0A%09protected String brightness = %22brightness%22;%0A%09protected String speed = %22speed%22;%0A%09%0A%09protected void overridePropsFile() %7B%0A%09%09p.appConfig.setProperty(AppSettings.DMX_PORT, %22COM6%22 );%0A%09%09p.appConfig.setProperty(AppSettings.DMX_BAUD_RATE, 9600 );%0A%09%7D%0A%0A%09public void setupFirstFrame() %7B%0A%09%09fixture = new ArrayList%3CDMXFixture%3E(); %0A%09%09for (int i = 0; i %3C 12; i++) %7B%0A%09%09%09fixture.add((new DMXFixture(1 + i * 3)).setEaseFactor(0.1f));%0A%09%09%7D%0A%09%09p.ui.addSlider(brightness, 0.5f, 0, 1, 0.01f);%0A%09%09p.ui.addSlider(speed, 0.3f, 0, 5, 0.01f);%0A%09%09p.ui.addWebInterface(false);%0A%09%7D%0A%0A%09public void drawApp() %7B%0A%09%09// update pride texture%0A%09%09pg.beginDraw();%0A%09%09pg.noStroke();%0A%09%09float numColors = ColorsHax.PRIDE.length;%0A%09%09for (int i = 0; i %3C numColors; i++) %7Bfloat colW = pg.width / numColors;%0A%09%09%09float x = colW * i;%0A%09%09%09pg.fill(ColorsHax.PRIDE%5Bi%5D);%0A%09%09%09pg.rect(x, 0, colW, pg.height);%0A%09%09%7D%0A%09%09pg.endDraw();%0A%09%09BrightnessFilter.instance(p).setBrightness(p.ui.value(brightness));%0A%09%09BrightnessFilter.instance(p).applyTo(pg);%0A%09%09RotateFilter.instance(p).applyTo(pg);%0A%09%09%0A%09%09// draw & scroll%0A%09%09p.image(pg, 0, 0);%0A%09%09RotateFilter.instance(p).setOffset(p.frameCount * (0.001f * p.ui.value(speed)), 0);%0A%09%09%0A%09%09// send colors to fixtures%0A%09%09p.loadPixels();%0A%09%09for (int i = 0; i %3C fixture.size(); i++) %7B%0A%09%09%09fixture.get(i).color().setTargetInt(ImageUtil.getPixelColor(p.g, 10 + i * 30, pg.height/2));%0A//%09%09%09background(fixture.get(i).color().colorInt());%0A%09%09%7D%0A%09%7D%0A%7D%0A%0A%0A%0A%0A%0A

Create Demo_DmxFixturesPride.java