Exemplo n.º 1
0
  /**
   * 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();
  }
Exemplo n.º 2
0
  public void close() {
    if (input != null) {
      input.close();
    }
    input = null;

    if (cl != null) {
      cl.stateChanged(e);
    }
  }
Exemplo n.º 3
0
  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;
    }
  }
Exemplo n.º 4
0
 public void close() {
   transmitter.close();
   device.close();
   //        this.mrftd.close();
   //        this.transmitter.close();
 }
Exemplo n.º 5
0
 public void stopListening() {
   //        this.transmitter.setReceiver(this.defaultReceiver);
   device.close();
   //        this.transmitter.close();
   //        this.mrftd.close();
 }
Exemplo n.º 6
0
 /**
  * Close the device associated with this output. This will close other outputs connected to this
  * device as well.
  */
 public void closeMidi() {
   device.close();
 }