Exemple #1
0
  /** Updates the channel settings. This method is invoked when changes to the channel were made. */
  private void updateChannelInfo() {
    SamplerChannel sc = getChannelInfo();

    int status = sc.getInstrumentStatus();
    if (status >= 0 && status < 100) {
      btnInstr.setText(i18n.getLabel("Channel.loadingInstrument", status));
    } else if (status == -1) {
      btnInstr.setText(i18n.getLabel("Channel.btnInstr"));
    } else if (status < -1) {
      btnInstr.setText(i18n.getLabel("Channel.errorLoadingInstrument"));
    } else {
      if (sc.getInstrumentName() != null) btnInstr.setText(sc.getInstrumentName());
      else btnInstr.setText(i18n.getLabel("Channel.btnInstr"));
    }

    updateMuteIcon(sc);

    if (sc.isSoloChannel()) btnSolo.setIcon(iconSoloOn);
    else btnSolo.setIcon(iconSoloOff);

    slVolume.setValue((int) (sc.getVolume() * 100));

    boolean b = sc.getEngine() != null;
    slVolume.setEnabled(b);
    btnSolo.setEnabled(b);
    btnMute.setEnabled(b);
  }
Exemple #2
0
    public String getInstrument() {
      SamplerChannel sc = Channel.this.getChannelInfo();

      if (sc.getInstrumentName() == null || sc.getInstrumentStatus() < 0) return null;

      Instrument instr = new Instrument();
      instr.setName(sc.getInstrumentName());
      instr.setInstrumentIndex(sc.getInstrumentIndex());
      instr.setPath(sc.getInstrumentFile());
      return instr.getDnDString();
    }