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;
    }
  }
Example #2
0
  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;
    }
  }
Example #3
0
 MidiOutput(javax.sound.midi.MidiDevice device) throws MidiUnavailableException {
   this.device = device;
   if (!device.isOpen()) device.open();
   receiver = device.getReceiver();
 }
Example #4
0
 private void checkOpen(MidiDevice device, boolean desiredState) {
   if (device.isOpen() != desiredState) {
     out("device should be " + getStateString(desiredState) + ", but isn't!");
     failed = true;
   }
 }
Example #5
0
 public boolean isOpen() {
   return input != null && input.isOpen();
 }