diff options
| author | Alexander Levin <al.le@rockbox.org> | 2009-09-20 16:33:24 +0000 |
|---|---|---|
| committer | Alexander Levin <al.le@rockbox.org> | 2009-09-20 16:33:24 +0000 |
| commit | 16cb628eb7d86e64dc7cab739ebb8dfc6e9900c2 (patch) | |
| tree | 493a139ae0073db1c6066ab8e85f8ee22a7bfc33 /apps/plugins | |
| parent | 46bb567ec4df041426372afaae75931636575695 (diff) | |
| download | rockbox-16cb628eb7d86e64dc7cab739ebb8dfc6e9900c2.zip rockbox-16cb628eb7d86e64dc7cab739ebb8dfc6e9900c2.tar.gz rockbox-16cb628eb7d86e64dc7cab739ebb8dfc6e9900c2.tar.bz2 rockbox-16cb628eb7d86e64dc7cab739ebb8dfc6e9900c2.tar.xz | |
Pitch Detector: use special functions for choosing bool values
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22755 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/pitch_detector.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/apps/plugins/pitch_detector.c b/apps/plugins/pitch_detector.c index eb3b56c..c1d0cff 100644 --- a/apps/plugins/pitch_detector.c +++ b/apps/plugins/pitch_detector.c @@ -364,14 +364,6 @@ void tuner_settings_reset(struct tuner_settings* settings) /*---------------------------------------------------------------------*/ -void tuner_settings_reset_query(int yes) -{ - if(yes) - tuner_settings_reset(&tuner_settings); -} - -/*---------------------------------------------------------------------*/ - enum settings_file_status tuner_settings_load(struct tuner_settings* settings, char* filename) { @@ -465,12 +457,6 @@ static const struct opt_items accidental_text[] = { "Sharp", -1 }, }; -static const struct opt_items noyes_text[] = -{ - { "No", -1 }, - { "Yes", -1 } -}; - void set_min_freq(int new_freq) { tuner_settings.sample_size = freq2period(new_freq) * 4; @@ -533,9 +519,8 @@ bool main_menu(void) rb->set_option( "Algorithm Pickiness (Lower -> more discriminating)", &tuner_settings.yin_threshold, - INT, yin_threshold_text, - sizeof(yin_threshold_text) / - sizeof(yin_threshold_text[0]), + INT, yin_threshold_text, + sizeof(yin_threshold_text) / sizeof(yin_threshold_text[0]), NULL); break; case 5: @@ -544,9 +529,8 @@ bool main_menu(void) BOOL, accidental_text, 2, NULL); break; case 6: - rb->set_option("Display Frequency (Hz)", - &tuner_settings.display_hz, - BOOL, noyes_text, 2, NULL); + rb->set_bool("Display Frequency (Hz)", + &tuner_settings.display_hz); break; case 7: freq_val = freq_A[tuner_settings.freq_A].frequency; @@ -558,9 +542,9 @@ bool main_menu(void) break; case 8: reset = false; - rb->set_option("Reset Tuner Settings?", - &reset, - BOOL, noyes_text, 2, tuner_settings_reset_query); + rb->set_bool("Reset Tuner Settings?", &reset); + if (reset) + tuner_settings_reset(&tuner_settings); break; case 9: exit_tuner = true; |