Exemplo n.º 1
0
  /* Create the "Left-hand color" and "Right-hand color" preferences */
  private void createColorPrefs(PreferenceScreen root) {
    shade1Color = new ColorPreference(this);
    shade1Color.setColor(options.shade1Color);
    shade1Color.setTitle(R.string.right_hand_color);
    root.addPreference(shade1Color);

    shade2Color = new ColorPreference(this);
    shade2Color.setColor(options.shade2Color);
    shade2Color.setTitle(R.string.left_hand_color);
    root.addPreference(shade2Color);
  }
Exemplo n.º 2
0
  /** Update the MidiOptions based on the preferences selected. */
  private void updateOptions() {
    for (int i = 0; i < options.tracks.length; i++) {
      options.tracks[i] = selectTracks[i].isChecked();
    }
    for (int i = 0; i < options.mute.length; i++) {
      options.mute[i] = muteTracks[i].isChecked();
    }
    for (int i = 0; i < options.tracks.length; i++) {
      ListPreference entry = selectInstruments[i];
      options.instruments[i] = entry.findIndexOfValue(entry.getValue());
    }
    options.scrollVert = scrollVertically.isChecked();
    options.showPiano = showPiano.isChecked();
    options.showLyrics = showLyrics.isChecked();
    if (twoStaffs != null) options.twoStaffs = twoStaffs.isChecked();
    else options.twoStaffs = false;

    options.showNoteLetters = Integer.parseInt(showNoteLetters.getValue());
    options.transpose = Integer.parseInt(transpose.getValue());
    options.key = Integer.parseInt(key.getValue());
    if (time.getValue().equals("Default")) {
      options.time = null;
    } else if (time.getValue().equals("3/4")) {
      options.time =
          new TimeSignature(3, 4, options.defaultTime.getQuarter(), options.defaultTime.getTempo());
    } else if (time.getValue().equals("4/4")) {
      options.time =
          new TimeSignature(4, 4, options.defaultTime.getQuarter(), options.defaultTime.getTempo());
    }
    options.combineInterval = Integer.parseInt(combineInterval.getValue());
    options.shade1Color = shade1Color.getColor();
    options.shade2Color = shade2Color.getColor();
    options.showMeasures = showMeasures.isChecked();
    options.playMeasuresInLoop = playMeasuresInLoop.isChecked();
    options.playMeasuresInLoopStart = Integer.parseInt(loopStart.getValue()) - 1;
    options.playMeasuresInLoopEnd = Integer.parseInt(loopEnd.getValue()) - 1;
  }