コード例 #1
0
ファイル: Test.java プロジェクト: cabalsdemon/red5-server
  /**
   * 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();
  }
コード例 #2
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;
    }
  }