/** * Create the "Select Instruments For Each Track " lists. The list of possible instruments is in * MidiFile.java. */ private void createInstrumentPrefs(PreferenceScreen root) { PreferenceCategory selectInstrTitle = new PreferenceCategory(this); selectInstrTitle.setTitle(R.string.select_instruments_per_track); root.addPreference(selectInstrTitle); selectInstruments = new ListPreference[options.tracks.length]; for (int i = 0; i < options.instruments.length; i++) { selectInstruments[i] = new ListPreference(this); selectInstruments[i].setOnPreferenceChangeListener(this); selectInstruments[i].setEntries(MidiFile.Instruments); selectInstruments[i].setEntryValues(MidiFile.Instruments); selectInstruments[i].setTitle("Track " + i); selectInstruments[i].setValueIndex(options.instruments[i]); selectInstruments[i].setSummary(selectInstruments[i].getEntry()); root.addPreference(selectInstruments[i]); } setAllToPiano = new Preference(this); setAllToPiano.setTitle(R.string.set_all_to_piano); setAllToPiano.setOnPreferenceClickListener(this); root.addPreference(setAllToPiano); }
/* Create the "Restore Default Settings" preference */ private void createRestoreDefaultPrefs(PreferenceScreen root) { restoreDefaults = new Preference(this); restoreDefaults.setTitle(R.string.restore_defaults); restoreDefaults.setOnPreferenceClickListener(this); root.addPreference(restoreDefaults); }