Class Wayang


  • public class Wayang
    extends Object
    Supports drawing images on the Ableton Push 2 graphical display. Uses the excellent documentation Ableton provided at https://github.com/Ableton/push-interface
    Author:
    James Elliott
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DISPLAY_HEIGHT
      The height of the display, in pixels.
      static int DISPLAY_WIDTH
      The width of the display, in pixels.
    • Constructor Summary

      Constructors 
      Constructor Description
      Wayang()  
    • Field Detail

      • DISPLAY_WIDTH

        public static final int DISPLAY_WIDTH
        The width of the display, in pixels.
        See Also:
        Constant Field Values
      • DISPLAY_HEIGHT

        public static final int DISPLAY_HEIGHT
        The height of the display, in pixels.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Wayang

        public Wayang()
    • Method Detail

      • close

        public static void close()
        Close the Push 2 interface if it is open, and shut down our LibUsb context if it is active.
      • open

        public static BufferedImage open()
        Set up a connection to libusb, find the Push 2, and open its display interface. If the display is already open, simply returns the existing buffered image.
        Returns:
        an image in which anything drawn will be sent to the Push 2 display whenever you call the sendFrame method.
        Throws:
        org.usb4java.LibUsbException - if there is a problem communicating with the USB environment.
        IllegalStateException - if no Push 2 can be found.
      • sendFrame

        public static void sendFrame()
        Send a frame of pixels, corresponding to whatever has been drawn in the image returned by open(), to the display.
        Throws:
        org.usb4java.LibUsbException - if there is a problem communicating.
        IllegalStateException - if the Push 2 has not been opened.
      • sendFrameAsync

        public static void sendFrameAsync()
        Send a frame of pixels asynchronously, corresponding to whatever has been drawn in the image returned by open(), to the display.
        Throws:
        org.usb4java.LibUsbException - if there is a problem communicating.
        IllegalStateException - if the Push 2 has not been opened.