diff options
| author | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-03-15 08:27:51 +0000 |
|---|---|---|
| committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-03-15 08:27:51 +0000 |
| commit | 42ffbf9bbc1936e22c6bae5b5b6ce10d2a4552cf (patch) | |
| tree | 679c9c24aeb1ad7e841120513f646bf39b9a4cb8 /apps/settings.c | |
| parent | 38ac78ae975f64d69e3ea430113ed76d420f512f (diff) | |
| download | rockbox-42ffbf9bbc1936e22c6bae5b5b6ce10d2a4552cf.zip rockbox-42ffbf9bbc1936e22c6bae5b5b6ce10d2a4552cf.tar.gz rockbox-42ffbf9bbc1936e22c6bae5b5b6ce10d2a4552cf.tar.bz2 rockbox-42ffbf9bbc1936e22c6bae5b5b6ce10d2a4552cf.tar.xz | |
Second step of the voice-UI: Option values are spoken, if they are translatable strings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4383 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings.c')
| -rw-r--r-- | apps/settings.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/apps/settings.c b/apps/settings.c index dfd211e..7ce4bea 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -32,6 +32,7 @@ #include "lcd.h" #include "mpeg.h" #include "mp3_playback.h" +#include "talk.h" #include "string.h" #include "ata.h" #include "fat.h" @@ -1643,8 +1644,10 @@ void settings_reset(void) { bool set_bool(char* string, bool* variable ) { - return set_bool_options(string, variable, str(LANG_SET_BOOL_YES), - str(LANG_SET_BOOL_NO), NULL); + return set_bool_options(string, variable, + STR(LANG_SET_BOOL_YES), + STR(LANG_SET_BOOL_NO), + NULL); } /* wrapper to convert from int param to bool param in set_option */ @@ -1658,9 +1661,11 @@ void bool_funcwrapper(int value) } bool set_bool_options(char* string, bool* variable, - char* yes_str, char* no_str, void (*function)(bool)) + char* yes_str, int yes_voice, + char* no_str, int no_voice, + void (*function)(bool)) { - char* names[] = { no_str, yes_str }; + struct opt_items names[] = { {no_str, no_voice}, {yes_str, yes_voice} }; bool result; boolfunction = function; @@ -1775,13 +1780,14 @@ bool set_int(char* string, code. */ bool set_option(char* string, void* variable, enum optiontype type, - char* options[], int numoptions, void (*function)(int)) + struct opt_items* options, int numoptions, void (*function)(int)) { bool done = false; int button; int* intvar = (int*)variable; bool* boolvar = (bool*)variable; int oldval = 0; + int index, oldindex = -1; /* remember what we said */ if (type==INT) oldval=*intvar; @@ -1799,7 +1805,13 @@ bool set_option(char* string, void* variable, enum optiontype type, lcd_puts_scroll(0, 0, string); while ( !done ) { - lcd_puts(0, 1, options[type==INT ? *intvar : (int)*boolvar]); + index = type==INT ? *intvar : (int)*boolvar; + lcd_puts(0, 1, options[index].string); + if (index != oldindex) + { + talk_id(options[index].voice_id, false); + oldindex = index; + } #ifdef HAVE_LCD_BITMAP status_draw(true); #endif |