Pitch Detector: use special functions for choosing bool values
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22755 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
46bb567ec4
commit
16cb628eb7
1 changed files with 7 additions and 23 deletions
|
@ -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,
|
enum settings_file_status tuner_settings_load(struct tuner_settings* settings,
|
||||||
char* filename)
|
char* filename)
|
||||||
{
|
{
|
||||||
|
@ -465,12 +457,6 @@ static const struct opt_items accidental_text[] =
|
||||||
{ "Sharp", -1 },
|
{ "Sharp", -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct opt_items noyes_text[] =
|
|
||||||
{
|
|
||||||
{ "No", -1 },
|
|
||||||
{ "Yes", -1 }
|
|
||||||
};
|
|
||||||
|
|
||||||
void set_min_freq(int new_freq)
|
void set_min_freq(int new_freq)
|
||||||
{
|
{
|
||||||
tuner_settings.sample_size = freq2period(new_freq) * 4;
|
tuner_settings.sample_size = freq2period(new_freq) * 4;
|
||||||
|
@ -533,9 +519,8 @@ bool main_menu(void)
|
||||||
rb->set_option(
|
rb->set_option(
|
||||||
"Algorithm Pickiness (Lower -> more discriminating)",
|
"Algorithm Pickiness (Lower -> more discriminating)",
|
||||||
&tuner_settings.yin_threshold,
|
&tuner_settings.yin_threshold,
|
||||||
INT, yin_threshold_text,
|
INT, yin_threshold_text,
|
||||||
sizeof(yin_threshold_text) /
|
sizeof(yin_threshold_text) / sizeof(yin_threshold_text[0]),
|
||||||
sizeof(yin_threshold_text[0]),
|
|
||||||
NULL);
|
NULL);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
|
@ -544,9 +529,8 @@ bool main_menu(void)
|
||||||
BOOL, accidental_text, 2, NULL);
|
BOOL, accidental_text, 2, NULL);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
rb->set_option("Display Frequency (Hz)",
|
rb->set_bool("Display Frequency (Hz)",
|
||||||
&tuner_settings.display_hz,
|
&tuner_settings.display_hz);
|
||||||
BOOL, noyes_text, 2, NULL);
|
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
freq_val = freq_A[tuner_settings.freq_A].frequency;
|
freq_val = freq_A[tuner_settings.freq_A].frequency;
|
||||||
|
@ -558,9 +542,9 @@ bool main_menu(void)
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
reset = false;
|
reset = false;
|
||||||
rb->set_option("Reset Tuner Settings?",
|
rb->set_bool("Reset Tuner Settings?", &reset);
|
||||||
&reset,
|
if (reset)
|
||||||
BOOL, noyes_text, 2, tuner_settings_reset_query);
|
tuner_settings_reset(&tuner_settings);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
exit_tuner = true;
|
exit_tuner = true;
|
||||||
|
|
Loading…
Reference in a new issue