├── .gitignore ├── .travis.yml ├── COPYING ├── ChangeLog.md ├── README.md ├── Readme.PixelInvaders ├── ToDo.md ├── pixelcontroller-cli ├── .gitignore ├── lib │ └── jargs-1.0.jar ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── neophob │ │ └── sematrix │ │ └── cli │ │ ├── Framerate.java │ │ ├── ParsedArgument.java │ │ ├── PixConClient.java │ │ ├── PixConClientJmx.java │ │ └── PixelControllerCli.java │ └── test │ └── resources │ └── logging.properties ├── pixelcontroller-core ├── .gitignore ├── lib │ ├── artnet4j-0001.jar │ ├── jna.jar │ ├── minim │ │ ├── changelog.txt │ │ ├── library │ │ │ ├── export.txt │ │ │ ├── jl1.0.jar │ │ │ ├── jsminim.jar │ │ │ ├── minim-spi.jar │ │ │ ├── minim.jar │ │ │ ├── mp3spi1.9.4.jar │ │ │ ├── tritonus_aos.jar │ │ │ └── tritonus_share.jar │ │ ├── license.txt │ │ └── version.txt │ ├── rv3sf_api-0.2.jar │ └── serial │ │ ├── RXTXcomm.jar │ │ └── serial.jar ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── neophob │ │ └── sematrix │ │ └── core │ │ ├── PixelControllerElement.java │ │ ├── color │ │ └── ColorSet.java │ │ ├── effect │ │ ├── BeatHorizShift.java │ │ ├── BeatVerticalShift.java │ │ ├── Effect.java │ │ ├── FlipX.java │ │ ├── FlipY.java │ │ ├── Inverter.java │ │ ├── PassThru.java │ │ ├── PixelControllerEffect.java │ │ ├── Rotate90.java │ │ ├── RotoZoom.java │ │ ├── RotoZoomEffect.java │ │ ├── Strobo.java │ │ ├── TextureDeformation.java │ │ ├── Threshold.java │ │ ├── Voluminize.java │ │ └── Zoom.java │ │ ├── fader │ │ ├── Crossfader.java │ │ ├── CrossfaderHelper.java │ │ ├── Fader.java │ │ ├── IFader.java │ │ ├── PixelControllerFader.java │ │ ├── SlideLeftRight.java │ │ ├── SlideUpsideDown.java │ │ ├── Switch.java │ │ └── TransitionManager.java │ │ ├── generator │ │ ├── Blinkenlights.java │ │ ├── Cell.java │ │ ├── ColorFade.java │ │ ├── ColorScroll.java │ │ ├── FFTSpectrum.java │ │ ├── Fire.java │ │ ├── Generator.java │ │ ├── Geometrics.java │ │ ├── Image.java │ │ ├── Metaballs.java │ │ ├── OscListener.java │ │ ├── PassThruGen.java │ │ ├── PixelControllerGenerator.java │ │ ├── PixelImage.java │ │ ├── Plasma2.java │ │ ├── PlasmaAdvanced.java │ │ ├── ScreenCapture.java │ │ ├── Textwriter.java │ │ ├── VisualZero.java │ │ └── blinken │ │ │ ├── BlinkenHelper.java │ │ │ ├── BlinkenImage.java │ │ │ ├── BlinkenLibrary.java │ │ │ └── jaxb │ │ │ ├── Blm.java │ │ │ ├── Frame.java │ │ │ ├── Header.java │ │ │ ├── ObjectFactory.java │ │ │ └── Row.java │ │ ├── glue │ │ ├── Collector.java │ │ ├── FileUtils.java │ │ ├── MatrixData.java │ │ ├── OutputMapping.java │ │ ├── PixelControllerShufflerSelect.java │ │ ├── PresetSettings.java │ │ ├── RandomizeState.java │ │ ├── Shuffler.java │ │ ├── ShufflerOffset.java │ │ ├── Visual.java │ │ └── helper │ │ │ └── InitHelper.java │ │ ├── jmx │ │ ├── PacketAndBytesStatictics.java │ │ ├── PixelControllerStatus.java │ │ ├── PixelControllerStatusMBean.java │ │ ├── TimeMeasureItemGlobal.java │ │ └── TimeMeasureItemOutput.java │ │ ├── layout │ │ ├── BoxLayout.java │ │ ├── HorizontalLayout.java │ │ ├── Layout.java │ │ └── LayoutModel.java │ │ ├── listener │ │ └── MessageProcessor.java │ │ ├── mixer │ │ ├── AddSat.java │ │ ├── Checkbox.java │ │ ├── Either.java │ │ ├── HalfHalf.java │ │ ├── HalfHalfVertical.java │ │ ├── Maximum.java │ │ ├── Minimum.java │ │ ├── Mix.java │ │ ├── Mixer.java │ │ ├── Multiply.java │ │ ├── NegativeMultiply.java │ │ ├── PassThruMixer.java │ │ ├── PixelControllerMixer.java │ │ ├── SubSat.java │ │ └── Voluminizer.java │ │ ├── osc │ │ └── PixelControllerOscServer.java │ │ ├── output │ │ ├── AbstractDmxDevice.java │ │ ├── ArduinoOutput.java │ │ ├── ArtnetDevice.java │ │ ├── E1_31Device.java │ │ ├── IOutput.java │ │ ├── MiniDmxDevice.java │ │ ├── NoSerialPortFoundException.java │ │ ├── NullDevice.java │ │ ├── OnePanelResolutionAwareOutput.java │ │ ├── Output.java │ │ ├── OutputDeviceEnum.java │ │ ├── OutputHelper.java │ │ ├── PixelControllerOutput.java │ │ ├── PixelInvadersDevice.java │ │ ├── PixelInvadersNetDevice.java │ │ ├── PixelInvadersSerialDevice.java │ │ ├── RainbowduinoV2Device.java │ │ ├── RainbowduinoV3Device.java │ │ ├── RotateBuffer.java │ │ ├── Serial.java │ │ ├── SerialPortException.java │ │ ├── StealthDevice.java │ │ ├── Tpm2.java │ │ ├── Tpm2Net.java │ │ ├── UdpDevice.java │ │ ├── e131 │ │ │ └── E1_31DataPacket.java │ │ ├── gamma │ │ │ ├── GammaType.java │ │ │ ├── Gammatab.java │ │ │ └── RGBAdjust.java │ │ ├── minidmx │ │ │ └── MiniDmxSerial.java │ │ ├── neorainbowduino │ │ │ ├── Rainbowduino.java │ │ │ └── RainbowduinoHelper.java │ │ ├── pixelinvaders │ │ │ ├── Lpd6803Common.java │ │ │ ├── Lpd6803Net.java │ │ │ ├── Lpd6803Serial.java │ │ │ ├── TcpClient.java │ │ │ └── WriteDataException.java │ │ ├── stealth │ │ │ └── Stealth.java │ │ └── tpm2 │ │ │ ├── Tpm2NetProtocol.java │ │ │ └── Tpm2Serial.java │ │ ├── properties │ │ ├── ApplicationConfigurationHelper.java │ │ ├── ColorFormat.java │ │ ├── CommandGroup.java │ │ ├── ConfigConstant.java │ │ ├── DeviceConfig.java │ │ └── ValidCommands.java │ │ ├── resize │ │ ├── IResize.java │ │ ├── PixelControllerResize.java │ │ ├── PixelResize.java │ │ ├── QualityResize.java │ │ ├── Resize.java │ │ └── util │ │ │ └── ScalrOld.java │ │ ├── setup │ │ └── InitApplication.java │ │ └── sound │ │ ├── BeatListener.java │ │ ├── BeatToAnimation.java │ │ ├── ISound.java │ │ ├── SoundDummy.java │ │ └── SoundMinim.java │ └── test │ ├── java │ └── com │ │ └── neophob │ │ └── sematrix │ │ └── core │ │ ├── effect │ │ └── GenerateAllResolutionEffectTest.java │ │ ├── fader │ │ ├── CrossfaderTest.java │ │ ├── GenerateAllFaderTest.java │ │ └── SwitchTest.java │ │ ├── generator │ │ └── GenerateAllResolutionTest.java │ │ ├── glue │ │ ├── FileUtilsJunit.java │ │ ├── FileUtilsTest.java │ │ └── MatrixDataTest.java │ │ ├── layout │ │ ├── BoxLayoutTest.java │ │ └── HorizontalLayoutTest.java │ │ ├── listener │ │ └── MessageProcessorTest.java │ │ ├── mixer │ │ └── GenerateAllResolutionMixerTest.java │ │ ├── output │ │ ├── ArtnetDeviceTest.java │ │ ├── CacheMechanismTest.java │ │ ├── MD5SpeedTest.java │ │ ├── MiniDmxDeviceTest.java │ │ ├── OutputHelperTest.java │ │ ├── PixelControllerDeviceTest.java │ │ ├── RotateBufferTest.java │ │ └── gamma │ │ │ └── GammaTest.java │ │ ├── properties │ │ └── PropertiesHelperTest.java │ │ └── resize │ │ └── GenerateAllResolutionResizeTest.java │ └── resources │ └── logging.properties ├── pixelcontroller-distribution ├── .gitignore ├── pom.xml └── src │ └── main │ ├── assembly │ └── assembly.xml │ └── resources │ ├── data │ ├── 04B_03__.TTF │ ├── blinken │ │ ├── bb-frogskin2.bml │ │ ├── bb-rauten2.bml │ │ ├── bb-spiral2fast.bml │ │ ├── blender.bml │ │ ├── bnf_auge.bml │ │ ├── cube.bml │ │ ├── explosion.bml │ │ ├── flatter_flatter.bml │ │ ├── kreise-versetzt.bml │ │ ├── lemmingSink.bml │ │ ├── lemmingWalk.bml │ │ ├── metatunnel.bml │ │ ├── rhombe.bml │ │ ├── schwan.bml │ │ ├── star.bml │ │ ├── torus.bml │ │ ├── torus2.bml │ │ ├── tunnel.bml │ │ ├── veryBadTv.bml │ │ └── xflame.bml │ ├── client.policy │ ├── config.examples │ │ ├── Artnet-16x8.properties │ │ ├── MiniDmx-8x8.properties │ │ ├── PixelInvaders.properties │ │ ├── README │ │ ├── RainbowduinoV2.properties │ │ ├── UDP-16x8.properties │ │ └── tpm2serial-16x8.properties │ ├── config.properties │ ├── gui │ │ └── guilogo.jpg │ ├── logging.properties │ ├── palette.properties │ ├── pics │ │ ├── _logo.gif │ │ ├── check.jpg │ │ ├── circle.jpg │ │ ├── ff-logo-small.jpg │ │ ├── gradient.jpg │ │ ├── half.jpg │ │ ├── hls.jpg │ │ ├── hsv.jpg │ │ ├── icn-chat.png │ │ ├── icn-chess.png │ │ ├── icn-cloud.png │ │ ├── icn-control.png │ │ ├── icn-cross.png │ │ ├── icn-glass.png │ │ ├── icn-gun.png │ │ ├── icn-heart.png │ │ ├── icn-home.png │ │ ├── icn-ithing.png │ │ ├── icn-lock.png │ │ ├── icn-moon1.png │ │ ├── icn-moon2.png │ │ ├── icn-note.png │ │ ├── icn-pattern.png │ │ ├── icn-pause.png │ │ ├── icn-photo.png │ │ ├── icn-play.png │ │ ├── icn-polaroid.png │ │ ├── icn-pwr.png │ │ ├── icn-question.png │ │ ├── icn-saturn.png │ │ ├── icn-shield.png │ │ ├── icn-shoe.png │ │ ├── icn-skates.png │ │ ├── icn-skull.png │ │ ├── icn-smiley.png │ │ ├── icn-social-fb.png │ │ ├── icn-social-twitter.png │ │ ├── icn-three-layers.png │ │ ├── icn-three-mokeys.png │ │ ├── icn-tiefighter.png │ │ ├── icn-yourehere.png │ │ ├── logoBig.jpg │ │ ├── right.jpg │ │ ├── stripes.jpg │ │ └── tex4_256.jpg │ ├── presets.led │ └── setup │ │ └── splash.jpg │ ├── docs │ └── readme.pdf │ ├── header.txt │ ├── integration │ ├── ArduinoFw │ │ ├── Readme.txt │ │ ├── libraries │ │ │ ├── FastSPI_LED │ │ │ │ ├── FastSPI_LED.cpp │ │ │ │ ├── FastSPI_LED.h │ │ │ │ ├── examples │ │ │ │ │ └── testleds │ │ │ │ │ │ └── testleds.pde │ │ │ │ └── keywords.txt │ │ │ ├── FastSPI_LED2 │ │ │ │ ├── FastSPI_LED2.cpp │ │ │ │ ├── FastSPI_LED2.h │ │ │ │ ├── chipsets.h │ │ │ │ ├── clockless.h │ │ │ │ ├── controller.h │ │ │ │ ├── delay.h │ │ │ │ ├── dmx.h │ │ │ │ ├── examples │ │ │ │ │ ├── Fast2Dev │ │ │ │ │ │ └── Fast2Dev.ino │ │ │ │ │ ├── FirstLight │ │ │ │ │ │ └── FirstLight.ino │ │ │ │ │ └── RGBCalibrate │ │ │ │ │ │ └── RGBCalibrate.ino │ │ │ │ ├── fastpin.h │ │ │ │ ├── fastspi.h │ │ │ │ ├── fastspi_arm.h │ │ │ │ ├── fastspi_avr.h │ │ │ │ ├── fastspi_bitbang.h │ │ │ │ ├── fastspi_dma.h │ │ │ │ ├── hsv2rgb.cpp │ │ │ │ ├── hsv2rgb.h │ │ │ │ ├── lib8tion.cpp │ │ │ │ ├── lib8tion.h │ │ │ │ ├── pixeltypes.h │ │ │ │ └── preview_changes.txt │ │ │ ├── neophob_lpd6803spi │ │ │ │ ├── Neophob_LPD6803.cpp │ │ │ │ ├── Neophob_LPD6803.h │ │ │ │ ├── README │ │ │ │ └── examples │ │ │ │ │ └── lpd6803Spi │ │ │ │ │ └── lpd6803Spi.ino │ │ │ └── timer1 │ │ │ │ ├── TimerOne.cpp │ │ │ │ └── TimerOne.h │ │ ├── pixelinvaders │ │ │ ├── ExpeditInvadersSpi │ │ │ │ └── ExpeditInvadersSpi.ino │ │ │ ├── Readme.txt │ │ │ ├── neoLedLPD6803Spi │ │ │ │ ├── Readme.txt │ │ │ │ └── neoLedLPD6803Spi.ino │ │ │ └── neoLedWS2801Spi │ │ │ │ ├── Readme.txt │ │ │ │ └── neoLedWS2801Spi.ino │ │ ├── rainbowduinoV2 │ │ │ ├── 3rdParty │ │ │ │ ├── MsTimer2.zip │ │ │ │ └── wimleers-flexitimer2-v1.0-0-g4aab5a5.zip │ │ │ ├── Readme.txt │ │ │ ├── arduinoFw │ │ │ │ └── neoLed │ │ │ │ │ └── neoLed.pde │ │ │ ├── rainbowduinoFw │ │ │ │ └── Rainbow_V2_71 │ │ │ │ │ ├── Rainbow.h │ │ │ │ │ ├── Rainbow_V2_71.pde │ │ │ │ │ └── data.c │ │ │ └── teensyFw │ │ │ │ └── neoLed_Teensy │ │ │ │ └── neoLed_Teensy.pde │ │ ├── rainbowduinoV3 │ │ │ ├── Readme.txt │ │ │ └── rv3sf │ │ │ │ └── rv3sf.ino │ │ ├── stealthSpi │ │ │ ├── Readme.txt │ │ │ ├── element_maple_gfx.pde │ │ │ ├── stealthSpiMaple │ │ │ │ ├── Adafruit_GFX.cpp │ │ │ │ ├── Adafruit_GFX.h │ │ │ │ ├── element_GFX.cpp │ │ │ │ ├── element_GFX.h │ │ │ │ ├── glcdfont.c │ │ │ │ └── stealthSpiMaple.pde │ │ │ └── stealthSpiTeensy │ │ │ │ ├── Adafruit_GFX.cpp │ │ │ │ ├── Adafruit_GFX.h │ │ │ │ ├── Readme.txt │ │ │ │ ├── element_GFX.cpp │ │ │ │ ├── element_GFX.h │ │ │ │ ├── glcdfont.c │ │ │ │ └── stealthSpiTeensy.ino │ │ ├── tpm2net │ │ │ └── tpm2net.ino │ │ └── tpm2serial │ │ │ ├── Readme.txt │ │ │ ├── serialdebug │ │ │ ├── serialdebug.pde │ │ │ └── tpm2.pde │ │ │ └── tpm2serial │ │ │ └── tpm2serial.ino │ ├── ControlOSC │ │ ├── 002.js │ │ └── readme.txt │ ├── Processing │ │ ├── AdapterApp │ │ │ ├── ActionFactory.pde │ │ │ ├── AdapterApp.pde │ │ │ ├── LastAction.pde │ │ │ └── OscAction.pde │ │ ├── OscSendControllMessages │ │ │ ├── OscSenderRandom │ │ │ │ └── OscSenderRandom.pde │ │ │ ├── OscSenderSelectVisual │ │ │ │ └── OscSenderSelectVisual.pde │ │ │ └── PixelControllerRemote │ │ │ │ ├── PixelControllerRemote.pde │ │ │ │ └── data │ │ │ │ └── config.properties │ │ ├── OscSendImageData │ │ │ ├── PixlInvCamAndroid │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── PixlInvCamAndroid.pde │ │ │ │ └── sketch.properties │ │ │ ├── colorAdjust │ │ │ │ ├── colorAdjust.pde │ │ │ │ └── oscSend.pde │ │ │ ├── kinect_MSAFluidDemo │ │ │ │ ├── KinectFeedback.pde │ │ │ │ ├── ParticleOne.pde │ │ │ │ ├── ParticleTwo.pde │ │ │ │ ├── TuioHandler.pde │ │ │ │ ├── kinect_MSAFluidDemo.pde │ │ │ │ └── oscSend.pde │ │ │ ├── particleexample │ │ │ │ ├── oscSend.pde │ │ │ │ └── particleexample.pde │ │ │ ├── sendImageKreise │ │ │ │ ├── oscSend.pde │ │ │ │ └── sendImageKreise.pde │ │ │ ├── sendImageKreise24bpp │ │ │ │ ├── oscSend.pde │ │ │ │ └── sendImageKreise24bpp.pde │ │ │ └── sendImageSecretLifeOfTuring │ │ │ │ ├── oscSend.pde │ │ │ │ ├── pattern.pde │ │ │ │ └── sendImageSecretLifeOfTuring.pde │ │ └── README.md │ ├── PureData │ │ ├── Midi2OSC.pd │ │ ├── ledgui5-onePanel.pd │ │ ├── ledgui5.pd │ │ └── readme.txt │ └── Readme.txt │ ├── lib │ ├── RPi │ │ ├── Readme.txt │ │ └── librxtxSerial.so │ ├── librxtxSerial.jnilib │ ├── librxtxSerial.so │ ├── rxtxSerial.dll │ └── rxtxSerial64.dll │ └── startscript │ ├── PixelController.jar │ ├── PixelController.properties │ └── console │ ├── PixConCli.cmd │ ├── PixConCli.sh │ ├── PixelController.cmd │ ├── PixelController.command │ ├── PixelController.sh │ └── PixelControllerRPi.sh ├── pixelcontroller-gui ├── .gitignore ├── lib │ ├── controlP5.jar │ └── core.jar ├── pom.xml └── src │ ├── .gitignore │ ├── main │ ├── java │ │ └── com │ │ │ └── neophob │ │ │ ├── PixelController.java │ │ │ └── sematrix │ │ │ └── gui │ │ │ ├── GeneratorGui.java │ │ │ ├── GeneratorGuiCreator.java │ │ │ ├── GeneratorGuiHelper.java │ │ │ ├── GuiCallbackAction.java │ │ │ ├── GuiElement.java │ │ │ ├── Messages.java │ │ │ ├── OutputGui.java │ │ │ ├── P5EventListener.java │ │ │ ├── Theme.java │ │ │ ├── callback │ │ │ ├── GuiState.java │ │ │ └── GuiUpdateFeedback.java │ │ │ ├── handler │ │ │ ├── KeyboardHandler.java │ │ │ └── WindowHandler.java │ │ │ └── model │ │ │ ├── LedSimulatorOutputWindow.java │ │ │ ├── Point.java │ │ │ └── WindowSizeCalculator.java │ └── resources │ │ └── messages.properties │ └── test │ ├── java │ └── com │ │ └── neophob │ │ ├── PixelControllerTest.java │ │ └── sematrix │ │ ├── gui │ │ ├── MessagesTest.java │ │ ├── callback │ │ │ └── GuiStateTest.java │ │ └── model │ │ │ ├── TestLedSimulatorOutputWindow.java │ │ │ └── WindowSizeCalculatorTest.java │ │ └── listener │ │ └── Fuzzing.java │ └── resources │ └── logging.properties ├── pixelcontroller-osc ├── .gitignore ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── neophob │ │ └── sematrix │ │ └── osc │ │ ├── client │ │ ├── IClient.java │ │ ├── OscClientException.java │ │ └── impl │ │ │ ├── OscClientFactory.java │ │ │ └── OscClientImpl.java │ │ ├── model │ │ └── OscMessage.java │ │ └── server │ │ ├── IServer.java │ │ ├── OscMessageHandler.java │ │ ├── OscServerException.java │ │ └── impl │ │ ├── OscServer.java │ │ ├── OscServerFactory.java │ │ └── OscServerImpl.java │ └── test │ ├── java │ └── com │ │ └── neophob │ │ └── sematrix │ │ └── osc │ │ ├── ClientServerTest.java │ │ ├── IntegrationTest.java │ │ ├── ObserverTest.java │ │ └── server │ │ └── TestOscServer.java │ └── resources │ └── logging.properties └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | */.settings/* 2 | .classpath 3 | .project 4 | */target/* 5 | /bin 6 | screenshot/ 7 | 8 | # OS generated files # 9 | ###################### 10 | .DS_Store 11 | .DS_Store? 12 | ._* 13 | .Spotlight-V100 14 | .Trashes 15 | Icon? 16 | ehthumbs.db 17 | Thumbs.db 18 | data/.DS_Store 19 | 20 | data/ArduinoFw/.DS_Store 21 | /.settings 22 | /target 23 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | before_install: 3 | - mvn initialize 4 | install: mvn install -DskipTests=true 5 | jdk: 6 | - oraclejdk7 7 | #env: JAVA_OPTS="-server -Djruby.cext.enabled=false -Djruby.compile.invokedynamic=false" 8 | notifications: 9 | # Email notifications are disabled to not annoy anybody. 10 | # See http://about.travis-ci.org/docs/user/build-configuration/ to learn more 11 | # about configuring notification recipients and more. 12 | email: false 13 | -------------------------------------------------------------------------------- /Readme.PixelInvaders: -------------------------------------------------------------------------------- 1 | ------------------------------- 2 | HOWTO GET A PIXELINVADERS PANEL 3 | ------------------------------- 4 | Check the PixelInvaders Website at http://www.pixelinvaders.ch 5 | 6 | -------------- 7 | DO IT YOURSELF 8 | -------------- 9 | You get detailed build instructions together with a PixelInvaders DIY kit (http://shop.pixelinvaders.ch/). 10 | 11 | -------------------------------------------------------------------------------- /pixelcontroller-cli/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /bin 3 | -------------------------------------------------------------------------------- /pixelcontroller-cli/lib/jargs-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-cli/lib/jargs-1.0.jar -------------------------------------------------------------------------------- /pixelcontroller-cli/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.neophob.pixelcontroller 7 | pixelcontroller 8 | ../pom.xml 9 | 2.0.0 10 | 11 | 12 | pixelcontroller-cli 13 | PixelController Command Line Interface 14 | 15 | jar 16 | 17 | 18 | 19 | 20 | 22 | 23 | org.apache.maven.plugins 24 | maven-install-plugin 25 | 2.5.1 26 | 27 | 28 | jargs 29 | 30 | lib/jargs-1.0.jar 31 | net.sf 32 | jargs 33 | 1.0 34 | jar 35 | 36 | initialize 37 | 38 | install-file 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | com.neophob.pixelcontroller 49 | pixelcontroller-core 50 | 2.0.0 51 | 52 | 53 | org.apache.commons 54 | commons-lang3 55 | 3.1 56 | 57 | 58 | net.sf 59 | jargs 60 | 1.0 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /pixelcontroller-cli/src/main/java/com/neophob/sematrix/cli/Framerate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.cli; 20 | 21 | import java.util.logging.Logger; 22 | 23 | /** 24 | * 25 | * @author michu 26 | * 27 | */ 28 | public class Framerate { 29 | 30 | private static final Logger LOG = Logger.getLogger(Framerate.class.getName()); 31 | 32 | private long nextRepaintDue = 0; 33 | private long startTime; 34 | private long delay; 35 | private int targetFps; 36 | 37 | public Framerate(int targetFps) { 38 | LOG.info("Target fps: "+targetFps); 39 | this.delay = 1000/targetFps; 40 | this.startTime = System.currentTimeMillis(); 41 | this.targetFps = targetFps; 42 | } 43 | 44 | public void waitForFps(long cnt) { 45 | long now = System.currentTimeMillis(); 46 | if (nextRepaintDue > now) { 47 | // too soon to repaint, wait... 48 | try { 49 | Thread.sleep(nextRepaintDue - now); 50 | } catch (InterruptedException e) { 51 | //ignore it 52 | } 53 | } 54 | nextRepaintDue = System.currentTimeMillis() + delay; 55 | 56 | if (cnt % (targetFps*5) == 0) { 57 | long tdiff = (System.currentTimeMillis() - startTime) / 1000; 58 | if (tdiff>0) { 59 | LOG.info("FPS: "+ (cnt/tdiff)); 60 | } 61 | } 62 | 63 | } 64 | } -------------------------------------------------------------------------------- /pixelcontroller-cli/src/test/resources/logging.properties: -------------------------------------------------------------------------------- 1 | # Properties file which configures the operation of the JDK 2 | # logging facility. 3 | 4 | # The system will look for this config file, first using 5 | # a System property specified at startup: 6 | # 7 | # >java -Djava.util.logging.config.file=myLoggingConfigFilePath 8 | # 9 | # If this property is not specified, then the config file is 10 | # retrieved from its default location at: 11 | # 12 | # JDK_HOME/jre/lib/logging.properties 13 | 14 | # Global logging properties. 15 | # ------------------------------------------ 16 | # The set of handlers to be loaded upon startup. 17 | # Comma-separated list of class names. 18 | # (? LogManager docs say no comma here, but JDK example has comma.) 19 | handlers=java.util.logging.ConsoleHandler 20 | 21 | # Default global logging level. 22 | # Loggers and Handlers may override this level 23 | .level=WARNING 24 | 25 | # Handlers 26 | # ----------------------------------------- 27 | 28 | # --- ConsoleHandler --- 29 | # Override of global logging level 30 | # Use serve level only for console handler 31 | java.util.logging.ConsoleHandler.level=WARNING 32 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter 33 | 34 | 35 | #EOF 36 | -------------------------------------------------------------------------------- /pixelcontroller-core/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /.settings 3 | /bin 4 | -------------------------------------------------------------------------------- /pixelcontroller-core/lib/artnet4j-0001.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-core/lib/artnet4j-0001.jar -------------------------------------------------------------------------------- /pixelcontroller-core/lib/jna.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-core/lib/jna.jar -------------------------------------------------------------------------------- /pixelcontroller-core/lib/minim/changelog.txt: -------------------------------------------------------------------------------- 1 | Changelog! 2 | 3 | Version 2.0.2 4 | 5 | Fixed Bugs: 6 | 7 | + filenames were being parsed incorrectly by createRecorder. 8 | 9 | + fixed audio processing routines for AudioPlayer and AudioSnippet so that 10 | they don't spend cycles doing nothing while not in the "play" state. 11 | 12 | + fixed the zombie thread bug, which kept audio processing Threads from 13 | exiting when close() was called. 14 | 15 | + fixed out-of-memory problems that could occur when large files were 16 | played. this does come at the cost of slower seek times. 17 | 18 | + fixed the isEnabled(AudioEffect) function, which, uh, wasn't working. 19 | 20 | + fixed the pan() function, which was returning the BALANCE control. 21 | 22 | New Features: 23 | 24 | + added functions to FFT for doing forward transforms with an offset: 25 | forward(float[] samples, offset) and forward(AudioBuffer samples, offset) 26 | 27 | + added a freqToIndex(float freq) method to FFT for finding out the index 28 | of the spectrum band that contains the passed in frequency. 29 | 30 | + added a stop() method to AudioSample, so that playing samples can be 31 | immediately silenced. 32 | 33 | + added setPanNoGlide(float pan) to Controller, which will snap the panning 34 | setting of a sound to the provided value. 35 | 36 | + added setInputMixer(Mixer) and setOutputMixer(Mixer), which allow you to 37 | specify which Java Mixer object should be used when obtaining inputs (AudioInput) 38 | and outputs (AudioOuput, AudioPlayer, AudioSnippet, AudioSample). 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /pixelcontroller-core/lib/minim/library/export.txt: -------------------------------------------------------------------------------- 1 | name = Minim Audio 2 | -------------------------------------------------------------------------------- /pixelcontroller-core/lib/minim/library/jl1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-core/lib/minim/library/jl1.0.jar -------------------------------------------------------------------------------- /pixelcontroller-core/lib/minim/library/jsminim.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-core/lib/minim/library/jsminim.jar -------------------------------------------------------------------------------- /pixelcontroller-core/lib/minim/library/minim-spi.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-core/lib/minim/library/minim-spi.jar -------------------------------------------------------------------------------- /pixelcontroller-core/lib/minim/library/minim.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-core/lib/minim/library/minim.jar -------------------------------------------------------------------------------- /pixelcontroller-core/lib/minim/library/mp3spi1.9.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-core/lib/minim/library/mp3spi1.9.4.jar -------------------------------------------------------------------------------- /pixelcontroller-core/lib/minim/library/tritonus_aos.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-core/lib/minim/library/tritonus_aos.jar -------------------------------------------------------------------------------- /pixelcontroller-core/lib/minim/library/tritonus_share.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-core/lib/minim/library/tritonus_share.jar -------------------------------------------------------------------------------- /pixelcontroller-core/lib/minim/version.txt: -------------------------------------------------------------------------------- 1 | 2.0.2 2 | -------------------------------------------------------------------------------- /pixelcontroller-core/lib/rv3sf_api-0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-core/lib/rv3sf_api-0.2.jar -------------------------------------------------------------------------------- /pixelcontroller-core/lib/serial/RXTXcomm.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-core/lib/serial/RXTXcomm.jar -------------------------------------------------------------------------------- /pixelcontroller-core/lib/serial/serial.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-core/lib/serial/serial.jar -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/PixelControllerElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * 25 | * interface for all collectors. used to initialize all elements during startup, 26 | * get the current state from all elements (used to store presents) and update 27 | * the elements. 28 | * 29 | * @author michu 30 | * 31 | */ 32 | public interface PixelControllerElement { 33 | 34 | /** 35 | * initialize all elements. 36 | */ 37 | void initAll(); 38 | 39 | /** 40 | * get current status of all childs. 41 | * 42 | * @return the current state 43 | */ 44 | List getCurrentState(); 45 | 46 | /** 47 | * update the element if needed. 48 | */ 49 | void update(); 50 | } 51 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/effect/FlipX.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.effect; 20 | 21 | import com.neophob.sematrix.core.glue.MatrixData; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | 25 | /** 26 | * The Class Inverter. 27 | */ 28 | public class FlipX extends Effect { 29 | 30 | /** 31 | * Instantiates a new inverter. 32 | * 33 | * @param controller the controller 34 | */ 35 | public FlipX(MatrixData matrix) { 36 | super(matrix, EffectName.FLIP_X, ResizeName.QUALITY_RESIZE); 37 | } 38 | 39 | /* (non-Javadoc) 40 | * @see com.neophob.sematrix.core.effect.Effect#getBuffer(int[]) 41 | */ 42 | public int[] getBuffer(int[] buffer) { 43 | int[] ret = new int[buffer.length]; 44 | 45 | int ofs=0; 46 | 47 | for (int y=0; y 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.effect; 20 | 21 | import com.neophob.sematrix.core.glue.MatrixData; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | 25 | /** 26 | * The Class Inverter. 27 | */ 28 | public class FlipY extends Effect { 29 | 30 | /** 31 | * Instantiates a new inverter. 32 | * 33 | * @param controller the controller 34 | */ 35 | public FlipY(MatrixData matrix) { 36 | super(matrix, EffectName.FLIP_Y, ResizeName.QUALITY_RESIZE); 37 | } 38 | 39 | /* (non-Javadoc) 40 | * @see com.neophob.sematrix.core.effect.Effect#getBuffer(int[]) 41 | */ 42 | public int[] getBuffer(int[] buffer) { 43 | int[] ret = new int[buffer.length]; 44 | int ofsSrc=0; 45 | int ofsDst=(this.internalBufferYSize-1)*this.internalBufferXSize; 46 | 47 | for (int y=0; y 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.effect; 20 | 21 | import com.neophob.sematrix.core.glue.MatrixData; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | 25 | /** 26 | * The Class Inverter. 27 | */ 28 | public class Inverter extends Effect { 29 | 30 | /** 31 | * Instantiates a new inverter. 32 | * 33 | * @param controller the controller 34 | */ 35 | public Inverter(MatrixData matrix) { 36 | super(matrix, EffectName.INVERTER, ResizeName.QUALITY_RESIZE); 37 | } 38 | 39 | /* (non-Javadoc) 40 | * @see com.neophob.sematrix.core.effect.Effect#getBuffer(int[]) 41 | */ 42 | public int[] getBuffer(int[] buffer) { 43 | int[] ret = new int[buffer.length]; 44 | 45 | for (int i=0; i 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.effect; 20 | 21 | import com.neophob.sematrix.core.glue.MatrixData; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | 25 | /** 26 | * The Class PassThru. 27 | */ 28 | public class PassThru extends Effect { 29 | 30 | /** 31 | * Instantiates a new pass thru. 32 | * 33 | * @param controller the controller 34 | */ 35 | public PassThru(MatrixData matrix) { 36 | super(matrix, EffectName.PASSTHRU, ResizeName.QUALITY_RESIZE); 37 | } 38 | 39 | /* (non-Javadoc) 40 | * @see com.neophob.sematrix.core.effect.Effect#getBuffer(int[]) 41 | */ 42 | public int[] getBuffer(int[] buffer) { 43 | return buffer; 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/effect/Strobo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.effect; 20 | 21 | import com.neophob.sematrix.core.glue.MatrixData; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | /** 25 | * create a strobo effect. 26 | * 27 | * @author michu 28 | */ 29 | public class Strobo extends Effect { 30 | 31 | private int stro; 32 | private int count; 33 | 34 | /** 35 | * Instantiates a new threshold. 36 | * 37 | * @param controller the controller 38 | */ 39 | public Strobo(MatrixData matrix) { 40 | super(matrix, EffectName.STROBO, ResizeName.QUALITY_RESIZE); 41 | this.stro = 0; 42 | this.count = 0; 43 | } 44 | 45 | /* (non-Javadoc) 46 | * @see com.neophob.sematrix.core.effect.Effect#getBuffer(int[]) 47 | */ 48 | public int[] getBuffer(int[] buffer) { 49 | if (stro==128) { 50 | return new int[buffer.length]; 51 | } 52 | 53 | return buffer; 54 | } 55 | 56 | /* (non-Javadoc) 57 | * @see com.neophob.sematrix.core.effect.Effect#update() 58 | */ 59 | @Override 60 | public void update() { 61 | if (count++<2) { 62 | return; 63 | } 64 | count = 0; 65 | stro^=128; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/effect/Voluminize.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.effect; 20 | 21 | import com.neophob.sematrix.core.glue.MatrixData; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | import com.neophob.sematrix.core.sound.ISound; 24 | 25 | /** 26 | * The Class Voluminize. 27 | */ 28 | public class Voluminize extends Effect { 29 | 30 | private float volume = 0; 31 | private ISound sound; 32 | 33 | /** 34 | * Instantiates a new voluminize. 35 | * 36 | * @param controller the controller 37 | */ 38 | public Voluminize(MatrixData matrix, ISound sound) { 39 | super(matrix, EffectName.VOLUMINIZE, ResizeName.QUALITY_RESIZE); 40 | this.sound = sound; 41 | } 42 | 43 | /* (non-Javadoc) 44 | * @see com.neophob.sematrix.core.effect.Effect#getBuffer(int[]) 45 | */ 46 | public int[] getBuffer(int[] buffer) { 47 | int[] ret = new int[buffer.length]; 48 | 49 | for (int i=0; i 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.fader; 20 | 21 | /** 22 | * The Class CrossfaderHelper. 23 | * 24 | * @author michu 25 | */ 26 | public final class CrossfaderHelper { 27 | 28 | /** 29 | * Instantiates a new crossfader helper. 30 | */ 31 | private CrossfaderHelper() { 32 | //no instance allowed 33 | } 34 | 35 | /** 36 | * Gets the buffer. 37 | * 38 | * @param f the f 39 | * @param oldBuffer the old buffer 40 | * @param newBuffer the new buffer 41 | * @return the buffer 42 | */ 43 | public static int[] getBuffer(float f, int[] oldBuffer, int[] newBuffer) { 44 | 45 | int[] ret = new int[oldBuffer.length]; 46 | int oTmp, nTmp; 47 | short or,og,ob; 48 | short nr,ng,nb; 49 | 50 | for (int i=0; i>16)&255)* (1.0f-f)); 55 | og=(short) (((oTmp>>8)&255)* (1.0f-f)); 56 | ob=(short) (( oTmp&255)* (1.0f-f)); 57 | 58 | nr=(short) (((nTmp>>16)&255)* f); 59 | ng=(short) (((nTmp>>8)&255)* f); 60 | nb=(short) (( nTmp&255)* f); 61 | 62 | ret[i] = ((or << 16) | (og << 8) | ob) + ((nr << 16) | (ng << 8) | nb); 63 | } 64 | return ret; 65 | 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/fader/Switch.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.fader; 20 | 21 | import com.neophob.sematrix.core.glue.MatrixData; 22 | 23 | 24 | /** 25 | * The Class Switch. 26 | */ 27 | public class Switch extends Fader { 28 | 29 | /** 30 | * Instantiates a new switch. 31 | */ 32 | public Switch(MatrixData matrix, int fps) { 33 | super(matrix, FaderName.SWITCH, 50, fps); 34 | } 35 | 36 | /* (non-Javadoc) 37 | * @see com.neophob.sematrix.core.fader.Fader#getBuffer(int[]) 38 | */ 39 | @Override 40 | public int[] getBuffer(int[] visual1Buffer, int[] visual2Buffer) { 41 | return visual1Buffer; 42 | } 43 | 44 | /* (non-Javadoc) 45 | * @see com.neophob.sematrix.core.fader.Fader#isDone() 46 | */ 47 | @Override 48 | public boolean isDone() { 49 | return true; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/fader/TransitionManager.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.fader; 20 | 21 | import com.neophob.sematrix.core.glue.Collector; 22 | import com.neophob.sematrix.core.glue.OutputMapping; 23 | 24 | /** 25 | * the transition manager handle smooth transition for the output visuals 26 | * 27 | * @author michu 28 | * 29 | */ 30 | public class TransitionManager { 31 | 32 | private int[][] savedVisuals; 33 | private Collector col; 34 | 35 | /** 36 | * save current visual output, used for preset fading 37 | * 38 | * @param col 39 | */ 40 | public TransitionManager(Collector col) { 41 | this.col = col; 42 | savedVisuals = new int[col.getAllVisuals().size()][]; 43 | int i = 0; 44 | for (OutputMapping om: col.getAllOutputMappings()) { 45 | savedVisuals[i++] = col.getVisual(om.getVisualId()).getBuffer().clone(); 46 | } 47 | } 48 | 49 | /** 50 | * start crossfading 51 | * 52 | * @param col 53 | */ 54 | public void startCrossfader() { 55 | int i=0; 56 | for (OutputMapping om: col.getAllOutputMappings()) { 57 | om.setFader(col.getPixelControllerFader().getPresetFader(1)); 58 | om.getFader().startFade(om.getVisualId(), savedVisuals[i++]); 59 | } 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/generator/ColorFade.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.generator; 20 | 21 | import java.util.Arrays; 22 | 23 | import com.neophob.sematrix.core.glue.MatrixData; 24 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 25 | 26 | /** 27 | * 28 | * @author McGyver 29 | */ 30 | public class ColorFade extends Generator { 31 | 32 | private int frameCount; 33 | 34 | /** 35 | * Instantiates a new colorscroll 36 | * 37 | * @param controller the controller 38 | */ 39 | public ColorFade(MatrixData matrix) { 40 | super(matrix, GeneratorName.COLOR_FADE, ResizeName.QUALITY_RESIZE); 41 | } 42 | 43 | @Override 44 | public void update() { 45 | Arrays.fill(this.internalBuffer, frameCount%255); 46 | frameCount++; 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/generator/PassThruGen.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.generator; 20 | 21 | import com.neophob.sematrix.core.glue.MatrixData; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | /** 25 | * The Class PassThruGen. 26 | * 27 | * @author mvogt 28 | */ 29 | public class PassThruGen extends Generator { 30 | 31 | /** 32 | * Instantiates a new pass thru gen. 33 | * 34 | * @param controller the controller 35 | */ 36 | public PassThruGen(MatrixData matrix) { 37 | super(matrix, GeneratorName.PASSTHRU, ResizeName.PIXEL_RESIZE); 38 | } 39 | 40 | /* (non-Javadoc) 41 | * @see com.neophob.sematrix.core.generator.Generator#update() 42 | */ 43 | @Override 44 | public void update() { 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/generator/VisualZero.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.generator; 20 | 21 | import com.neophob.sematrix.core.glue.Collector; 22 | import com.neophob.sematrix.core.glue.MatrixData; 23 | import com.neophob.sematrix.core.glue.Visual; 24 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 25 | 26 | 27 | /** 28 | * Get content from first visual. 29 | */ 30 | public class VisualZero extends Generator { 31 | 32 | /** 33 | * @param controller the controller 34 | */ 35 | public VisualZero(MatrixData matrix) { 36 | super(matrix, GeneratorName.VISUAL_ZERO, ResizeName.QUALITY_RESIZE); 37 | } 38 | 39 | /* (non-Javadoc) 40 | * @see com.neophob.sematrix.core.generator.Generator#update() 41 | */ 42 | @Override 43 | public void update() { 44 | Visual visual = Collector.getInstance().getVisual(0); 45 | this.internalBuffer = visual.getMixer().getBuffer(visual); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/generator/blinken/BlinkenImage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.generator.blinken; 20 | 21 | public class BlinkenImage { 22 | 23 | private final int width, height; 24 | private int pointer; 25 | private int[] data; 26 | 27 | public BlinkenImage(int width, int height) { 28 | this.width = width; 29 | this.height = height; 30 | this.pointer = 0; 31 | this.data = new int[width*height]; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see java.lang.Object#toString() 36 | */ 37 | @Override 38 | public String toString() { 39 | return String.format("BlinkenImage [width=%s, height=%s, pointer=%s]", 40 | width, height, pointer); 41 | } 42 | 43 | public void addData(int fragment[]) { 44 | if (pointer + fragment.length > data.length) { 45 | return; 46 | } 47 | 48 | System.arraycopy(fragment, 0, data, pointer, fragment.length); 49 | pointer += fragment.length; 50 | } 51 | 52 | /** 53 | * @return the width 54 | */ 55 | public int getWidth() { 56 | return width; 57 | } 58 | 59 | /** 60 | * @return the height 61 | */ 62 | public int getHeight() { 63 | return height; 64 | } 65 | 66 | /** 67 | * @return the pointer 68 | */ 69 | public int getPointer() { 70 | return pointer; 71 | } 72 | 73 | /** 74 | * @return the data 75 | */ 76 | public int[] getData() { 77 | return data; 78 | } 79 | 80 | 81 | 82 | 83 | } 84 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/glue/RandomizeState.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.glue; 20 | 21 | /** 22 | * every class which implements this interface needs 23 | * to provide a function to shuffle its state. 24 | * 25 | * @author michu 26 | * 27 | */ 28 | public interface RandomizeState { 29 | 30 | /** 31 | * randomize its state. 32 | */ 33 | void shuffle(); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/jmx/PacketAndBytesStatictics.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | 20 | package com.neophob.sematrix.core.jmx; 21 | 22 | /** 23 | * interface to get some statistic information about a server 24 | * 25 | * @author mvogt 26 | * 27 | */ 28 | public interface PacketAndBytesStatictics { 29 | 30 | int getPacketCounter(); 31 | 32 | long getBytesRecieved(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/jmx/TimeMeasureItemGlobal.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.jmx; 20 | 21 | /** 22 | * This Enum is used to identify global performance values 23 | */ 24 | public enum TimeMeasureItemGlobal { 25 | 26 | GENERATOR, 27 | EFFECT, 28 | OUTPUT_SCHEDULE, 29 | FADER, 30 | DEBUG_WINDOW, 31 | OUTPUT_PREPARE_WAIT, 32 | OUTPUT_UPDATE_WAIT, 33 | MATRIX_EMULATOR_WINDOW; 34 | 35 | /** 36 | * Gets the readable name. 37 | * 38 | * @return the readable name 39 | */ 40 | public String getReadableName() { 41 | return name().toLowerCase().replace('_', ' '); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/jmx/TimeMeasureItemOutput.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.jmx; 20 | 21 | /** 22 | * This Enum is used to identify output specific performance values 23 | */ 24 | public enum TimeMeasureItemOutput { 25 | 26 | PREPARE, 27 | UPDATE; 28 | 29 | /** 30 | * Gets the readable name. 31 | * 32 | * @return the readable name 33 | */ 34 | public String getReadableName() { 35 | return name().toLowerCase().replace('_', ' '); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/mixer/AddSat.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.mixer; 20 | 21 | import com.neophob.sematrix.core.glue.Visual; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | /** 25 | * The Class AddSat. 26 | */ 27 | public class AddSat extends Mixer { 28 | 29 | /** 30 | * Instantiates a new adds the sat. 31 | * 32 | * @param controller the controller 33 | */ 34 | public AddSat() { 35 | super(MixerName.ADDSAT, ResizeName.QUALITY_RESIZE); 36 | } 37 | 38 | /* (non-Javadoc) 39 | * @see com.neophob.sematrix.core.mixer.Mixer#getBuffer(com.neophob.sematrix.core.glue.Visual) 40 | */ 41 | public int[] getBuffer(Visual visual) { 42 | 43 | if (visual.getEffect2() == null) { 44 | return visual.getEffect1Buffer(); 45 | } 46 | 47 | int[] src1 = visual.getEffect1Buffer(); 48 | int[] src2 = visual.getEffect2Buffer(); 49 | int[] dst = new int [src1.length]; 50 | 51 | int col; 52 | 53 | for (int i=0; i 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.mixer; 20 | 21 | import com.neophob.sematrix.core.glue.Visual; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | /** 25 | * The Class Either. 26 | * 27 | * @author michu 28 | */ 29 | public class Either extends Mixer { 30 | 31 | /** 32 | * Instantiates a new either. 33 | * 34 | * @param controller the controller 35 | */ 36 | public Either() { 37 | super(MixerName.EITHER, ResizeName.QUALITY_RESIZE); 38 | } 39 | 40 | /* (non-Javadoc) 41 | * @see com.neophob.sematrix.core.mixer.Mixer#getBuffer(com.neophob.sematrix.core.glue.Visual) 42 | */ 43 | public int[] getBuffer(Visual visual) { 44 | if (visual.getEffect2() == null) { 45 | return visual.getEffect1Buffer(); 46 | } 47 | 48 | int[] src1 = visual.getEffect1Buffer(); 49 | int[] src2 = visual.getEffect2Buffer(); 50 | int[] dst = new int [src1.length]; 51 | 52 | for (int i=0; i128) { 54 | dst[i] = src1[i]&0xff; 55 | } else { 56 | dst[i] = src2[i]&0xff; 57 | } 58 | } 59 | 60 | return dst; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/mixer/HalfHalf.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.mixer; 20 | 21 | import com.neophob.sematrix.core.glue.Visual; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | /** 25 | * HalfHalf split screen horizontal 26 | */ 27 | public class HalfHalf extends Mixer { 28 | 29 | /** 30 | * Instantiates a new multiply. 31 | * 32 | * @param controller the controller 33 | */ 34 | public HalfHalf() { 35 | super(MixerName.HALFHALF, ResizeName.PIXEL_RESIZE); 36 | } 37 | 38 | /* (non-Javadoc) 39 | * @see com.neophob.sematrix.core.mixer.Mixer#getBuffer(com.neophob.sematrix.core.glue.Visual) 40 | */ 41 | public int[] getBuffer(Visual visual) { 42 | if (visual.getEffect2() == null) { 43 | return visual.getEffect1Buffer(); 44 | } 45 | 46 | int[] src1 = visual.getEffect1Buffer(); 47 | int[] src2 = visual.getEffect2Buffer(); 48 | int[] dst = new int [src1.length]; 49 | 50 | int half = src1.length/2; 51 | for (int i=0; i 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.mixer; 20 | 21 | import com.neophob.sematrix.core.glue.Visual; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | /** 25 | * Minimum Mixer, the the larger value. 26 | */ 27 | public class Maximum extends Mixer { 28 | 29 | /** 30 | * Instantiates a new multiply. 31 | * 32 | * @param controller the controller 33 | */ 34 | public Maximum() { 35 | super(MixerName.MAXIMUM, ResizeName.QUALITY_RESIZE); 36 | } 37 | 38 | /* (non-Javadoc) 39 | * @see com.neophob.sematrix.core.mixer.Mixer#getBuffer(com.neophob.sematrix.core.glue.Visual) 40 | */ 41 | public int[] getBuffer(Visual visual) { 42 | if (visual.getEffect2() == null) { 43 | return visual.getEffect1Buffer(); 44 | } 45 | 46 | int[] src1 = visual.getEffect1Buffer(); 47 | int[] src2 = visual.getEffect2Buffer(); 48 | int[] dst = new int [src1.length]; 49 | 50 | for (int i=0; ipixelTwo ? pixelOne : pixelTwo; 55 | } 56 | 57 | return dst; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/mixer/Minimum.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.mixer; 20 | 21 | import com.neophob.sematrix.core.glue.Visual; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | /** 25 | * Minimum Mixer, the the lower value 26 | */ 27 | public class Minimum extends Mixer { 28 | 29 | /** 30 | * Instantiates a new multiply. 31 | * 32 | * @param controller the controller 33 | */ 34 | public Minimum() { 35 | super(MixerName.MINIMUM, ResizeName.QUALITY_RESIZE); 36 | } 37 | 38 | /* (non-Javadoc) 39 | * @see com.neophob.sematrix.core.mixer.Mixer#getBuffer(com.neophob.sematrix.core.glue.Visual) 40 | */ 41 | public int[] getBuffer(Visual visual) { 42 | if (visual.getEffect2() == null) { 43 | return visual.getEffect1Buffer(); 44 | } 45 | 46 | int[] src1 = visual.getEffect1Buffer(); 47 | int[] src2 = visual.getEffect2Buffer(); 48 | int[] dst = new int [src1.length]; 49 | 50 | for (int i=0; i 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.mixer; 20 | 21 | import com.neophob.sematrix.core.glue.Visual; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | /** 25 | * 50% 50% Mixer 26 | * 27 | */ 28 | public class Mix extends Mixer { 29 | 30 | /** 31 | * Instantiates a new mix. 32 | * 33 | * @param controller the controller 34 | */ 35 | public Mix() { 36 | super(MixerName.MIX, ResizeName.QUALITY_RESIZE); 37 | } 38 | 39 | /* (non-Javadoc) 40 | * @see com.neophob.sematrix.core.mixer.Mixer#getBuffer(com.neophob.sematrix.core.glue.Visual) 41 | */ 42 | public int[] getBuffer(Visual visual) { 43 | if (visual.getEffect2() == null) { 44 | return visual.getEffect1Buffer(); 45 | } 46 | 47 | int[] src1 = visual.getEffect1Buffer(); 48 | int[] src2 = visual.getEffect2Buffer(); 49 | int[] dst = new int [src1.length]; 50 | 51 | for (int i=0; i 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.mixer; 20 | 21 | import com.neophob.sematrix.core.glue.Visual; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | /** 25 | * The Class Multiply. 26 | */ 27 | public class Multiply extends Mixer { 28 | 29 | /** 30 | * Instantiates a new multiply. 31 | * 32 | * @param controller the controller 33 | */ 34 | public Multiply() { 35 | super(MixerName.MULTIPLY, ResizeName.QUALITY_RESIZE); 36 | } 37 | 38 | /* (non-Javadoc) 39 | * @see com.neophob.sematrix.core.mixer.Mixer#getBuffer(com.neophob.sematrix.core.glue.Visual) 40 | */ 41 | public int[] getBuffer(Visual visual) { 42 | if (visual.getEffect2() == null) { 43 | return visual.getEffect1Buffer(); 44 | } 45 | 46 | int[] src1 = visual.getEffect1Buffer(); 47 | int[] src2 = visual.getEffect2Buffer(); 48 | int[] dst = new int [src1.length]; 49 | 50 | for (int i=0; i 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.mixer; 20 | 21 | import com.neophob.sematrix.core.glue.Visual; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | /** 25 | * The Class NegativeMultiply. 26 | */ 27 | public class NegativeMultiply extends Mixer { 28 | 29 | /** 30 | * Instantiates a new negative multiply. 31 | * 32 | * @param controller the controller 33 | */ 34 | public NegativeMultiply() { 35 | super(MixerName.NEGATIVE_MULTIPLY, ResizeName.QUALITY_RESIZE); 36 | } 37 | 38 | /* (non-Javadoc) 39 | * @see com.neophob.sematrix.core.mixer.Mixer#getBuffer(com.neophob.sematrix.core.glue.Visual) 40 | */ 41 | public int[] getBuffer(Visual visual) { 42 | if (visual.getEffect2() == null) { 43 | return visual.getEffect1Buffer(); 44 | } 45 | 46 | int[] src1 = visual.getEffect1Buffer(); 47 | int[] src2 = visual.getEffect2Buffer(); 48 | int[] dst = new int [src1.length]; 49 | 50 | for (int i=0; i 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.mixer; 20 | 21 | import com.neophob.sematrix.core.glue.Visual; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | /** 25 | * The Class PassThruMixer. 26 | */ 27 | public class PassThruMixer extends Mixer { 28 | 29 | /** 30 | * Instantiates a new pass thru mixer. 31 | * 32 | * @param controller the controller 33 | */ 34 | public PassThruMixer() { 35 | super(MixerName.PASSTHRU, ResizeName.QUALITY_RESIZE); 36 | } 37 | 38 | /* (non-Javadoc) 39 | * @see com.neophob.sematrix.core.mixer.Mixer#getBuffer(com.neophob.sematrix.core.glue.Visual) 40 | */ 41 | public int[] getBuffer(Visual visual) { 42 | return visual.getEffect1Buffer(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/mixer/SubSat.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.mixer; 20 | 21 | import com.neophob.sematrix.core.glue.Visual; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | 24 | /** 25 | * The Class AddSat. 26 | */ 27 | public class SubSat extends Mixer { 28 | 29 | /** 30 | * Instantiates a new adds the sat. 31 | * 32 | * @param controller the controller 33 | */ 34 | public SubSat() { 35 | super(MixerName.SUBSAT, ResizeName.QUALITY_RESIZE); 36 | } 37 | 38 | /* (non-Javadoc) 39 | * @see com.neophob.sematrix.core.mixer.Mixer#getBuffer(com.neophob.sematrix.core.glue.Visual) 40 | */ 41 | public int[] getBuffer(Visual visual) { 42 | 43 | if (visual.getEffect2() == null) { 44 | return visual.getEffect1Buffer(); 45 | } 46 | 47 | int[] src1 = visual.getEffect1Buffer(); 48 | int[] src2 = visual.getEffect2Buffer(); 49 | int[] dst = new int [src1.length]; 50 | 51 | int col; 52 | 53 | for (int i=0; i 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.mixer; 20 | 21 | import com.neophob.sematrix.core.glue.Visual; 22 | import com.neophob.sematrix.core.resize.Resize.ResizeName; 23 | import com.neophob.sematrix.core.sound.ISound; 24 | 25 | /** 26 | * mix src/dst accoring to volume of sound!. 27 | * 28 | * @author michu 29 | */ 30 | public class Voluminizer extends Mixer { 31 | 32 | private ISound sound; 33 | /** 34 | * Instantiates a new voluminizer. 35 | * 36 | * @param controller the controller 37 | */ 38 | public Voluminizer(ISound sound) { 39 | super(MixerName.VOLUMINIZER, ResizeName.QUALITY_RESIZE); 40 | this.sound = sound; 41 | } 42 | 43 | /* (non-Javadoc) 44 | * @see com.neophob.sematrix.core.mixer.Mixer#getBuffer(com.neophob.sematrix.core.glue.Visual) 45 | */ 46 | public int[] getBuffer(Visual visual) { 47 | if (visual.getEffect2() == null) { 48 | return visual.getEffect1Buffer(); 49 | } 50 | 51 | int[] src1 = visual.getEffect1Buffer(); 52 | int[] src2 = visual.getEffect2Buffer(); 53 | int[] dst = new int [src1.length]; 54 | 55 | float snd = sound.getVolumeNormalized(); 56 | for (int i=0; i 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.output; 20 | 21 | import com.neophob.sematrix.core.output.gamma.GammaType; 22 | 23 | /** 24 | * Output device interface 25 | * 26 | * @author michu 27 | * 28 | */ 29 | public interface IOutput { 30 | 31 | /** 32 | * 33 | * @return Output type 34 | */ 35 | OutputDeviceEnum getType(); 36 | 37 | /** 38 | * connection oriented device? 39 | * @return 40 | */ 41 | boolean isSupportConnectionState(); 42 | 43 | /** 44 | * 45 | * @return connection state 46 | */ 47 | boolean isConnected(); 48 | 49 | /** 50 | * if device supports a connection status, overwrite me. 51 | * examples: connected to /dev/aaa or IP Adress: 1.2.3.4 52 | */ 53 | String getConnectionStatus(); 54 | 55 | /** 56 | * configured gamma type 57 | * @return 58 | */ 59 | GammaType getGammaType(); 60 | 61 | /** 62 | * 63 | * @return color resolution 64 | */ 65 | int getBpp(); 66 | 67 | /** 68 | * @return how many errors occured (if supported) 69 | */ 70 | long getErrorCounter(); 71 | } 72 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/output/NoSerialPortFoundException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.output; 20 | 21 | /** 22 | * If the library is unable to find a serial port, this Exception will be thrown 23 | *

24 | * part of the neorainbowduino library 25 | * 26 | * @author Michael Vogt / neophob.com 27 | * 28 | */ 29 | public class NoSerialPortFoundException extends Exception { 30 | 31 | /** 32 | * 33 | */ 34 | private static final long serialVersionUID = -6432383124399209942L; 35 | 36 | /** 37 | * 38 | * @param s 39 | */ 40 | public NoSerialPortFoundException(String s) { 41 | super(s); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/output/NullDevice.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.output; 20 | 21 | import com.neophob.sematrix.core.properties.ApplicationConfigurationHelper; 22 | 23 | /** 24 | * does nothin. 25 | * 26 | * @author michu 27 | */ 28 | public class NullDevice extends Output { 29 | 30 | /** 31 | * init the null devices. 32 | * 33 | * @param controller the controller 34 | */ 35 | public NullDevice(ApplicationConfigurationHelper ph) { 36 | super(OutputDeviceEnum.NULL, ph, 8); 37 | this.supportConnectionState = true; 38 | } 39 | 40 | /* (non-Javadoc) 41 | * @see com.neophob.sematrix.core.output.Output#update() 42 | */ 43 | public void update() { 44 | //nothing todo 45 | } 46 | 47 | /* (non-Javadoc) 48 | * @see com.neophob.sematrix.core.output.Output#close() 49 | */ 50 | @Override 51 | public void close() { 52 | //nothing todo 53 | } 54 | 55 | @Override 56 | public boolean isConnected() { 57 | return true; 58 | } 59 | 60 | @Override 61 | public String getConnectionStatus(){ 62 | return "Connected on port NULL"; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/output/SerialPortException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.output; 20 | 21 | /** 22 | * If the library is unable to find a serial port, this Exception will be thrown 23 | *

24 | * part of the neorainbowduino library 25 | * 26 | * @author Michael Vogt / neophob.com 27 | * 28 | */ 29 | public class SerialPortException extends Exception { 30 | 31 | 32 | /** 33 | * 34 | */ 35 | private static final long serialVersionUID = 3951181732955456485L; 36 | 37 | /** 38 | * 39 | * @param s 40 | */ 41 | public SerialPortException(String s) { 42 | super(s); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/output/gamma/GammaType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.output.gamma; 20 | 21 | /** 22 | * define gamma type 23 | * 24 | * @author michu 25 | * 26 | */ 27 | public enum GammaType { 28 | NONE, 29 | GAMMA_20, 30 | GAMMA_22, 31 | GAMMA_25, 32 | SPECIAL1, 33 | } 34 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/output/gamma/RGBAdjust.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.output.gamma; 20 | 21 | /** 22 | * fine tune color resolution of multiple pixelinvaders panels 23 | * 24 | * @author michu 25 | * 26 | */ 27 | public class RGBAdjust { 28 | 29 | private int r,g,b; 30 | 31 | /** 32 | * 33 | * @param r 34 | * @param g 35 | * @param b 36 | */ 37 | public RGBAdjust(int r, int g, int b) { 38 | this.r = r; 39 | this.g = g; 40 | this.b = b; 41 | } 42 | 43 | public int getR() { 44 | return r; 45 | } 46 | 47 | public int getG() { 48 | return g; 49 | } 50 | 51 | public int getB() { 52 | return b; 53 | } 54 | 55 | /* (non-Javadoc) 56 | * @see java.lang.Object#toString() 57 | */ 58 | @Override 59 | public String toString() { 60 | return String.format("RGBAdjust [r=%s, g=%s, b=%s]", r, g, b); 61 | } 62 | 63 | 64 | 65 | } 66 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/output/pixelinvaders/WriteDataException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.output.pixelinvaders; 20 | 21 | public class WriteDataException extends Exception { 22 | 23 | /** 24 | * 25 | */ 26 | private static final long serialVersionUID = 3624265971632374001L; 27 | 28 | public WriteDataException() { 29 | // TODO Auto-generated constructor stub 30 | } 31 | 32 | public WriteDataException(String message) { 33 | super(message); 34 | // TODO Auto-generated constructor stub 35 | } 36 | 37 | public WriteDataException(Throwable cause) { 38 | super(cause); 39 | // TODO Auto-generated constructor stub 40 | } 41 | 42 | public WriteDataException(String message, Throwable cause) { 43 | super(message, cause); 44 | // TODO Auto-generated constructor stub 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/properties/ColorFormat.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.properties; 20 | 21 | /** 22 | * color format of a hardware device. 23 | * 24 | * @author michu 25 | * noxx6: added all possible RGB-LED color orders as valid input: 06.12.11 26 | * 27 | */ 28 | public enum ColorFormat { 29 | 30 | /** The RGB. */ 31 | RGB, 32 | 33 | /** The RBG. */ 34 | RBG, 35 | 36 | /** The BRG. */ 37 | BRG, 38 | 39 | /** The BGR. */ 40 | BGR, 41 | 42 | /** The GBR. */ 43 | GBR, 44 | 45 | /** The GRB. */ 46 | GRB 47 | } 48 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/properties/CommandGroup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.properties; 20 | 21 | /** 22 | * The Enum CommandGroup used to group valid commands together. 23 | * this is only used to display the help message in the cli client 24 | * 25 | * @author michu 26 | */ 27 | public enum CommandGroup { 28 | 29 | /** The VISUAL. */ 30 | VISUAL, 31 | 32 | /** The OUTPUT. */ 33 | OUTPUT, 34 | 35 | /** The GENERATOR. */ 36 | GENERATOR, 37 | 38 | /** The EFFECT. */ 39 | EFFECT, 40 | 41 | /** The MISC. */ 42 | MISC; 43 | } 44 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/properties/DeviceConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.properties; 20 | 21 | /** 22 | * The Enum DeviceConfig. 23 | * 24 | * @author michu 25 | */ 26 | public enum DeviceConfig { 27 | 28 | /** The No rotate. */ 29 | NO_ROTATE, 30 | 31 | /** The ROTATE 90. */ 32 | ROTATE_90, 33 | 34 | /** The ROTATE 90 flippedy. */ 35 | ROTATE_90_FLIPPEDY, 36 | 37 | /** The ROTATE 180. */ 38 | ROTATE_180, 39 | 40 | /** The ROTATE 180 flippedy. */ 41 | ROTATE_180_FLIPPEDY, 42 | 43 | /** The ROTATE 270. */ 44 | ROTATE_270 45 | } 46 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/resize/IResize.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.resize; 20 | 21 | import java.awt.image.BufferedImage; 22 | 23 | /** 24 | * This interface is used to create different resizer (speed vs. quality) 25 | * @author michu 26 | * 27 | */ 28 | public interface IResize { 29 | 30 | /** 31 | * resize an array of images 32 | * @param buffer 33 | * @param newX 34 | * @param newY 35 | * @param currentXSize 36 | * @param currentYSize 37 | * @return 38 | */ 39 | int[] getBuffer(int[] buffer, int newX, int newY, int currentXSize, int currentYSize); 40 | 41 | /** 42 | * resize an image type 43 | * @param bi 44 | * @param newX 45 | * @param newY 46 | * @return 47 | */ 48 | int[] getBuffer(BufferedImage bi, int newX, int newY); 49 | 50 | /** 51 | * 52 | * @return id of the resizer 53 | */ 54 | int getId(); 55 | 56 | /** 57 | * 58 | * @return name of the resizer 59 | */ 60 | String getName(); 61 | 62 | /** 63 | * create a buffered image 64 | * @param buffer 65 | * @param currentXSize 66 | * @param currentYSize 67 | * @return 68 | */ 69 | BufferedImage createImage(int[] buffer, int currentXSize, int currentYSize); 70 | } 71 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/resize/PixelResize.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.resize; 20 | 21 | import java.awt.image.BufferedImage; 22 | 23 | import com.neophob.sematrix.core.resize.util.ScalrOld; 24 | 25 | /** 26 | * This filter is optimized for pixel oriented images. 27 | * 28 | * @author michu 29 | */ 30 | public class PixelResize extends Resize { 31 | 32 | /** 33 | * Instantiates a new pixel resize. 34 | * 35 | * @param controller the controller 36 | */ 37 | public PixelResize() { 38 | super(ResizeName.PIXEL_RESIZE); 39 | } 40 | 41 | 42 | @Override 43 | public int[] getBuffer(BufferedImage bi, int newX, int newY) { 44 | bi = ScalrOld.resize(bi, ScalrOld.Method.SPEED, newX, newY); 45 | int[] ret = getPixelsFromImage(bi, newX, newY); 46 | 47 | //destroy image 48 | bi.flush(); 49 | 50 | return ret; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/resize/QualityResize.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.resize; 20 | 21 | import java.awt.image.BufferedImage; 22 | 23 | import com.neophob.sematrix.core.resize.util.ScalrOld; 24 | 25 | /** 26 | * This filter is more like an area average filter. 27 | * 28 | * @author michu 29 | */ 30 | public class QualityResize extends Resize { 31 | 32 | /** 33 | * Instantiates a new quality resize. 34 | * 35 | * @param controller the controller 36 | */ 37 | public QualityResize() { 38 | super(ResizeName.QUALITY_RESIZE); 39 | } 40 | 41 | 42 | @Override 43 | public int[] getBuffer(BufferedImage bi, int newX, int newY) { 44 | bi = ScalrOld.resize(bi, ScalrOld.Method.QUALITY, newX, newY); 45 | int[] ret = getPixelsFromImage(bi, newX, newY); 46 | 47 | //destroy image 48 | bi.flush(); 49 | 50 | return ret; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/sound/BeatToAnimation.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.sound; 20 | 21 | import org.apache.commons.lang3.StringUtils; 22 | import org.apache.commons.lang3.text.WordUtils; 23 | 24 | /** 25 | * define how the generators should react on the beats 26 | * @author michu 27 | * 28 | */ 29 | public enum BeatToAnimation { 30 | 31 | LINEAR(0), 32 | 33 | MODERATE(1), 34 | 35 | HEAVY(2) 36 | 37 | ; 38 | 39 | /** The id. */ 40 | private int id; 41 | 42 | BeatToAnimation(int id) { 43 | this.id = id; 44 | } 45 | 46 | /** 47 | * Gets the id. 48 | * 49 | * @return the id 50 | */ 51 | public int getId() { 52 | return id; 53 | } 54 | /** 55 | * 56 | * @return 57 | */ 58 | public String guiText() { 59 | return WordUtils.capitalizeFully(StringUtils.replace(this.name(), "_", " ")); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/main/java/com/neophob/sematrix/core/sound/ISound.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.sound; 20 | 21 | /** 22 | * The Interface SeSound. 23 | * 24 | * @author michu 25 | */ 26 | public interface ISound { 27 | 28 | /** 29 | * 30 | * @return sound input implementation name 31 | */ 32 | String getImplementationName(); 33 | 34 | /** 35 | * Gets the volume. 36 | * 37 | * @return the current volume 38 | */ 39 | float getVolume(); 40 | 41 | /** 42 | * Gets the volume normalized. 43 | * 44 | * @return the volume normalized 45 | */ 46 | float getVolumeNormalized(); 47 | 48 | /** 49 | * Checks if is kick. 50 | * 51 | * @return true, if is kick drum is heard 52 | */ 53 | boolean isKick(); 54 | 55 | /** 56 | * Checks if is snare. 57 | * 58 | * @return true, if is snare drum is heard 59 | */ 60 | boolean isSnare(); 61 | 62 | /** 63 | * Checks if is hat. 64 | * 65 | * @return true, if is hat is heard 66 | */ 67 | boolean isHat(); 68 | 69 | /** 70 | * Checks if is pang. 71 | * 72 | * @return true, if is kick/snare or hat is hit 73 | */ 74 | boolean isPang(); 75 | 76 | /** 77 | * Shutdown. 78 | */ 79 | void shutdown(); 80 | 81 | /** 82 | * Gets the fft avg. 83 | * 84 | * @return the fft avg 85 | */ 86 | int getFftAvg(); 87 | 88 | /** 89 | * Gets the fft avg. 90 | * 91 | * @param i the i 92 | * @return the fft avg 93 | */ 94 | float getFftAvg(int i); 95 | } 96 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/test/java/com/neophob/sematrix/core/glue/FileUtilsJunit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.glue; 20 | 21 | import com.neophob.sematrix.core.glue.FileUtils; 22 | 23 | 24 | /** 25 | * Helper Class to find some files 26 | * @author michu 27 | * 28 | */ 29 | public class FileUtilsJunit extends FileUtils { 30 | 31 | public FileUtilsJunit() { 32 | super(System.getProperty("user.dir")+"/../pixelcontroller-distribution/src/main/resources"); 33 | } 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/test/java/com/neophob/sematrix/core/glue/FileUtilsTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.glue; 20 | 21 | import static org.junit.Assert.assertFalse; 22 | import static org.junit.Assert.assertNotNull; 23 | import static org.junit.Assert.assertTrue; 24 | 25 | import java.util.List; 26 | 27 | import org.junit.Test; 28 | 29 | import com.neophob.sematrix.core.glue.FileUtils; 30 | import com.neophob.sematrix.core.glue.PresetSettings; 31 | 32 | /** 33 | * test internal buffer size 34 | * 35 | * @author michu 36 | * 37 | */ 38 | public class FileUtilsTest { 39 | 40 | @Test 41 | public void findFilesTest() throws Exception { 42 | FileUtils fu = new FileUtilsJunit(); 43 | 44 | String[] bmlFiles = fu.findBlinkenFiles(); 45 | assertNotNull(bmlFiles); 46 | assertTrue(bmlFiles.length>2); 47 | 48 | String[] imgFiles = fu.findImagesFiles(); 49 | assertNotNull(imgFiles); 50 | assertTrue(imgFiles.length>2); 51 | 52 | assertFalse(fu.getRootDirectory().isEmpty()); 53 | 54 | List presets = fu.loadPresents(128); 55 | assertNotNull(presets); 56 | assertTrue(presets.size()>2); 57 | 58 | fu.savePresents(presets); 59 | 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/test/java/com/neophob/sematrix/core/output/ArtnetDeviceTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.output; 20 | 21 | import org.junit.Test; 22 | 23 | /** 24 | * verify universe fliping 25 | * @author michu 26 | * 27 | */ 28 | public class ArtnetDeviceTest { 29 | 30 | @Test 31 | public void testArtnetUniverse() { 32 | 33 | int pixelsPerUniverse = 8;//170; 34 | int bfrsze = 8*2; 35 | int nrOfUniverse=1; 36 | 37 | int bufferSize=bfrsze; 38 | if (bufferSize > pixelsPerUniverse) { 39 | while (bufferSize > pixelsPerUniverse) { 40 | nrOfUniverse++; 41 | bufferSize -= pixelsPerUniverse; 42 | } 43 | } 44 | //System.out.println("nrOfUniverse: "+nrOfUniverse); 45 | int remainingInt = bfrsze; 46 | 47 | 48 | int ofs=0; 49 | for (int i=0; i 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.output; 20 | 21 | import static org.junit.Assert.assertEquals; 22 | 23 | import org.junit.Test; 24 | 25 | import com.neophob.sematrix.core.output.OutputHelper; 26 | 27 | /** 28 | * verify the scanline flip code 29 | * @author michu 30 | * 31 | */ 32 | public class MiniDmxDeviceTest { 33 | 34 | @Test 35 | public void speedTestOld() { 36 | int[] buffer = new int[] { 37 | 1,2,3,0,0,0,0,0, 38 | 8,8,8,8,0,0,0,0, 39 | 0,0,0,0,0,0,0,0, 40 | 0,0,0,0,0,0,0,4 41 | }; 42 | buffer = OutputHelper.flipSecondScanline(buffer, 8, 4); 43 | //RotateBufferTest.dumpBuffer(buffer); 44 | assertEquals(1, buffer[0]); 45 | assertEquals(2, buffer[1]); 46 | assertEquals(8, buffer[12]); 47 | assertEquals(4, buffer[24]); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/test/java/com/neophob/sematrix/core/output/PixelControllerDeviceTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.core.output; 20 | 21 | import static org.junit.Assert.assertFalse; 22 | import static org.junit.Assert.assertTrue; 23 | 24 | import org.junit.Test; 25 | 26 | import com.neophob.sematrix.core.output.pixelinvaders.Lpd6803Common; 27 | import com.neophob.sematrix.core.output.pixelinvaders.WriteDataException; 28 | 29 | /** 30 | * verify caching 31 | * @author michu 32 | * 33 | */ 34 | public class PixelControllerDeviceTest extends Lpd6803Common { 35 | 36 | public PixelControllerDeviceTest() { 37 | super(8,8); 38 | } 39 | 40 | @Test 41 | public void testChaching() { 42 | int[] b = new int[64]; 43 | assertTrue(didFrameChange((byte)0, b)); 44 | assertFalse(didFrameChange((byte)0, b)); 45 | b[0]=5; 46 | assertTrue(didFrameChange((byte)0, b)); 47 | } 48 | 49 | @Override 50 | protected void writeData(byte[] cmdfull) throws WriteDataException { 51 | // TODO Auto-generated method stub 52 | 53 | } 54 | 55 | @Override 56 | protected boolean waitForAck() { 57 | // TODO Auto-generated method stub 58 | return false; 59 | } 60 | 61 | @Override 62 | protected byte[] getReplyFromController() { 63 | // TODO Auto-generated method stub 64 | return null; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /pixelcontroller-core/src/test/resources/logging.properties: -------------------------------------------------------------------------------- 1 | # Properties file which configures the operation of the JDK 2 | # logging facility. 3 | 4 | # The system will look for this config file, first using 5 | # a System property specified at startup: 6 | # 7 | # >java -Djava.util.logging.config.file=myLoggingConfigFilePath 8 | # 9 | # If this property is not specified, then the config file is 10 | # retrieved from its default location at: 11 | # 12 | # JDK_HOME/jre/lib/logging.properties 13 | 14 | # Global logging properties. 15 | # ------------------------------------------ 16 | # The set of handlers to be loaded upon startup. 17 | # Comma-separated list of class names. 18 | # (? LogManager docs say no comma here, but JDK example has comma.) 19 | handlers=java.util.logging.ConsoleHandler 20 | 21 | # Default global logging level. 22 | # Loggers and Handlers may override this level 23 | .level=WARNING 24 | 25 | # Handlers 26 | # ----------------------------------------- 27 | 28 | # --- ConsoleHandler --- 29 | # Override of global logging level 30 | # Use serve level only for console handler 31 | java.util.logging.ConsoleHandler.level=WARNING 32 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter 33 | 34 | 35 | #EOF 36 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /bin 3 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/04B_03__.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/04B_03__.TTF -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/client.policy: -------------------------------------------------------------------------------- 1 | grant{ 2 | permission java.security.AllPermission; 3 | }; 4 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/config.examples/README: -------------------------------------------------------------------------------- 1 | copy the desired config file into the data directory and rename it to config.properties. -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/gui/guilogo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/gui/guilogo.jpg -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/logging.properties: -------------------------------------------------------------------------------- 1 | # Properties file which configures the operation of the JDK 2 | # logging facility. 3 | 4 | # The system will look for this config file, first using 5 | # a System property specified at startup: 6 | # 7 | # >java -Djava.util.logging.config.file=myLoggingConfigFilePath 8 | # 9 | # If this property is not specified, then the config file is 10 | # retrieved from its default location at: 11 | # 12 | # JDK_HOME/jre/lib/logging.properties 13 | 14 | # Global logging properties. 15 | # ------------------------------------------ 16 | # The set of handlers to be loaded upon startup. 17 | # Comma-separated list of class names. 18 | # (? LogManager docs say no comma here, but JDK example has comma.) 19 | handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler 20 | 21 | # Default global logging level. 22 | # Loggers and Handlers may override this level 23 | .level=INFO 24 | 25 | # Handlers 26 | # ----------------------------------------- 27 | 28 | # --- ConsoleHandler --- 29 | # Override of global logging level 30 | # Use serve level only for console handler 31 | java.util.logging.ConsoleHandler.level=INFO 32 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter 33 | 34 | # --- FileHandler --- 35 | # Override of global logging level 36 | # Log everything to file 37 | java.util.logging.FileHandler.level=ALL 38 | 39 | # Naming style for the output file: 40 | # (The output file is placed in the directory 41 | # defined by the "user.home" System property.) 42 | java.util.logging.FileHandler.pattern=log/pixelcontroller.log 43 | 44 | # Append log entreis to the file 45 | java.util.logging.FileHandler.append=true 46 | 47 | # Limiting size of output file in bytes: 48 | java.util.logging.FileHandler.limit=4096000 49 | 50 | # Number of output files to cycle through, by appending an 51 | # integer to the base file name: 52 | java.util.logging.FileHandler.count=2 53 | 54 | # Style of output (Simple or XML): 55 | java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter 56 | 57 | #EOF 58 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/_logo.gif -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/check.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/check.jpg -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/circle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/circle.jpg -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/ff-logo-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/ff-logo-small.jpg -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/gradient.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/gradient.jpg -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/half.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/half.jpg -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/hls.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/hls.jpg -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/hsv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/hsv.jpg -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-chat.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-chess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-chess.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-cloud.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-control.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-cross.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-glass.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-gun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-gun.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-heart.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-home.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-ithing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-ithing.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-lock.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-moon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-moon1.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-moon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-moon2.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-note.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-pattern.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-pause.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-photo.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-play.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-polaroid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-polaroid.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-pwr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-pwr.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-question.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-saturn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-saturn.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-shield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-shield.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-shoe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-shoe.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-skates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-skates.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-skull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-skull.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-smiley.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-smiley.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-social-fb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-social-fb.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-social-twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-social-twitter.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-three-layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-three-layers.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-three-mokeys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-three-mokeys.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-tiefighter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-tiefighter.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/icn-yourehere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/icn-yourehere.png -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/logoBig.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/logoBig.jpg -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/right.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/right.jpg -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/stripes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/stripes.jpg -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/pics/tex4_256.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/pics/tex4_256.jpg -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/data/setup/splash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/data/setup/splash.jpg -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/docs/readme.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/docs/readme.pdf -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/header.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011-${year} Michael Vogt <${email}> 2 | 3 | This file is part of PixelController. 4 | 5 | PixelController is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | PixelController is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with PixelController. If not, see . -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/Readme.txt: -------------------------------------------------------------------------------- 1 | Arduino based firmware files, basically to convert the serial signal to an SPI signal. 2 | 3 | Details: 4 | pixelinvaders: PixelInvader firmware and library files (from http://pixelinvaders.ch). 5 | rainbowduinoV2: Rainbowduino v2 firmware (from Seeedstudio). Those little devices are EOL. 6 | rainbowduinoV3: Rainbowduino v3 firmware (from Seeedstudio). 7 | stealthSpi: Stealth panels firmware (from Element Labs). EOL. 8 | tpm2net: firmware for the tpm2.net protocol 9 | tpm2serial: firmware for the tpm2.serial protocol -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/libraries/FastSPI_LED/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For DmxSimple 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | CFastSPI_LED KEYWORD1 10 | FastSPI_LED KEYWORD1 11 | 12 | ####################################### 13 | # Methods and Functions (KEYWORD2) 14 | ####################################### 15 | 16 | start KEYWORD2 17 | stop KEYWORD2 18 | init KEYWORD2 19 | setLeds KEYWORD2 20 | setChipset KEYWORD2 21 | setCPUPercentage KEYWORD2 22 | setRGBData KEYWORD2 23 | getRGBData KEYWORD2 24 | setDirty KEYWORD2 25 | show KEYWORD2 26 | getCounter KEYWORD2 27 | clearCounter KEYWORD2 28 | getCycleTime KEYWORD2 29 | getCycleTarget KEYWORD2 30 | 31 | ####################################### 32 | # Constants (LITERAL1) 33 | ####################################### 34 | 35 | SPI_595 LITERAL1 36 | SPI_HL1606 LITERAL1 37 | SPI_LPD6803 LITERAL1 38 | SPI_WS2801 LITERAL1 39 | SPI_TM1809 LITERAL1 40 | CFastSPI_LED::SPI_595 LITERAL1 41 | CFastSPI_LED::SPI_HL1606 LITERAL1 42 | CFastSPI_LED::SPI_LPD6803 LITERAL1 43 | CFastSPI_LED::SPI_WS2801 LITERAL1 44 | CFastSPI_LED::SPI_TM1809 LITERAL1 45 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/libraries/FastSPI_LED2/controller.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_CONTROLLER_H 2 | #define __INC_CONTROLLER_H 3 | 4 | #include 5 | #include "pixeltypes.h" 6 | 7 | 8 | #define RGB_BYTE0(X) ((X>>6) & 0x3) 9 | #define RGB_BYTE1(X) ((X>>3) & 0x3) 10 | #define RGB_BYTE2(X) ((X) & 0x3) 11 | 12 | // operator byte *(struct CRGB[] arr) { return (byte*)arr; } 13 | 14 | 15 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 16 | // 17 | // LED Controller interface definition 18 | // 19 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 20 | 21 | /// Base definition for an LED controller. Pretty much the methods that every LED controller object will make available. 22 | /// Note that the showARGB method is not impelemented for all controllers yet. Note also the methods for eventual checking 23 | /// of background writing of data (I'm looking at you, teensy 3.0 DMA controller!). If you want to pass LED controllers around 24 | /// to methods, make them references to this type, keeps your code saner. 25 | class CLEDController { 26 | public: 27 | // initialize the LED controller 28 | virtual void init() = 0; 29 | 30 | // reset any internal state to a clean point 31 | virtual void reset() { init(); } 32 | 33 | // clear out/zero out the given number of leds. 34 | virtual void clearLeds(int nLeds) = 0; 35 | 36 | // set all the leds on the controller to a given color 37 | virtual void showColor(const struct CRGB & data, int nLeds, uint8_t scale = 255) = 0; 38 | 39 | // note that the uint8_ts will be in the order that you want them sent out to the device. 40 | // nLeds is the number of RGB leds being written to 41 | virtual void show(const struct CRGB *data, int nLeds, uint8_t scale = 255) = 0; 42 | 43 | #ifdef SUPPORT_ARGB 44 | // as above, but every 4th uint8_t is assumed to be alpha channel data, and will be skipped 45 | virtual void show(const struct CARGB *data, int nLeds, uint8_t scale = 255) = 0; 46 | #endif 47 | 48 | // is the controller ready to write data out 49 | virtual bool ready() { return true; } 50 | 51 | // wait until the controller is ready to write data out 52 | virtual void wait() { return; } 53 | 54 | }; 55 | 56 | #endif -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/libraries/FastSPI_LED2/fastspi_dma.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/libraries/FastSPI_LED2/fastspi_dma.h -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/libraries/FastSPI_LED2/preview_changes.txt: -------------------------------------------------------------------------------- 1 | Release Candidate 4 2 | * Added NEOPIXEL as a synonym for WS2811 3 | * Fix WS2811/WS2812B timings, bring it in line to exactly 1.25ns/bit. 4 | * Fix handling of constant color definitions (damn you, gcc!) 5 | 6 | Release Candidate 3 7 | * Fixed bug when Clock and Data were on the same port 8 | * Added ability to set pixel color directly from HSV 9 | * Added ability to retrieve current random16 seed 10 | 11 | Release Candidate 2 12 | * mostly bug fixes 13 | * Fix SPI macro definitions for latest teensy3 software update 14 | * Teensy 2 compilation fix 15 | * hsv2rgb_rainbow performance fix 16 | 17 | Release Candidate 1 18 | * New unified/simplified API for adding/using controllers 19 | * fleshout clockless chip support 20 | * add hsv (spectrum and rainbow style colors) 21 | * high speed memory management operations 22 | * library for interpolation/easing functions 23 | * various api changes, addition of clear and showColor functions 24 | * scale value applied to all show methods 25 | * bug fixes for SM16716 26 | * performance improvements, lpd8806 exceeds 22Mbit now 27 | * hardware def fixes 28 | * allow alternate rgb color orderings 29 | * high speed math methods 30 | * rich CRGB structure 31 | 32 | Preview 3 33 | * True hardware SPI support for teensy (up to 20Mbit output!) 34 | * Minor bug fixes/tweaks 35 | 36 | Preview 2 37 | * Rename pin class to FastPin 38 | * Replace latch with select, more accurate description of what it does 39 | * Enforce intra-frame timing for ws2801s 40 | * SM16716 support 41 | * Add #define FAST_SPI_INTERRUPTS_WRITE_PINS to make sure world is ok w/interrupts and SPI 42 | * Add #define FORCE_SOFTWARE_SPI for those times when you absolutely don't want to use hardware SPI, ev 43 | en if you're using the hardware SPI pins 44 | * Add pin definitions for the arduino megas - should fix ws2811 support 45 | * Add pin definitions for the leonardo - should fix spi support and pin mappings 46 | * Add warnings when pin definitions are missing 47 | * Added google+ community for fastspi users - https://plus.google.com/communities/109127054924227823508 48 | # Add pin definitions for Teensy++ 2.0 49 | 50 | 51 | Preview 1 52 | * Initial release 53 | 54 | 55 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/libraries/neophob_lpd6803spi/Neophob_LPD6803.h: -------------------------------------------------------------------------------- 1 | #if (ARDUINO >= 100) 2 | #include 3 | #else 4 | #include 5 | #include 6 | #endif 7 | 8 | 9 | class Neophob_LPD6803 { 10 | 11 | public: 12 | // Use SPI hardware; specific pins only: 13 | Neophob_LPD6803(uint16_t n); 14 | 15 | void 16 | begin(uint8_t divider), 17 | show(void), 18 | setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b), 19 | setPixelColor(uint16_t n, uint16_t c), 20 | setCPU(long isrCallInMicroSec); 21 | uint16_t 22 | numPixels(void); 23 | 24 | private: 25 | uint16_t 26 | numLEDs; 27 | void 28 | startSPI(uint8_t divider); 29 | }; -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/libraries/neophob_lpd6803spi/README: -------------------------------------------------------------------------------- 1 | This is an Arduino library for LPD6803 based led Pixels. 2 | You can get the modules in my online shop at http://pixelinvaders.ch/?page_id=390 3 | 4 | This Library uses the SPI bus, so the pins you need is defined by hardware: 5 | ---- 6 | Unlike software SPI which is configurable, hardware SPI works only on very specific pins. 7 | 8 | On the Arduino Uno, Duemilanove, etc., clock = pin 13 and data = pin 11. 9 | For the Arduino Mega, clock = pin 52, data = pin 51. 10 | For the ATmega32u4 Breakout Board and Teensy, clock = pin B1, data = B2. 11 | 12 | Alternately, on most boards you can use the 6-pin programming 13 | header for SPI output as well, in which case clock = pin 3 and data = pin 4. 14 | 15 | src: http://forums.adafruit.com/viewtopic.php?f=47&t=24256 16 | thanks phil! 17 | ---- 18 | 19 | This Library is basically a copy and paste work and relies on work of Adafruit-WS2801-Library and FastSPI Library 20 | 21 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/pixelinvaders/Readme.txt: -------------------------------------------------------------------------------- 1 | PixelInvaders Firmware for Arduino (like Teensy 2.0) compatible boards. 2 | 3 | Details: 4 | neoLedLPD6803Spi: The SPI PixelInvaders firmware. If you bought a PixelInvaders DIY, this is the firmware you need. 5 | neoLedWS2801Spi: The SPI PixelInvaders firmware to use with WS2801 LED pixels. 6 | 7 | libraries: This directory contains needed Arduino libraries. Depending which firmware you want to install on your Arduino/Teensy, you need other libraries: 8 | 9 | Details: 10 | libraries/FastSPI_LED: needed for the neoLedWS2801Spi firmware 11 | libraries/Lpd6803: needed for the neoLedLPD6803 firmware 12 | libraries/neophob_lpd6803spi: needed for the neoLedLPD6803Spi firmware 13 | libraries/timer1: needed for the neoLedLPD6803 and neoLedLPD6803Spi firmware 14 | 15 | Hint 1: 16 | SPI limit you to use specific ports on a Arduino board and may not work if you use for example an Ethernet Shield. 17 | 18 | Hint 2: 19 | Use a Teensy 2.0 board for fast serial throughput. An Arduino *may* work but give you quite a slow experience! 20 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/pixelinvaders/neoLedLPD6803Spi/Readme.txt: -------------------------------------------------------------------------------- 1 | Teensy (and Arduino) Firmware for PixelInvaders Panels (Lpd6803 based) 2 | 3 | Tested on a Teensy 2.0 using Arduino v1.0.5 and Teensyduino v1.14 4 | 5 | This is the SPI Version of the firmware - you need to use the hardware SPI pins. 6 | However the SPI version is much faster than the software SPI (bit banging) firmware. 7 | 8 | This is the firmware you should use if you bought a PixelInvaders DIY Kit! 9 | 10 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/pixelinvaders/neoLedWS2801Spi/Readme.txt: -------------------------------------------------------------------------------- 1 | Teensy (and Arduino) Firmware for PixelInvaders Panels (ws2801 based) 2 | 3 | This is the SPI Version of the firmware - you need to use the hardware SPI pins. However the SPI version is much faster than the software SPI (bit banging) firmware. -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/rainbowduinoV2/3rdParty/MsTimer2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/rainbowduinoV2/3rdParty/MsTimer2.zip -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/rainbowduinoV2/3rdParty/wimleers-flexitimer2-v1.0-0-g4aab5a5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/rainbowduinoV2/3rdParty/wimleers-flexitimer2-v1.0-0-g4aab5a5.zip -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/rainbowduinoV2/Readme.txt: -------------------------------------------------------------------------------- 1 | Rainbowduino V2 Firmware 2 | ------------------------ 3 | 4 | Content: 5 | -3rdParty: 3rd party libraries the firmware needs, install them 6 | -arduinoFw: If you want to drive your rainbowduino with an Arduino, this is the firmware for it 7 | -teensyFw: If you want to drive your rainbowduino with an Teensy, this is the firmware for it 8 | -rainbowduinoFw: The firmware for the rainbowduino itself. Make sure you change the i2c address for each device 9 | 10 | --- 11 | 12 | needed libraries: 13 | -MsTimer2 (http://www.arduino.cc/playground/Main/MsTimer2) 14 | -FlexiTimer (http://github.com/wimleers/flexitimer2) 15 | 16 | libraries to patch: 17 | Wire: 18 | utility/twi.h: #define TWI_FREQ 400000L (was 100000L) 19 | #define TWI_BUFFER_LENGTH 98 (was 32) 20 | wire.h: #define BUFFER_LENGTH 98 (was 32) 21 | 22 | 23 | Hint: make sure you restart arduino after patching the files! 24 | 25 | 26 | --- 27 | 28 | Use the library: 29 | 30 | private Rainbowduino rainbowduino = null; 31 | private boolean ping; 32 | 33 | public YourClass() { 34 | rainbowduino = new Rainbowduino( papplet ); 35 | rainbowduino.initPort(); 36 | ping = rainbowduino.ping((byte)0); 37 | } 38 | 39 | public sendFrame(int i2cAddr) { 40 | rainbowduino.sendRgbFrame((byte)i2cAddr, THE_8x8_BUFFER, false); 41 | } -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/rainbowduinoV2/rainbowduinoFw/Rainbow_V2_71/data.c: -------------------------------------------------------------------------------- 1 | 2 | //initial image, mark top left pixel 3 | unsigned char buffer[2][96] = { 4 | { 5 | //green 6 | 66, 17, 18, 52, 51, 32, 2, 52, 7 | 51, 0, 0, 51, 64, 48, 3, 2, 8 | 80, 0, 0, 3, 101, 2, 32, 68, 9 | 96, 50, 35, 6, 67, 2, 32, 88, 10 | //red 11 | 102, 103, 100, 50, 85, 96, 5, 50, 12 | 69, 0, 0, 67, 48, 80, 6, 2, 13 | 48, 0, 0, 1, 34, 3, 32, 16, 14 | 16, 17, 17, 0, 0, 0, 0, 0, 15 | //blue 16 | 1, 18, 34, 34, 1, 16, 3, 34, 17 | 0, 0, 0, 50, 0, 16, 3, 3, 18 | 16, 0, 0, 5, 34, 3, 64, 88, 19 | 32, 52, 68, 11, 34, 3, 64, 124 20 | }, { 21 | //green 22 | 66, 17, 18, 52, 51, 32, 2, 52, 23 | 51, 0, 0, 51, 64, 48, 3, 2, 24 | 80, 0, 0, 3, 101, 2, 32, 68, 25 | 96, 50, 35, 6, 67, 2, 32, 88, 26 | //red 27 | 102, 103, 100, 50, 85, 96, 5, 50, 28 | 69, 0, 0, 67, 48, 80, 6, 2, 29 | 48, 0, 0, 1, 34, 3, 32, 16, 30 | 16, 17, 17, 0, 0, 0, 0, 0, 31 | //blue 32 | 1, 18, 34, 34, 1, 16, 3, 34, 33 | 0, 0, 0, 50, 0, 16, 3, 3, 34 | 16, 0, 0, 5, 34, 3, 64, 88, 35 | 32, 52, 68, 11, 34, 3, 64, 124 36 | }}; 37 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/rainbowduinoV3/Readme.txt: -------------------------------------------------------------------------------- 1 | Rainbowduino V3 Firmware 2 | ------------------------ 3 | 4 | Arduino firmware for a Rainbowduino V3 controller of the 5 | 'rainbowduino-v3-streaming-firmware' project hosted at: 6 | https://code.google.com/p/rainbowduino-v3-streaming-firmware/ 7 | 8 | Author: Markus Lang (m@rkus-lang.de) 9 | Blog: http://programmers-pain.de/ -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/stealthSpi/Readme.txt: -------------------------------------------------------------------------------- 1 | Element Labs Stealth LED panel 2 | 3 | About these panels: 4 | These were a commercial product developed for transparent video walls. 5 | 6 | The ATX Hackerspace (Austin TX) obtained a bunch of these panels from a member. Apparently the panels had been RMA'd to the company and were not 100% functional. After some hacking we were able to get a handful of the panels working again. 7 | 8 | There was no controller available for this particular panel, but a we were able to scope the output from a similar Element Labs product and figure out the proper data protocol for the panels. 9 | 10 | We've been able to drive the panels so far with a custom PIC board as well as Teensy and Maple Mini. 11 | 12 | More info here: 13 | http://www.xlvideo.tv/equipment/led/transparent-led/element-labs-stealth/ 14 | http://cled.barcousa.com/support/STEALTH/STEALTH_Users_Guide.pdf 15 | 16 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/stealthSpi/element_maple_gfx.pde: -------------------------------------------------------------------------------- 1 | // element labs stealth panel test (Teensy version) 2 | // 12-6-12, smn: created 3 | // 19-6-12, cmiller: updated to use GFX library 4 | 5 | #include 6 | 7 | #include "element_GFX.h" 8 | 9 | Element_GFX panel; 10 | 11 | uint32 theTextColor; 12 | 13 | void setup() 14 | { 15 | panel.constructor(); 16 | panel.setRotation(3); // options are 0, 1, 2, 3 17 | 18 | // pick a random color for text 19 | theTextColor = make_color(random(0,64), random(0,64), random(0,64)); 20 | 21 | } 22 | 23 | // set x cursor position which will decrement to scroll text 24 | int xcur = 0; 25 | 26 | // MAIN LOOP 27 | 28 | void loop() 29 | { 30 | // Text to display on panels 31 | char *str = " HELL0 world! "; 32 | 33 | // Set text size - size 1 is 6 or 7 pixels 34 | int txtsize = 2; 35 | 36 | int i, j; 37 | /* 38 | // draw pixels to fill screen with color. 39 | for (i = 0; i < panel.width(); i++) { 40 | for (j = 0; j < panel.height(); j++) 41 | panel.drawPixel(i, j, make_color(64, 0, 0)); 42 | } 43 | panel.sendFrame(); 44 | 45 | 46 | // draw characters one at a time 47 | for (int i = 0; i < strlen(str); i++){ 48 | panel.fillScreen(make_color(0, 0, 64)); 49 | panel.drawChar(0, 0, str[i], make_color(64, 0, 0), make_color(0, 0, 64), 1); 50 | panel.sendFrame(); 51 | delay(250); 52 | } 53 | 54 | // fill screen with color and send 55 | panel.fillScreen(make_color(0, 0, 64)); 56 | panel.sendFrame(); 57 | */ 58 | 59 | panel.setCursor(xcur,1); 60 | panel.setTextColor(theTextColor, make_color(0, 0, 0)); 61 | panel.setTextSize(txtsize); 62 | panel.setTextWrap(false); 63 | for (int i = 0; i < strlen(str); i++) 64 | { 65 | panel.write(str[i]); 66 | } 67 | panel.sendFrame(); 68 | xcur--; 69 | delay(10); 70 | 71 | if (xcur < -(txtsize*6)*(strlen(str)-1)) { 72 | xcur = 0; 73 | // pick a random color for text 74 | theTextColor = make_color(random(0,64), random(0,64), random(0,64)); 75 | 76 | } 77 | 78 | 79 | } 80 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/stealthSpi/stealthSpiMaple/element_GFX.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ELEMENT_GFX_H 3 | #define _ELEMENT_GFX_H 4 | 5 | #include "Adafruit_GFX.h" 6 | 7 | // Remember - Adding panels changes HEIGHT 8 | #define NUMPANELS (2) 9 | #define ELEMENT_H (16 * NUMPANELS) 10 | #define ELEMENT_W (16) 11 | #define ELEMENT_LEDS (ELEMENT_W * ELEMENT_H) 12 | #define ELEMENT_LATCH 27 13 | 14 | 15 | class Element_GFX : public Adafruit_GFX 16 | { 17 | public: 18 | void constructor(); 19 | 20 | virtual void drawPixel(int16 x, int16 y, uint32 color); 21 | virtual void drawPixelNum(int16 num, uint32 color); 22 | virtual void invertDisplay(boolean i); 23 | 24 | void sendFrame(); 25 | }; 26 | 27 | uint32 make_color(uint8 r, uint8 g, uint8 b); 28 | uint32 hsv_to_rgb(uint16 hue, uint8 sat, uint8 value); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/stealthSpi/stealthSpiTeensy/Readme.txt: -------------------------------------------------------------------------------- 1 | Element Labs Stealth LED panel 2 | 3 | About these panels: 4 | These were a commercial product developed for transparent video walls. 5 | 6 | The ATX Hackerspace (Austin TX) obtained a bunch of these panels from a member. Apparently the panels had been RMA'd to the company and were not 100% functional. After some hacking we were able to get a handful of the panels working again. 7 | 8 | There was no controller available for this particular panel, but a we were able to scope the output from a similar Element Labs product and figure out the proper data protocol for the panels. 9 | 10 | We've been able to drive the panels so far with a custom PIC board as well as Teensy and Maple Mini. 11 | 12 | More info here: 13 | http://www.xlvideo.tv/equipment/led/transparent-led/element-labs-stealth/ 14 | http://cled.barcousa.com/support/STEALTH/STEALTH_Users_Guide.pdf 15 | 16 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/stealthSpi/stealthSpiTeensy/element_GFX.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ELEMENT_GFX_H 3 | #define _ELEMENT_GFX_H 4 | 5 | #include "Adafruit_GFX.h" 6 | 7 | // Remember - Adding panels changes HEIGHT 8 | #define NUMPANELS (2) 9 | #define ELEMENT_H (16 * NUMPANELS) 10 | #define ELEMENT_W (16) 11 | #define ELEMENT_LEDS (ELEMENT_W * ELEMENT_H) 12 | #define ELEMENT_LATCH 24 13 | 14 | 15 | class Element_GFX : public Adafruit_GFX 16 | { 17 | public: 18 | void constructor(); 19 | 20 | void transfer(uint8_t data); 21 | 22 | virtual void drawPixel(int16_t x, int16_t y, uint32_t color); 23 | virtual void drawPixelNum(int16_t num, uint32_t color); 24 | virtual void invertDisplay(boolean i); 25 | 26 | void sendFrame(); 27 | }; 28 | 29 | uint32_t make_color(uint8_t r, uint8_t g, uint8_t b); 30 | uint32_t hsv_to_rgb(uint16_t hue, uint8_t sat, uint8_t value); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/tpm2serial/Readme.txt: -------------------------------------------------------------------------------- 1 | serialdebug: A processing sketch to test the firmware 2 | tpm2serial: Tested on a Teensy3 using fastspi_2 (https://code.google.com/p/fastspi/) library -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/tpm2serial/serialdebug/serialdebug.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Serial Duplex 3 | * by Tom Igoe. 4 | * 5 | * Sends a byte out the serial port when you type a key 6 | * listens for bytes received, and displays their value. 7 | * This is just a quick application for testing serial data 8 | * in both directions. 9 | */ 10 | 11 | 12 | import processing.serial.*; 13 | 14 | Serial serial; // The serial port 15 | int whichKey = -1; // Variable to hold keystoke values 16 | int inByte = -1; // Incoming serial data 17 | 18 | void setup() { 19 | size(400, 300); 20 | 21 | String portName = "COM5"; 22 | serial = new Serial(this, portName, 115200); 23 | 24 | frameRate(40); 25 | } 26 | 27 | int cnt =0; 28 | void draw() { 29 | println("send data"); 30 | int current=0; 31 | for (int i=0; i<2; i++) { 32 | serial.write(doProtocol(new int[170], current++, 4)); 33 | serial.write(doProtocol(new int[85], current++, 4)); 34 | } 35 | println(cnt+" done, "+frameRate); 36 | cnt++; 37 | 38 | while (serial.available() > 0) { 39 | println(serial.readString()); 40 | } 41 | } 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ArduinoFw/tpm2serial/serialdebug/tpm2.pde: -------------------------------------------------------------------------------- 1 | final byte START_BYTE = (byte) 0x9c; 2 | final byte DATA_FRAME = (byte) 0xDA; 3 | final byte BLOCK_END = (byte) 0x36; 4 | final int HEADER_SIZE = 7; 5 | 6 | /** 7 | * Create TPM2 Protocol 8 | * 9 | * @param frame 10 | * @return 11 | */ 12 | public byte[] doProtocol(int[] frame, int currentPacket, int totalPacket) { 13 | //3 colors per pixel 14 | int index = 0; 15 | int frameSize = frame.length*3; 16 | byte[] outputBuffer = new byte[frameSize + HEADER_SIZE]; 17 | 18 | //Start-Byte 19 | outputBuffer[index++] = START_BYTE; 20 | 21 | //Ident-Byte 22 | outputBuffer[index++] = DATA_FRAME; 23 | 24 | //Raw Data Size 25 | byte frameSizeByteHigh = (byte) (frameSize >> 8 & 0xff); 26 | byte frameSizeByteLow = (byte) (frameSize & 0xff); 27 | outputBuffer[index++] = frameSizeByteHigh; 28 | outputBuffer[index++] = frameSizeByteLow; 29 | 30 | outputBuffer[index++] = (byte)currentPacket; 31 | outputBuffer[index++] = (byte)totalPacket; 32 | 33 | //Raw Data 34 | for (int i = 0; i < frame.length; i++) { 35 | outputBuffer[index++] = (byte) ((frame[i] >> 16) & 255); 36 | outputBuffer[index++] = (byte) ((frame[i] >> 8) & 255); 37 | outputBuffer[index++] = (byte) (frame[i] & 255); 38 | } 39 | 40 | //Block-End-Byte 41 | outputBuffer[index] = BLOCK_END; 42 | 43 | return outputBuffer; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/ControlOSC/readme.txt: -------------------------------------------------------------------------------- 1 | Example to use with the Android App "Control" by Charlie Roberts. -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/AdapterApp/LastAction.pde: -------------------------------------------------------------------------------- 1 | class LastAction { 2 | private String lastAction; 3 | private long lastActionTs; 4 | 5 | public void updateLastAction(String s) { 6 | this.lastAction = s; 7 | lastActionTs=System.currentTimeMillis(); 8 | } 9 | 10 | String getLastAction() { 11 | return lastAction; 12 | } 13 | 14 | long getLastActionTs() { 15 | return System.currentTimeMillis()-lastActionTs; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendControllMessages/OscSenderRandom/OscSenderRandom.pde: -------------------------------------------------------------------------------- 1 | import oscP5.*; 2 | import netP5.*; 3 | 4 | OscP5 oscP5; 5 | NetAddress myRemoteLocation; 6 | 7 | //send OSC RANDOMIZE message to pixelcontroller 8 | 9 | void setup() { 10 | size(400, 400); 11 | frameRate(4); 12 | /* start oscP5, listening for incoming messages at port 12000 */ 13 | oscP5 = new OscP5(this,9999); 14 | 15 | //CHANGE to your ip 16 | // myRemoteLocation = new NetAddress("192.168.43.111", 9876); 17 | myRemoteLocation = new NetAddress("127.0.0.1", 9876); 18 | } 19 | 20 | int ii=0; 21 | void draw() { 22 | 23 | long now=System.currentTimeMillis(); 24 | for (int i=0; i<1; i++) { 25 | OscMessage myMessage = new OscMessage("/CURRENT_VISUAL"); 26 | myMessage.add(1); 27 | oscP5.send(myMessage, myRemoteLocation); 28 | 29 | myMessage = new OscMessage("/RANDOMIZE"); 30 | oscP5.send(myMessage, myRemoteLocation); 31 | println("."); 32 | } 33 | long needed = System.currentTimeMillis()-now; 34 | println("Sendtime: "+needed+"ms"); 35 | } 36 | 37 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendControllMessages/OscSenderSelectVisual/OscSenderSelectVisual.pde: -------------------------------------------------------------------------------- 1 | import oscP5.*; 2 | import netP5.*; 3 | 4 | OscP5 oscP5; 5 | NetAddress myRemoteLocation; 6 | 7 | void setup() { 8 | size(400, 400); 9 | frameRate(1); 10 | /* start oscP5, listening for incoming messages at port 12000 */ 11 | oscP5 = new OscP5(this, 12000); 12 | 13 | //CHANGE to your ip 14 | myRemoteLocation = new NetAddress("127.0.0.1", 9876); 15 | 16 | long now=System.currentTimeMillis(); 17 | 18 | oscP5.send("/CURRENT_VISUAL", new Object[] { 0 }, myRemoteLocation); 19 | oscP5.send("/CHANGE_GENERATOR_A", new Object[] { 3 }, myRemoteLocation); 20 | oscP5.send("/CHANGE_EFFECT_A", new Object[] { 0 }, myRemoteLocation); 21 | oscP5.send("/CHANGE_MIXER", new Object[] { 0 }, myRemoteLocation); 22 | oscP5.send("/IMAGE", new Object[] { "does-not-exist" }, myRemoteLocation); 23 | 24 | long needed = System.currentTimeMillis()-now; 25 | println("Sendtime: "+needed+"ms"); 26 | 27 | noLoop(); 28 | } 29 | 30 | int ii=0; 31 | void draw() { 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendControllMessages/PixelControllerRemote/PixelControllerRemote.pde: -------------------------------------------------------------------------------- 1 | import controlP5.*; 2 | import oscP5.*; 3 | import netP5.*; 4 | import java.util.Properties; 5 | 6 | ControlP5 cp5; 7 | OscP5 oscP5; 8 | NetAddress myRemoteLocation; 9 | boolean initDone = false; 10 | 11 | final int SENDING_PORT = 9876; 12 | 13 | Textlabel tget; 14 | 15 | void setup() { 16 | size(400, 400); 17 | frameRate(50); 18 | 19 | String targetip = getTargetIp(); 20 | 21 | /* start oscP5, listening for incoming messages at port 8000 */ 22 | oscP5 = new OscP5(this, 10000); 23 | myRemoteLocation = new NetAddress(targetip, SENDING_PORT); 24 | 25 | cp5 = new ControlP5(this); 26 | 27 | tget = new Textlabel(cp5, "PixelController REMOTE, target IP: <"+targetip+">",100,20,400,50); 28 | 29 | for (int i=0; i<8; i++) { 30 | cp5.addButton("Preset"+i) 31 | .setValue(0) 32 | .setPosition(100,50+i*25) 33 | .setSize(200,20) 34 | .setLabel("Preset "+(i+10)) 35 | .setId(10+i); 36 | 37 | } 38 | initDone = true; 39 | println("---"); 40 | } 41 | 42 | void draw() { 43 | background(0); 44 | tget.draw(this); 45 | } 46 | 47 | // function controlEvent will be invoked with every value change 48 | // in any registered controller 49 | public void controlEvent(ControlEvent theEvent) { 50 | if (!initDone) { 51 | return; 52 | } 53 | println("got a control event from controller with id "+theEvent.getId()); 54 | println(theEvent.getController().getName()); 55 | 56 | if (theEvent.getId()>0) { 57 | loadPreset(theEvent.getId()); 58 | println("preset "+theEvent.getId()); 59 | } 60 | } 61 | 62 | String getTargetIp() { 63 | try { 64 | Properties p = new Properties(); 65 | p.load(openStream("config.properties")); 66 | return p.getProperty("targetip","127.0.0.1"); 67 | } catch (IOException e) { 68 | return "FAILED TO LOAD FILE config.properties"; 69 | } 70 | } 71 | 72 | 73 | void loadPreset(int nr) { 74 | oscP5.send("/CHANGE_PRESENT", new Object[] { ""+nr }, myRemoteLocation); 75 | oscP5.send("/LOAD_PRESENT", new Object[] { }, myRemoteLocation); 76 | println("load "+nr); 77 | } 78 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendControllMessages/PixelControllerRemote/data/config.properties: -------------------------------------------------------------------------------- 1 | targetip=127.0.0.1 -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendImageData/PixlInvCamAndroid/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendImageData/PixlInvCamAndroid/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.android.AndroidMode 2 | mode=Android 3 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendImageData/colorAdjust/colorAdjust.pde: -------------------------------------------------------------------------------- 1 | //pimitive sketch to check color adjustment of different pixelinvaders panels 2 | 3 | //key 0 and 1 select the panel 4 | //keys rRgGbB increase/decrease the color value 5 | 6 | //start pixelcontroller 7 | //select visual 1 generator OSC GEN 1 8 | //select visual 2 generator OSC GEN 2 9 | //map visual 1 to output 1 10 | //map visual 2 to output 2 11 | 12 | int STEP = 15; 13 | 14 | int activePanel=0; 15 | int[] r,g,b; 16 | int[][] bfr = new int[2][4096]; 17 | 18 | void setup() 19 | { 20 | frameRate(25); 21 | //must be 64 x 64! 22 | size(64, 64); 23 | smooth(); 24 | noStroke(); 25 | 26 | r=new int[2]; 27 | g=new int[2]; 28 | b=new int[2]; 29 | r[0]=255; 30 | g[0]=255; 31 | b[0]=255; 32 | r[1]=255; 33 | g[1]=255; 34 | b[1]=255; 35 | } 36 | 37 | void draw() 38 | { 39 | background(0); 40 | sendOsc(); 41 | } 42 | 43 | void keyPressed() 44 | { 45 | println("."+key); 46 | if(key == '1') { 47 | activePanel=0; 48 | } 49 | if(key == '2') { 50 | activePanel=1; 51 | } 52 | 53 | if(key == 'r') { 54 | r[activePanel]-=STEP; 55 | if (r[activePanel]<0) r[activePanel]=0; 56 | } 57 | if(key == 'R') { 58 | r[activePanel]+=STEP; 59 | if (r[activePanel]>255) r[activePanel]=255; 60 | } 61 | if(key == 'g') { 62 | g[activePanel]-=STEP; 63 | if (g[activePanel]<0) g[activePanel]=0; 64 | } 65 | if(key == 'G') { 66 | g[activePanel]+=STEP; 67 | if (g[activePanel]>255) g[activePanel]=255; 68 | } 69 | if(key == 'b') { 70 | b[activePanel]-=STEP; 71 | if (b[activePanel]<0) b[activePanel]=0; 72 | } 73 | if(key == 'B') { 74 | b[activePanel]+=STEP; 75 | if (b[activePanel]>255) b[activePanel]=255; 76 | } 77 | 78 | String s1 = ""; 79 | String s2 = ""; 80 | if (activePanel==0) { 81 | s1 = " *"; 82 | } else { 83 | s2 = " *"; 84 | } 85 | println("panel: 0, R: "+r[0]+", G: "+g[0]+", B: "+b[0]+s1); 86 | println("panel: 1, R: "+r[1]+", G: "+g[1]+", B: "+b[1]+s2); 87 | } 88 | 89 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendImageData/colorAdjust/oscSend.pde: -------------------------------------------------------------------------------- 1 | import oscP5.*; 2 | import netP5.*; 3 | 4 | OscP5 oscP5 = new OscP5(this, 12000); 5 | NetAddress myRemoteLocation = new NetAddress("127.0.0.1", 9876); 6 | 7 | OscMessage myMessage1 = new OscMessage("OSC_GENERATOR1"); 8 | OscMessage myMessage2 = new OscMessage("OSC_GENERATOR2"); 9 | byte[] bfr1 = new byte[4096*3]; 10 | byte[] bfr2 = new byte[4096*3]; 11 | 12 | void sendOsc() { 13 | 14 | myMessage1.clearArguments(); 15 | myMessage2.clearArguments(); 16 | 17 | loadPixels(); 18 | 19 | int ofs1=0; 20 | int ofs2=0; 21 | for (int i=0; i<4096; i++) { 22 | bfr1[ofs1++] = (byte)(r[0]); 23 | bfr1[ofs1++] = (byte)(g[0]); 24 | bfr1[ofs1++] = (byte)(b[0]); 25 | bfr2[ofs2++] = (byte)(r[1]); 26 | bfr2[ofs2++] = (byte)(g[1]); 27 | bfr2[ofs2++] = (byte)(b[1]); 28 | } 29 | updatePixels(); 30 | 31 | //send the 24bit buffer to PixelController 32 | myMessage1.add(bfr1); // add an int array to the osc message 33 | myMessage2.add(bfr2); // add an int array to the osc message 34 | 35 | // send the message 36 | oscP5.send(myMessage1, myRemoteLocation); 37 | oscP5.send(myMessage2, myRemoteLocation); 38 | } 39 | 40 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendImageData/kinect_MSAFluidDemo/KinectFeedback.pde: -------------------------------------------------------------------------------- 1 | public interface KinectFeedback { 2 | void feedback(float x, float y, float speedx, float speedy); 3 | } 4 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendImageData/kinect_MSAFluidDemo/oscSend.pde: -------------------------------------------------------------------------------- 1 | import oscP5.*; 2 | import netP5.*; 3 | 4 | OscP5 oscP5; 5 | NetAddress myRemoteLocation = new NetAddress("127.0.0.1", 9876); 6 | 7 | OscMessage myMessage = new OscMessage("OSC_GENERATOR1"); 8 | byte[] bfr = new byte[4096]; 9 | 10 | boolean sendData = true; 11 | 12 | void initOsc() { 13 | oscP5 = new OscP5(this, 0); 14 | } 15 | 16 | void sendOsc() { 17 | 18 | if (!sendData) { 19 | return; 20 | } 21 | 22 | myMessage.clearArguments(); 23 | 24 | loadPixels(); 25 | 26 | //invalid buffer size, return 27 | if (pixels.length!=4096) { 28 | sendData = false; 29 | updatePixels(); 30 | return; 31 | } 32 | 33 | int ofs=0; 34 | for (int pxl: pixels) { 35 | bfr[ofs++] = (byte)(pxl & 0xff); 36 | } 37 | 38 | updatePixels(); 39 | 40 | //send the buffer to PixelController 41 | myMessage.add(bfr); // add an int array to the osc message 42 | 43 | // send the message 44 | oscP5.send(myMessage, myRemoteLocation); 45 | } 46 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendImageData/particleexample/oscSend.pde: -------------------------------------------------------------------------------- 1 | import oscP5.*; 2 | import netP5.*; 3 | 4 | OscP5 oscP5; 5 | NetAddress myRemoteLocation = new NetAddress("127.0.0.1", 9876); 6 | 7 | OscMessage myMessage = new OscMessage("OSC_GENERATOR1"); 8 | byte[] bfr = new byte[4096]; 9 | 10 | boolean sendData = true; 11 | 12 | void initOsc() { 13 | oscP5 = new OscP5(this, 0); 14 | } 15 | 16 | void sendOsc() { 17 | 18 | if (!sendData) { 19 | return; 20 | } 21 | 22 | myMessage.clearArguments(); 23 | 24 | loadPixels(); 25 | 26 | //invalid buffer size, return 27 | if (pixels.length!=4096) { 28 | sendData = false; 29 | updatePixels(); 30 | return; 31 | } 32 | 33 | int ofs=0; 34 | for (int pxl: pixels) { 35 | bfr[ofs++] = (byte)(pxl & 0xff); 36 | } 37 | 38 | updatePixels(); 39 | 40 | //send the buffer to PixelController 41 | myMessage.add(bfr); // add an int array to the osc message 42 | 43 | // send the message 44 | oscP5.send(myMessage, myRemoteLocation); 45 | } 46 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendImageData/sendImageKreise/oscSend.pde: -------------------------------------------------------------------------------- 1 | import oscP5.*; 2 | import netP5.*; 3 | 4 | //BW Colorspace 5 | int BPP = 1; 6 | 7 | OscP5 oscP5 = new OscP5(this, 12000); 8 | NetAddress myRemoteLocation = new NetAddress("127.0.0.1", 9876); 9 | 10 | OscMessage myMessage = new OscMessage("OSC_GENERATOR1"); 11 | byte[] bfr = new byte[DATA_SIZE*BPP]; 12 | 13 | void sendOsc() { 14 | 15 | myMessage.clearArguments(); 16 | 17 | loadPixels(); 18 | 19 | int ofs=0; 20 | for (int pxl: pixels) { 21 | bfr[ofs++] = (byte)(pxl & 0xff); 22 | } 23 | 24 | updatePixels(); 25 | 26 | //send the 8bit buffer to PixelController 27 | myMessage.add(bfr); // add an int array to the osc message 28 | 29 | // send the message 30 | oscP5.send(myMessage, myRemoteLocation); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendImageData/sendImageKreise/sendImageKreise.pde: -------------------------------------------------------------------------------- 1 | //source http://www.openprocessing.org/sketch/7475 2 | 3 | float i; 4 | 5 | //define the size of your matrix here. the maximal size is 16x16! 6 | int PIXELS_X = 64; 7 | int PIXELS_Y = 64; 8 | int DATA_SIZE = PIXELS_X * PIXELS_Y; 9 | 10 | //the maximal UDP packet size 11 | int MAXIMAL_UDP_PACKET_SIZE = 65507; 12 | 13 | int kreise = 23; 14 | 15 | float ersterdurchmesser = 300; 16 | float durchmesserdifferenz = 13; 17 | 18 | float xVersatz = 13; 19 | float yVersatz; 20 | 21 | float geschwindigkeit = 0.002; 22 | 23 | void setup() 24 | { 25 | frameRate(30); 26 | size(64, 64); 27 | println("\nOSC Packet size: "+DATA_SIZE*BPP); 28 | if (DATA_SIZE*BPP > MAXIMAL_UDP_PACKET_SIZE) { 29 | println("ERROR, you use OSC to send that much data (UDP Packet size limit is 64k). Lower your resolution."); 30 | System.exit(1); 31 | } 32 | smooth(); 33 | noStroke(); 34 | } 35 | 36 | void draw() 37 | { 38 | background(255); 39 | translate(width/2, height/2); 40 | pushMatrix(); 41 | rotate(i); 42 | for(int j = 0; j < kreise; j++) 43 | { 44 | // if(j % 2 == 0) fill(239, 239, 212); else fill(42, j * 185/kreise, 84); 45 | if(j % 2 == 0) fill(0); else fill(j * 185/kreise); 46 | rotate(i); 47 | ellipse(0, 0, ersterdurchmesser - j * durchmesserdifferenz, ersterdurchmesser - j * durchmesserdifferenz); 48 | translate(xVersatz, yVersatz); 49 | } 50 | popMatrix(); 51 | i += geschwindigkeit; 52 | translate(-width/2, -height/2); 53 | 54 | filter(GRAY); 55 | sendOsc(); 56 | } 57 | 58 | void keyPressed() 59 | { 60 | if(key == '1') 61 | { 62 | kreise = 23; 63 | durchmesserdifferenz = 13; 64 | xVersatz = 13; 65 | geschwindigkeit = 0.002; 66 | } 67 | if(key == '2') 68 | { 69 | kreise = 30; 70 | durchmesserdifferenz = 10; 71 | xVersatz = 90; 72 | geschwindigkeit = 0.002; 73 | } 74 | } 75 | 76 | 77 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendImageData/sendImageKreise24bpp/oscSend.pde: -------------------------------------------------------------------------------- 1 | import oscP5.*; 2 | import netP5.*; 3 | 4 | //RGB Colorspace 5 | int BPP = 3; 6 | 7 | OscP5 oscP5 = new OscP5(this, 12000); 8 | NetAddress myRemoteLocation = new NetAddress("127.0.0.1", 9876); 9 | 10 | OscMessage myMessage = new OscMessage("OSC_GENERATOR1"); 11 | byte[] bfr = new byte[DATA_SIZE*BPP]; 12 | 13 | void sendOsc() { 14 | 15 | myMessage.clearArguments(); 16 | 17 | int ofs=0; 18 | loadPixels(); 19 | for (int pxl: pixels) { 20 | bfr[ofs++] = (byte)((pxl>>16) & 0xff); 21 | bfr[ofs++] = (byte)((pxl>>8) & 0xff); 22 | bfr[ofs++] = (byte)(pxl & 0xff); 23 | } 24 | updatePixels(); 25 | 26 | //send the 24bit buffer to PixelController 27 | myMessage.add(bfr); // add an int array to the osc message 28 | 29 | // send the message 30 | oscP5.send(myMessage, myRemoteLocation); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendImageData/sendImageKreise24bpp/sendImageKreise24bpp.pde: -------------------------------------------------------------------------------- 1 | //source http://www.openprocessing.org/sketch/7475 2 | 3 | float i; 4 | 5 | //define the size of your matrix here. the maximal size is 16x16! 6 | int PIXELS_X = 64; 7 | int PIXELS_Y = 64; 8 | int DATA_SIZE = PIXELS_X*PIXELS_Y; 9 | 10 | //the maximal UDP packet size 11 | int MAXIMAL_UDP_PACKET_SIZE = 65507; 12 | 13 | int kreise = 23; 14 | 15 | float ersterdurchmesser = 300; 16 | float durchmesserdifferenz = 13; 17 | 18 | float xVersatz = 13; 19 | float yVersatz; 20 | 21 | float geschwindigkeit = 0.002; 22 | 23 | void setup() 24 | { 25 | frameRate(3); 26 | //use pixel ammount of your panel *8 27 | size(PIXELS_X, PIXELS_Y); 28 | println("\nOSC Packet size: "+DATA_SIZE*BPP); 29 | if (DATA_SIZE*BPP > MAXIMAL_UDP_PACKET_SIZE) { 30 | println("ERROR, you use OSC to send that much data (UDP Packet size limit is 64k). Lower your resolution."); 31 | System.exit(1); 32 | } 33 | smooth(); 34 | noStroke(); 35 | } 36 | 37 | void draw() 38 | { 39 | background(255); 40 | translate(width/2, height/2); 41 | pushMatrix(); 42 | rotate(i); 43 | for(int j = 0; j < kreise; j++) { 44 | if(j % 2 == 0) fill(239, 239, 212); else fill(42, j * 185/kreise, 84); 45 | rotate(i); 46 | ellipse(0, 0, ersterdurchmesser - j * durchmesserdifferenz, ersterdurchmesser - j * durchmesserdifferenz); 47 | translate(xVersatz, yVersatz); 48 | } 49 | popMatrix(); 50 | i += geschwindigkeit; 51 | translate(-width/2, -height/2); 52 | 53 | sendOsc(); 54 | } 55 | 56 | void keyPressed() 57 | { 58 | if(key == '1') 59 | { 60 | kreise = 23; 61 | durchmesserdifferenz = 13; 62 | xVersatz = 13; 63 | geschwindigkeit = 0.002; 64 | } 65 | if(key == '2') 66 | { 67 | kreise = 30; 68 | durchmesserdifferenz = 10; 69 | xVersatz = 90; 70 | geschwindigkeit = 0.002; 71 | } 72 | } 73 | 74 | 75 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/OscSendImageData/sendImageSecretLifeOfTuring/oscSend.pde: -------------------------------------------------------------------------------- 1 | import oscP5.*; 2 | import netP5.*; 3 | 4 | OscP5 oscP5 = new OscP5(this, 12000); 5 | NetAddress myRemoteLocation = new NetAddress("127.0.0.1", 9876); 6 | 7 | OscMessage myMessage = new OscMessage("OSC_GENERATOR2"); 8 | byte[] bfr = new byte[4096]; 9 | 10 | void sendOsc() { 11 | 12 | myMessage.clearArguments(); 13 | 14 | loadPixels(); 15 | 16 | int ofs=0; 17 | for (int pxl: pixels) { 18 | bfr[ofs++] = (byte)(pxl & 0xff); 19 | } 20 | 21 | updatePixels(); 22 | 23 | //send the 8bit buffer to PixelController 24 | myMessage.add(bfr); // add an int array to the osc message 25 | 26 | // send the message 27 | oscP5.send(myMessage, myRemoteLocation); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Processing/README.md: -------------------------------------------------------------------------------- 1 | #Processing Examples 2 | 3 | Processing (http://processing.org) examples, shows how to integrate your projects with PixelController: 4 | 5 | * OscSendControllMessages: Example how to send OSC messages to *control* PixelController with Processing. 6 | * OscSendImageData: Example how to send *image data* as OSC messages to PixelController with Processing. 7 | * AdapterApp: Processing application that work as bridge between Kinectic Space (http://www.colorfulbit.com/) and PixelController. I used this application for my installation at Soon Switzerland. 8 | 9 | Hint: see ValidCommands.java for all OSC commands -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/PureData/readme.txt: -------------------------------------------------------------------------------- 1 | Examples for PureData. Use with PureData Extended. -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/integration/Readme.txt: -------------------------------------------------------------------------------- 1 | PixelController integration files 2 | --------------------------------- 3 | 4 | PixelController can be integrated in various other Systems: 5 | ArduinoFw: Arduino firmware files, needed if you use an Arduino based DIY LED controller. 6 | ControlOSC: Control is a mobile application, used to send you OSC data. You can control 7 | PixelController from your tablet. 8 | Processing: Processing is an OpenSource programing IDE, used by artists or alot of other 9 | individuals. This directory contain code examples to control PixelController by 10 | sending out OSC data, for exmple: use Generator "Fire" and effect "Invert". 11 | It also contains code examples to create a Generator and send the image data 12 | to PixelController. 13 | PureData: PureData is a visual programming language. It can be used to map a MIDI device 14 | to control PixelController. -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/lib/RPi/Readme.txt: -------------------------------------------------------------------------------- 1 | rxtx library for raspberry pi. 2 | 3 | compiled for armv6l-unknown-linux-gnu (3.6.11+ #362 PREEMPT Tue Jan 22 14:52:21 GMT 2013 armv6l GNU/Linux) -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/lib/RPi/librxtxSerial.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/lib/RPi/librxtxSerial.so -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/lib/librxtxSerial.jnilib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/lib/librxtxSerial.jnilib -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/lib/librxtxSerial.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/lib/librxtxSerial.so -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/lib/rxtxSerial.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/lib/rxtxSerial.dll -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/lib/rxtxSerial64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/lib/rxtxSerial64.dll -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/startscript/PixelController.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-distribution/src/main/resources/startscript/PixelController.jar -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/startscript/PixelController.properties: -------------------------------------------------------------------------------- 1 | 2 | 3 | # This file configure the PixelController launcher, not PixelController itself 4 | # If you want to configure PixelController, edit the file data/config.properties! 5 | 6 | 7 | # specify JVM options here. Default: none 8 | app.vm.options=-Xmx512m -Djava.util.logging.config.file=./data/logging.properties -Djava.library.path=./lib -Dcom.sun.management.jmxremote.port=1337 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote -Djava.security.policy=./data/client.policy -XX:ErrorFile=./data/hs_err_pid%p.log -splash:./data/setup/splash.jpg 9 | # specify a dir where dependent jar files are found. Default: lib 10 | #app.libs.dir=libs 11 | # specify additional class path resources. Default: none 12 | #app.class.path= 13 | # specify the main class of the application to run. Required 14 | app.main.class=com.neophob.PixelController 15 | # true if you want to follow the output of the child process. Default: false 16 | #app.follow=true 17 | 18 | # specify here your additional system properties. They will be added 19 | # to the command line as -Dproperty=value 20 | #log4j.configuration=file:log4j.properties 21 | #http.proxyHost=127.0.0.1 22 | #http.proxyPort=3128 23 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/startscript/console/PixConCli.cmd: -------------------------------------------------------------------------------- 1 | @REM 2 | @REM Copyright (C) 2011 Michael Vogt 3 | @REM 4 | @REM This file is part of PixelController. 5 | @REM 6 | @REM PixelController is free software: you can redistribute it and/or modify 7 | @REM it under the terms of the GNU General Public License as published by 8 | @REM the Free Software Foundation, either version 3 of the License, or 9 | @REM (at your option) any later version. 10 | @REM 11 | @REM PixelController is distributed in the hope that it will be useful, 12 | @REM but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | @REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | @REM GNU General Public License for more details. 15 | @REM 16 | @REM You should have received a copy of the GNU General Public License 17 | @REM along with PixelController. If not, see . 18 | @REM 19 | 20 | @echo off 21 | setlocal 22 | 23 | set BINDIR=%~dp0 24 | cd /D "%BINDIR%"\..\ 25 | 26 | java -Djava.security.policy=./data/client.policy -classpath ".;./lib/*" com.neophob.sematrix.cli.PixConClient %* 27 | 28 | IF "%1"=="" GOTO SHOWHINT 29 | 30 | endlocal 31 | goto:eof 32 | 33 | 34 | :SHOWHINT 35 | echo -------------------------------------------------------------------------- 36 | echo Hint: This batch file can be used to control PixelController 37 | echo If you want to run PixelController, just doubleclick PixelController.jar! 38 | echo -------------------------------------------------------------------------- 39 | pause 40 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/startscript/console/PixConCli.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2011 Michael Vogt 3 | # 4 | # This file is part of PixelController. 5 | # 6 | # PixelController is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # PixelController is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with PixelController. If not, see . 18 | # 19 | 20 | #!/bin/bash 21 | 22 | CURRENT=$(dirname "$0") 23 | cd "$CURRENT"/../ 24 | 25 | java -Djava.security.policy=./data/client.policy -classpath .:./lib/* com.neophob.sematrix.cli.PixConClient $@ 26 | 27 | if [ $# -eq 0 ] 28 | then 29 | echo -------------------------------------------------------------------------- 30 | echo Hint: This batch file can be used to control PixelController 31 | echo If you want to run PixelController, just doubleclick PixelController.jar! 32 | echo -------------------------------------------------------------------------- 33 | fi 34 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/startscript/console/PixelController.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | @REM 3 | @REM Copyright (C) 2011 Michael Vogt 4 | @REM 5 | @REM This file is part of PixelController. 6 | @REM 7 | @REM PixelController is free software: you can redistribute it and/or modify 8 | @REM it under the terms of the GNU General Public License as published by 9 | @REM the Free Software Foundation, either version 3 of the License, or 10 | @REM (at your option) any later version. 11 | @REM 12 | @REM PixelController is distributed in the hope that it will be useful, 13 | @REM but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | @REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | @REM GNU General Public License for more details. 16 | @REM 17 | @REM You should have received a copy of the GNU General Public License 18 | @REM along with PixelController. If not, see . 19 | @REM 20 | 21 | setlocal 22 | 23 | set BINDIR=%~dp0 24 | cd /D "%BINDIR%"\..\ 25 | 26 | set JAVA_OPT=-Djava.awt.headless=true -Djava.util.logging.config.file=data\logging.properties -Djava.library.path=lib -Dcom.sun.management.jmxremote.port=1337 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote -Djava.security.policy=data\client.policy 27 | 28 | java %JAVA_OPT% -classpath .;./lib/* -XX:ErrorFile=./log/hs_err_pid%p.log com.neophob.sematrix.cli.PixelControllerCli 29 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/startscript/console/PixelController.command: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2011 Michael Vogt 3 | # 4 | # This file is part of PixelController. 5 | # 6 | # PixelController is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # PixelController is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with PixelController. If not, see . 18 | # 19 | 20 | #!/bin/bash 21 | 22 | CURRENT=$(dirname "$0")/../ 23 | cd "$CURRENT" 24 | 25 | export JAVA_OPT="-Djava.awt.headless=true -Djava.util.logging.config.file=./data/logging.properties -Djava.library.path=./lib -Dcom.sun.management.jmxremote.port=1337 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote -Djava.security.policy=./data/client.policy" 26 | java $JAVA_OPT -classpath .:./lib/* -XX:ErrorFile=./log/hs_err_pid%p.log com.neophob.sematrix.cli.PixelControllerCli 27 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/startscript/console/PixelController.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2011 Michael Vogt 3 | # 4 | # This file is part of PixelController. 5 | # 6 | # PixelController is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # PixelController is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with PixelController. If not, see . 18 | # 19 | 20 | #!/bin/bash 21 | 22 | CURRENT=$(dirname "$0")/../ 23 | cd "$CURRENT" 24 | 25 | export JAVA_OPT="-Djava.awt.headless=true -Djava.util.logging.config.file=./data/logging.properties -Djava.library.path=./lib -Dcom.sun.management.jmxremote.port=1337 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote -Djava.security.policy=./data/client.policy" 26 | java $JAVA_OPT -classpath .:./lib/* -XX:ErrorFile=./log/hs_err_pid%p.log com.neophob.sematrix.cli.PixelControllerCli 27 | 28 | -------------------------------------------------------------------------------- /pixelcontroller-distribution/src/main/resources/startscript/console/PixelControllerRPi.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2011 Michael Vogt 3 | # 4 | # This file is part of PixelController. 5 | # 6 | # PixelController is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # PixelController is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with PixelController. If not, see . 18 | # 19 | 20 | #!/bin/bash 21 | 22 | CURRENT=$(dirname "$0")/../ 23 | cd "$CURRENT" 24 | 25 | export JAVA_OPT="-Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0 -Xmx128m -Djava.awt.headless=true -Djava.util.logging.config.file=./data/logging.properties -Djava.library.path=./lib/RPi/ -Dcom.sun.management.jmxremote.port=1337 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote -Djava.security.policy=./data/client.policy" 26 | java $JAVA_OPT -classpath .:./lib/* -XX:ErrorFile=./log/hs_err_pid%p.log com.neophob.sematrix.cli.PixelControllerCli 27 | 28 | -------------------------------------------------------------------------------- /pixelcontroller-gui/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | -------------------------------------------------------------------------------- /pixelcontroller-gui/lib/controlP5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-gui/lib/controlP5.jar -------------------------------------------------------------------------------- /pixelcontroller-gui/lib/core.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophob/PixelController/94b02e5597e761dd8b22a5f8e2468408c2674f7e/pixelcontroller-gui/lib/core.jar -------------------------------------------------------------------------------- /pixelcontroller-gui/src/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /pixelcontroller-gui/src/main/java/com/neophob/sematrix/gui/GuiCallbackAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.gui; 20 | 21 | import java.util.Map; 22 | 23 | /** 24 | * this interface is used to define gui actions are needed because of 25 | * keyboard input device 26 | * 27 | * @author mvogt 28 | * 29 | */ 30 | public interface GuiCallbackAction { 31 | 32 | /** 33 | * select a visual 34 | * 35 | * @param n 36 | */ 37 | void activeVisual(int n); 38 | 39 | /** 40 | * 41 | * 42 | * @return 43 | */ 44 | boolean isTextfieldInEditMode(); 45 | 46 | /** 47 | * activate next tab 48 | */ 49 | void selectNextTab(); 50 | void selectPreviousTab(); 51 | 52 | void updateGuiElements(Map map); 53 | } 54 | -------------------------------------------------------------------------------- /pixelcontroller-gui/src/main/java/com/neophob/sematrix/gui/Messages.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.gui; 20 | 21 | import java.util.MissingResourceException; 22 | import java.util.ResourceBundle; 23 | import java.util.logging.Level; 24 | import java.util.logging.Logger; 25 | 26 | /** 27 | * load gui text files from properties file 28 | * @author mvogt 29 | * 30 | */ 31 | public class Messages { 32 | 33 | private static final Logger LOG = Logger.getLogger(Messages.class.getName()); 34 | 35 | private static final String BUNDLE_NAME = "messages"; //$NON-NLS-1$ 36 | //private static final String BUNDLE_NAME = "com.neophob.sematrix.core.gui.messages"; //$NON-NLS-1$ 37 | 38 | private ResourceBundle bundle; 39 | 40 | public Messages() { 41 | try { 42 | bundle = ResourceBundle.getBundle(BUNDLE_NAME); 43 | } catch (MissingResourceException e) { 44 | LOG.log(Level.SEVERE, "Failed to load resource bundle!", e); 45 | } 46 | 47 | } 48 | 49 | public String getString(String key) { 50 | if (key==null) { 51 | return ""; 52 | } 53 | 54 | if (bundle==null) { 55 | return key; 56 | } 57 | 58 | try { 59 | return bundle.getString(key); 60 | } catch (MissingResourceException e) { 61 | return '!' + key + '!'; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /pixelcontroller-gui/src/main/java/com/neophob/sematrix/gui/Theme.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.gui; 20 | 21 | import controlP5.DropdownList; 22 | 23 | /** 24 | * @author mvogt 25 | * 26 | */ 27 | public final class Theme { 28 | 29 | public static final int DROPBOXLIST_LENGTH = 110; 30 | public static final int DROPBOX_XOFS = DROPBOXLIST_LENGTH + 23; 31 | 32 | public static final int DROPBOXLIST_HEIGHT = 190; 33 | 34 | public static final int DROPBOXLIST_LARGE_HEIGHT = 280; 35 | 36 | /** 37 | * 38 | */ 39 | private Theme() { 40 | //Util Class, no instance allowed 41 | } 42 | 43 | 44 | @SuppressWarnings("deprecation") 45 | public static void themeDropdownList(DropdownList ddl) { 46 | // a convenience function to customize a DropdownList 47 | ddl.setItemHeight(12); //height of a element in the dropdown list 48 | ddl.setBarHeight(15); //size of the list 49 | ddl.actAsPulldownMenu(true); //close menu after a selection was done 50 | ddl.setBackgroundColor(0); 51 | 52 | ddl.captionLabel().style().marginTop = 3; 53 | ddl.captionLabel().style().marginLeft = 3; 54 | ddl.valueLabel().style().marginTop = 3; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /pixelcontroller-gui/src/main/java/com/neophob/sematrix/gui/model/Point.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.gui.model; 20 | 21 | /** 22 | * 23 | * @author michu 24 | * 25 | */ 26 | public class Point { 27 | 28 | private int x; 29 | private int y; 30 | 31 | public Point(int x, int y) { 32 | this.x = x; 33 | this.y = y; 34 | } 35 | 36 | public int getX() { 37 | return x; 38 | } 39 | 40 | public int getY() { 41 | return y; 42 | } 43 | 44 | /* (non-Javadoc) 45 | * @see java.lang.Object#toString() 46 | */ 47 | @Override 48 | public String toString() { 49 | return String.format("Point [x=%s, y=%s]", x, y); 50 | } 51 | 52 | 53 | } 54 | -------------------------------------------------------------------------------- /pixelcontroller-gui/src/test/java/com/neophob/PixelControllerTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob; 20 | 21 | import java.util.logging.Level; 22 | import java.util.logging.Logger; 23 | 24 | import org.junit.Test; 25 | 26 | import processing.core.PApplet; 27 | 28 | /** 29 | * test start 30 | * @author michu 31 | * 32 | */ 33 | public class PixelControllerTest { 34 | 35 | /*class TestProcessingclass extends PApplet { 36 | public void setup() { 37 | Properties config = new Properties(); 38 | config.put(ConfigConstant.NULLOUTPUT_ROW1, "1"); 39 | config.put(ConfigConstant.NULLOUTPUT_ROW2, "0"); 40 | ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config); 41 | Collector.getInstance().init(this, ph); 42 | LOG.log(Level.INFO, "TestProcessingclass initialized"); 43 | } 44 | }*/ 45 | 46 | private static final Logger LOG = Logger.getLogger(PixelControllerTest.class.getName()); 47 | 48 | @Test 49 | public void testMain() { 50 | //Jenkins is headless, so this test would not work 51 | if (!java.awt.GraphicsEnvironment.isHeadless()) { 52 | LOG.log(Level.INFO,"public void setup"); 53 | PApplet.main(new String[] { "com.neophob.PixelController" }); 54 | } 55 | } 56 | 57 | 58 | /* @Test 59 | public void testCollector() { 60 | assertTrue(Collector.getInstance().getPresets().size() > 0); 61 | } 62 | */ 63 | 64 | } 65 | -------------------------------------------------------------------------------- /pixelcontroller-gui/src/test/java/com/neophob/sematrix/gui/MessagesTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.gui; 20 | 21 | 22 | import static org.junit.Assert.*; 23 | 24 | import org.junit.Test; 25 | 26 | 27 | public class MessagesTest { 28 | 29 | @Test 30 | public void messageTest() { 31 | Messages m = new Messages(); 32 | assertEquals("", m.getString(null)); 33 | assertEquals("!not-exist!", m.getString("not-exist")); 34 | assertEquals("Freeze Update", m.getString("GeneratorGui.GUI_TOGGLE_FREEZE")); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /pixelcontroller-gui/src/test/java/com/neophob/sematrix/gui/callback/GuiStateTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.gui.callback; 20 | 21 | import static org.junit.Assert.*; 22 | 23 | import java.util.LinkedList; 24 | import java.util.List; 25 | import java.util.Map; 26 | 27 | import org.junit.Test; 28 | 29 | public class GuiStateTest { 30 | 31 | @Test 32 | public void testGuiState() { 33 | GuiState gs = new GuiState(); 34 | 35 | List o = new LinkedList(); 36 | o.add("CHANGE_GENERATOR_A 1"); 37 | o.add("CHANGE_GENERATOR_B 0"); 38 | o.add("BLINKEN bnf_auge.bml"); 39 | gs.updateState(o); 40 | Map result = gs.getState(); 41 | assertEquals(3, result.size()); 42 | assertEquals("1", result.get("CHANGE_GENERATOR_A")); 43 | assertEquals("0", result.get("CHANGE_GENERATOR_B")); 44 | assertEquals("bnf_auge.bml", result.get("BLINKEN")); 45 | 46 | o.clear(); 47 | o.add("CHANGE_GENERATOR_B 3"); 48 | o.add("CHANGE_EFFECT_B 1"); 49 | gs.updateState(o); 50 | result = gs.getState(); 51 | assertEquals(4, result.size()); 52 | assertEquals("1", result.get("CHANGE_GENERATOR_A")); 53 | assertEquals("3", result.get("CHANGE_GENERATOR_B")); 54 | assertEquals("1", result.get("CHANGE_EFFECT_B")); 55 | assertEquals("bnf_auge.bml", result.get("BLINKEN")); 56 | 57 | Map diff = gs.getDiff(); 58 | assertEquals(2, diff.size()); 59 | assertEquals("3", result.get("CHANGE_GENERATOR_B")); 60 | assertEquals("1", result.get("CHANGE_EFFECT_B")); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /pixelcontroller-gui/src/test/resources/logging.properties: -------------------------------------------------------------------------------- 1 | # Properties file which configures the operation of the JDK 2 | # logging facility. 3 | 4 | # The system will look for this config file, first using 5 | # a System property specified at startup: 6 | # 7 | # >java -Djava.util.logging.config.file=myLoggingConfigFilePath 8 | # 9 | # If this property is not specified, then the config file is 10 | # retrieved from its default location at: 11 | # 12 | # JDK_HOME/jre/lib/logging.properties 13 | 14 | # Global logging properties. 15 | # ------------------------------------------ 16 | # The set of handlers to be loaded upon startup. 17 | # Comma-separated list of class names. 18 | # (? LogManager docs say no comma here, but JDK example has comma.) 19 | handlers=java.util.logging.ConsoleHandler 20 | 21 | # Default global logging level. 22 | # Loggers and Handlers may override this level 23 | .level=WARNING 24 | 25 | # Handlers 26 | # ----------------------------------------- 27 | 28 | # --- ConsoleHandler --- 29 | # Override of global logging level 30 | # Use serve level only for console handler 31 | java.util.logging.ConsoleHandler.level=WARNING 32 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter 33 | 34 | 35 | #EOF 36 | -------------------------------------------------------------------------------- /pixelcontroller-osc/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /bin 3 | -------------------------------------------------------------------------------- /pixelcontroller-osc/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.neophob.pixelcontroller 7 | pixelcontroller 8 | ../pom.xml 9 | 2.0.0 10 | 11 | 12 | pixelcontroller-osc 13 | PixelController OSC Interface 14 | 15 | jar 16 | 17 | Provide OSC Server and callback functions 18 | 19 | 20 | 21 | de.sciss 22 | netutil 23 | 1.0.0 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /pixelcontroller-osc/src/main/java/com/neophob/sematrix/osc/client/IClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.osc.client; 20 | 21 | import com.neophob.sematrix.osc.model.OscMessage; 22 | 23 | public interface IClient { 24 | 25 | void sendMessage(String targetIp, int targetPort, OscMessage msg) throws OscClientException; 26 | 27 | void disconnect() throws OscClientException; 28 | 29 | boolean isConnected(); 30 | } 31 | -------------------------------------------------------------------------------- /pixelcontroller-osc/src/main/java/com/neophob/sematrix/osc/client/OscClientException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.osc.client; 20 | 21 | /** 22 | * Used if the OSC client cannot send a message 23 | * 24 | * @author michu 25 | * 26 | */ 27 | public class OscClientException extends Exception { 28 | 29 | /** 30 | * 31 | */ 32 | private static final long serialVersionUID = -3310423091524466829L; 33 | 34 | public OscClientException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | public OscClientException(String message) { 39 | super(message); 40 | } 41 | 42 | public OscClientException(Throwable cause) { 43 | super(cause); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /pixelcontroller-osc/src/main/java/com/neophob/sematrix/osc/client/impl/OscClientFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.osc.client.impl; 20 | 21 | import java.util.logging.Level; 22 | import java.util.logging.Logger; 23 | 24 | import com.neophob.sematrix.osc.client.OscClientException; 25 | import com.neophob.sematrix.osc.model.OscMessage; 26 | 27 | /** 28 | * OSC Client Factory, send OSC Message 29 | * 30 | * @author michu 31 | * 32 | */ 33 | public abstract class OscClientFactory { 34 | 35 | private static final Logger LOG = Logger.getLogger(OscClientFactory.class.getName()); 36 | 37 | private static final boolean USE_TCP = false; 38 | 39 | private static OscClientImpl client = null; 40 | 41 | /** 42 | * 43 | * @param targetIp 44 | * @param targetPort 45 | * @param msg 46 | * @throws OscClientException 47 | */ 48 | public static void sendOscMessage(String targetIp, int targetPort, OscMessage msg) throws OscClientException { 49 | if (client == null) { 50 | client = new OscClientImpl(USE_TCP); 51 | } 52 | 53 | client.sendMessage(targetIp, targetPort, msg); 54 | } 55 | 56 | public static void disconnectOscClient() { 57 | if (client !=null && client.isConnected()) { 58 | try { 59 | client.disconnect(); 60 | } catch (OscClientException e) { 61 | LOG.log(Level.WARNING, "Failed to disconnect OSC Client", e); 62 | } 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /pixelcontroller-osc/src/main/java/com/neophob/sematrix/osc/server/IServer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.osc.server; 20 | 21 | 22 | /** 23 | * OSC Server interface exposed to PixelController Core 24 | * 25 | * @author michu 26 | * 27 | */ 28 | public interface IServer { 29 | 30 | /** 31 | * start the OSC server 32 | */ 33 | void startServer(); 34 | 35 | /** 36 | * start the OSC server 37 | */ 38 | void stopServer(); 39 | 40 | /** 41 | * @return listening port of the osc server 42 | */ 43 | int getListeningPort(); 44 | 45 | /** 46 | * @return listening host(ip or hostname) of the osc server 47 | */ 48 | String getListeningHost(); 49 | 50 | /** 51 | * 52 | * @return buffersize of the osc server, aka maximal packet size 53 | */ 54 | int getBufferSize(); 55 | 56 | /** 57 | * 58 | * @return how many OSC packets the server recieved 59 | */ 60 | int getPacketCounter(); 61 | 62 | /** 63 | * 64 | * @return how many bytes the server recieved 65 | */ 66 | long getBytesRecieved(); 67 | } 68 | -------------------------------------------------------------------------------- /pixelcontroller-osc/src/main/java/com/neophob/sematrix/osc/server/OscMessageHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.osc.server; 20 | 21 | import java.util.Observable; 22 | import java.util.Observer; 23 | import java.util.logging.Level; 24 | import java.util.logging.Logger; 25 | 26 | import com.neophob.sematrix.osc.model.OscMessage; 27 | 28 | /** 29 | * observer pattern implementation for client callback 30 | * 31 | * 32 | * @author michu 33 | * 34 | */ 35 | public abstract class OscMessageHandler implements Observer { 36 | 37 | private static final Logger LOG = Logger.getLogger(OscMessageHandler.class.getName()); 38 | 39 | public abstract void handleOscMessage(OscMessage msg); 40 | 41 | @Override 42 | public void update(Observable o, Object arg) { 43 | if (arg instanceof OscMessage) { 44 | OscMessage msg = (OscMessage) arg; 45 | handleOscMessage(msg); 46 | } else { 47 | LOG.log(Level.WARNING, "Ignored notification of unknown type: "+arg); 48 | } 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /pixelcontroller-osc/src/main/java/com/neophob/sematrix/osc/server/OscServerException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.osc.server; 20 | 21 | /** 22 | * Used if the OSC server cannot start or fail during operation 23 | * 24 | * @author michu 25 | * 26 | */ 27 | public class OscServerException extends Exception { 28 | 29 | /** 30 | * 31 | */ 32 | private static final long serialVersionUID = -1536439654275608922L; 33 | 34 | public OscServerException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | public OscServerException(String message) { 39 | super(message); 40 | } 41 | 42 | public OscServerException(Throwable cause) { 43 | super(cause); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /pixelcontroller-osc/src/main/java/com/neophob/sematrix/osc/server/impl/OscServerFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.osc.server.impl; 20 | 21 | import com.neophob.sematrix.osc.server.OscMessageHandler; 22 | import com.neophob.sematrix.osc.server.OscServerException; 23 | 24 | /** 25 | * OSC Server Factory class 26 | * 27 | * @author michu 28 | * 29 | */ 30 | public abstract class OscServerFactory { 31 | 32 | private static final boolean USE_TCP = false; 33 | 34 | public static OscServer createServer(OscMessageHandler handler, int port, int bufferSize) throws OscServerException { 35 | return new OscServerImpl(USE_TCP, handler, "", port, bufferSize); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /pixelcontroller-osc/src/test/java/com/neophob/sematrix/osc/IntegrationTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.osc; 20 | 21 | import com.neophob.sematrix.osc.model.OscMessage; 22 | import com.neophob.sematrix.osc.server.OscMessageHandler; 23 | import com.neophob.sematrix.osc.server.OscServerException; 24 | import com.neophob.sematrix.osc.server.impl.OscServer; 25 | import com.neophob.sematrix.osc.server.impl.OscServerFactory; 26 | 27 | 28 | public class IntegrationTest extends OscMessageHandler { 29 | 30 | OscServer srv; 31 | 32 | public IntegrationTest() throws OscServerException { 33 | System.out.println("create server"); 34 | srv = OscServerFactory.createServer(this, 9876, 1500); 35 | srv.startServer(); 36 | System.out.println("done"); 37 | } 38 | 39 | public void mainLoop() throws Exception { 40 | System.out.println("enter mainloop"); 41 | while (true) { 42 | // System.out.println("packets: "+srv.getPacketCounter()); 43 | // Thread.sleep(444); 44 | } 45 | } 46 | public void handleOscMessage(OscMessage msg) { 47 | System.out.println("Check"); 48 | System.out.println(msg); 49 | } 50 | 51 | public static void main(String args[]) throws Exception { 52 | new IntegrationTest().mainLoop(); 53 | System.out.println("bye"); 54 | } 55 | 56 | 57 | } 58 | -------------------------------------------------------------------------------- /pixelcontroller-osc/src/test/java/com/neophob/sematrix/osc/ObserverTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.osc; 20 | 21 | import static org.junit.Assert.*; 22 | 23 | import org.junit.Test; 24 | 25 | import com.neophob.sematrix.osc.model.OscMessage; 26 | import com.neophob.sematrix.osc.server.OscMessageHandler; 27 | import com.neophob.sematrix.osc.server.TestOscServer; 28 | import com.neophob.sematrix.osc.server.impl.OscServer; 29 | 30 | public class ObserverTest extends OscMessageHandler { 31 | 32 | private OscMessage msg = null; 33 | 34 | @Test 35 | public void TestObserver() { 36 | OscServer srv = new TestOscServer(this); 37 | srv.startServer(); 38 | //initial / removed 39 | assertEquals("HELLO", msg.getPattern()); 40 | assertEquals("WORLD", msg.getArgs()[0]); 41 | assertEquals(4, srv.getPacketCounter()); 42 | assertTrue(srv.getBytesRecieved() > 20); 43 | } 44 | 45 | public void handleOscMessage(OscMessage msg) { 46 | this.msg = msg; 47 | System.out.println(msg); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /pixelcontroller-osc/src/test/java/com/neophob/sematrix/osc/server/TestOscServer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2013 Michael Vogt 3 | * 4 | * This file is part of PixelController. 5 | * 6 | * PixelController is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PixelController is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PixelController. If not, see . 18 | */ 19 | package com.neophob.sematrix.osc.server; 20 | 21 | import com.neophob.sematrix.osc.model.OscMessage; 22 | import com.neophob.sematrix.osc.server.impl.OscServer; 23 | 24 | 25 | public class TestOscServer extends OscServer { 26 | 27 | public TestOscServer(OscMessageHandler handler) { 28 | super(handler, "127.0.0.1", 3333, 50000); 29 | } 30 | 31 | @Override 32 | public void startServer() { 33 | this.notifyOscClients(new OscMessage("/HELLO")); 34 | this.notifyOscClients(new OscMessage("/HELLO", new byte[] {0,1,2})); 35 | this.notifyOscClients(new OscMessage("/HELLO", new String[] {"WORLD"}, new byte[] {0,1,2})); 36 | this.notifyOscClients(new OscMessage("/HELLO", "WORLD")); 37 | } 38 | 39 | @Override 40 | public void stopServer() { 41 | // TODO Auto-generated method stub 42 | 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /pixelcontroller-osc/src/test/resources/logging.properties: -------------------------------------------------------------------------------- 1 | # Properties file which configures the operation of the JDK 2 | # logging facility. 3 | 4 | # The system will look for this config file, first using 5 | # a System property specified at startup: 6 | # 7 | # >java -Djava.util.logging.config.file=myLoggingConfigFilePath 8 | # 9 | # If this property is not specified, then the config file is 10 | # retrieved from its default location at: 11 | # 12 | # JDK_HOME/jre/lib/logging.properties 13 | 14 | # Global logging properties. 15 | # ------------------------------------------ 16 | # The set of handlers to be loaded upon startup. 17 | # Comma-separated list of class names. 18 | # (? LogManager docs say no comma here, but JDK example has comma.) 19 | handlers=java.util.logging.ConsoleHandler 20 | 21 | # Default global logging level. 22 | # Loggers and Handlers may override this level 23 | .level=WARNING 24 | 25 | # Handlers 26 | # ----------------------------------------- 27 | 28 | # --- ConsoleHandler --- 29 | # Override of global logging level 30 | # Use serve level only for console handler 31 | java.util.logging.ConsoleHandler.level=WARNING 32 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter 33 | 34 | 35 | #EOF 36 | --------------------------------------------------------------------------------