Beispiel #1
0
  /** Updates the audio device list. */
  private void updateAudioDevices() {
    SamplerModel sm = CC.getSamplerModel();
    SamplerChannel sc = getModel().getChannelInfo();

    setUpdate(true);

    try {
      cbAudioDevice.removeAllItems();

      for (AudioDeviceModel m : sm.getAudioDeviceModels()) cbAudioDevice.addItem(m.getDeviceInfo());

      AudioDeviceModel am = sm.getAudioDeviceModel(sc.getAudioOutputDevice());
      cbAudioDevice.setSelectedItem(am == null ? null : am.getDeviceInfo());
    } catch (Exception x) {
      CC.getLogger().log(Level.WARNING, "Unkown error", x);
    }

    setUpdate(false);
  }
Beispiel #2
0
  /** Updates the channel settings. This method is invoked when changes to the channel were made. */
  private void updateChannelProperties() {
    SamplerModel sm = CC.getSamplerModel();
    SamplerChannel sc = getModel().getChannelInfo();

    MidiDeviceModel mm = sm.getMidiDeviceModel(sc.getMidiInputDevice());
    AudioDeviceModel am = sm.getAudioDeviceModel(sc.getAudioOutputDevice());

    if (isUpdate()) CC.getLogger().warning("Unexpected update state!");

    setUpdate(true);

    try {
      cbMidiDevice.setSelectedItem(mm == null ? null : mm.getDeviceInfo());

      cbEngines.setSelectedItem(sc.getEngine());

      cbAudioDevice.setSelectedItem(am == null ? null : am.getDeviceInfo());
    } catch (Exception x) {
      CC.getLogger().log(Level.WARNING, "Unkown error", x);
    }

    setUpdate(false);
  }