List of usage examples for javax.sound.midi Receiver close
@Override
void close();
From source file:de.ailis.midi4js.Midi4JS.java
/** * Releases the specifeid receiver handle. * * @param receiverHandle/*from w w w . ja v a 2 s .c o m*/ * The receiver handle to release. */ public void closeReceiver(final int receiverHandle) { final Receiver receiver = resolveReceiverHandle(receiverHandle); receiver.close(); this.receiverMap.remove(receiverHandle); }
From source file:de.ailis.midi4js.Midi4JS.java
/** * @see java.applet.Applet#stop()//from w w w. j a va2s .com */ @Override public void stop() { for (final Receiver receiver : this.receiverMap.values()) receiver.close(); for (final Transmitter transmitter : this.transmitterMap.values()) transmitter.close(); for (final MidiDevice device : this.deviceMap.values()) if (device.isOpen()) device.close(); this.deviceMap = null; this.receiverMap = null; this.transmitterMap = null; System.out.println("Stopped midi4js applet (Instance #" + System.identityHashCode(this) + ")"); }