- java.lang.Object
-
- org.deepsymmetry.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 intDISPLAY_HEIGHTThe height of the display, in pixels.static intDISPLAY_WIDTHThe width of the display, in pixels.
-
Constructor Summary
Constructors Constructor Description Wayang()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclose()Close the Push 2 interface if it is open, and shut down our LibUsb context if it is active.static BufferedImageopen()Set up a connection to libusb, find the Push 2, and open its display interface.static voidsendFrame()Send a frame of pixels, corresponding to whatever has been drawn in the image returned by open(), to the display.static voidsendFrameAsync()Send a frame of pixels asynchronously, corresponding to whatever has been drawn in the image returned by open(), to the display.
-
-
-
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
-
-
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.
-
-