/** * Constructs a new Test. * * @throws Exception if it feels like it. */ public Test() throws Exception { String MIDI_NAME = "USB Uno MIDI In"; MidiDevice dev = getMidiDevice(MIDI_NAME); dev.open(); MyReceiver rec = new MyReceiver(); dev.getTransmitter().setReceiver(rec); Thread.sleep(20000); dev.close(); }
public void close() { if (input != null) { input.close(); } input = null; if (cl != null) { cl.stateChanged(e); } }
private void init() throws MidiUnavailableException { try { if (!(device.isOpen())) { device.open(); } this.transmitter = device.getTransmitter(); this.mrftd = new MidiReceiverForTransmitterDevice(); } catch (MidiUnavailableException e) { device.close(); throw e; } }
public void close() { transmitter.close(); device.close(); // this.mrftd.close(); // this.transmitter.close(); }
public void stopListening() { // this.transmitter.setReceiver(this.defaultReceiver); device.close(); // this.transmitter.close(); // this.mrftd.close(); }
/** * Close the device associated with this output. This will close other outputs connected to this * device as well. */ public void closeMidi() { device.close(); }