List of usage examples for javax.sound.midi MidiDevice getReceivers
List<Receiver> getReceivers();
From source file:de.ailis.midi4js.Midi4JS.java
/** * Returns all currently open receivers. * * @param deviceHandle/* w ww . j a v a2 s . c om*/ * The device handle. * @return All currently open receivers in form of a JSON-encoded string * which describes an array of receiver handles. * @throws JSONException * When JSON data could not be constructed. */ public String getReceivers(final int deviceHandle) throws JSONException { final MidiDevice device = resolveDeviceHandle(deviceHandle); final JSONStringer json = new JSONStringer(); json.array(); for (final Receiver receiver : device.getReceivers()) { json.value(System.identityHashCode(receiver)); } json.endArray(); return json.toString(); }