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 open() throws MidiUnavailableException { if (input != null && input.isOpen()) { return; } try { input = MidiSystem.getMidiDevice(info); input.open(); cl.stateChanged(e); } catch (MidiUnavailableException ex) { input = null; throw ex; } catch (IllegalArgumentException ex) { input = null; } }
MidiOutput(javax.sound.midi.MidiDevice device) throws MidiUnavailableException { this.device = device; if (!device.isOpen()) device.open(); receiver = device.getReceiver(); }
private void checkOpen(MidiDevice device, boolean desiredState) { if (device.isOpen() != desiredState) { out("device should be " + getStateString(desiredState) + ", but isn't!"); failed = true; } }
public boolean isOpen() { return input != null && input.isOpen(); }