summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2004-03-15 08:27:51 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2004-03-15 08:27:51 +0000
commit42ffbf9bbc1936e22c6bae5b5b6ce10d2a4552cf (patch)
tree679c9c24aeb1ad7e841120513f646bf39b9a4cb8 /apps
parent38ac78ae975f64d69e3ea430113ed76d420f512f (diff)
downloadrockbox-42ffbf9bbc1936e22c6bae5b5b6ce10d2a4552cf.tar.gz
rockbox-42ffbf9bbc1936e22c6bae5b5b6ce10d2a4552cf.zip
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')
-rw-r--r--apps/menu.h3
-rw-r--r--apps/playlist_menu.c8
-rw-r--r--apps/playlist_viewer.c6
-rw-r--r--apps/settings.c24
-rw-r--r--apps/settings.h14
-rw-r--r--apps/settings_menu.c259
-rw-r--r--apps/sound_menu.c112
7 files changed, 299 insertions, 127 deletions
diff --git a/apps/menu.h b/apps/menu.h
index dbe5151178..88a0372299 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -28,9 +28,6 @@ struct menu_items {
28 bool (*function) (void); /* return true if USB was connected */ 28 bool (*function) (void); /* return true if USB was connected */
29}; 29};
30 30
31/* convenience macro to have both string and ID as arguments */
32#define STR(id) str(id), id
33
34int menu_init(struct menu_items* items, int count, int (*callback) (int keycode, int menu)); 31int menu_init(struct menu_items* items, int count, int (*callback) (int keycode, int menu));
35void menu_exit(int menu); 32void menu_exit(int menu);
36 33
diff --git a/apps/playlist_menu.c b/apps/playlist_menu.c
index 6eafe0c547..9da13c335b 100644
--- a/apps/playlist_menu.c
+++ b/apps/playlist_menu.c
@@ -50,9 +50,11 @@ static bool save_playlist(void)
50 50
51static bool recurse_directory(void) 51static bool recurse_directory(void)
52{ 52{
53 char* names[] = { str(LANG_OFF), 53 struct opt_items names[] = {
54 str(LANG_ON), 54 { STR(LANG_OFF) },
55 str(LANG_RESUME_SETTING_ASK) }; 55 { STR(LANG_ON) },
56 { STR(LANG_RESUME_SETTING_ASK)},
57 };
56 58
57 return set_option( str(LANG_RECURSE_DIRECTORY), 59 return set_option( str(LANG_RECURSE_DIRECTORY),
58 &global_settings.recursive_dir_insert, INT, names, 3, 60 &global_settings.recursive_dir_insert, INT, names, 3,
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index 8b9470cdca..8d6429f767 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -792,9 +792,9 @@ static bool show_indices(void)
792/* How to display a track */ 792/* How to display a track */
793static bool track_display(void) 793static bool track_display(void)
794{ 794{
795 char* names[] = { 795 struct opt_items names[] = {
796 str(LANG_DISPLAY_TRACK_NAME_ONLY), 796 { STR(LANG_DISPLAY_TRACK_NAME_ONLY) },
797 str(LANG_DISPLAY_FULL_PATH) 797 { STR(LANG_DISPLAY_FULL_PATH) }
798 }; 798 };
799 799
800 return set_option(str(LANG_TRACK_DISPLAY), 800 return set_option(str(LANG_TRACK_DISPLAY),
diff --git a/apps/settings.c b/apps/settings.c
index dfd211e3fa..7ce4beacaf 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -32,6 +32,7 @@
32#include "lcd.h" 32#include "lcd.h"
33#include "mpeg.h" 33#include "mpeg.h"
34#include "mp3_playback.h" 34#include "mp3_playback.h"
35#include "talk.h"
35#include "string.h" 36#include "string.h"
36#include "ata.h" 37#include "ata.h"
37#include "fat.h" 38#include "fat.h"
@@ -1643,8 +1644,10 @@ void settings_reset(void) {
1643 1644
1644bool set_bool(char* string, bool* variable ) 1645bool set_bool(char* string, bool* variable )
1645{ 1646{
1646 return set_bool_options(string, variable, str(LANG_SET_BOOL_YES), 1647 return set_bool_options(string, variable,
1647 str(LANG_SET_BOOL_NO), NULL); 1648 STR(LANG_SET_BOOL_YES),
1649 STR(LANG_SET_BOOL_NO),
1650 NULL);
1648} 1651}
1649 1652
1650/* wrapper to convert from int param to bool param in set_option */ 1653/* wrapper to convert from int param to bool param in set_option */
@@ -1658,9 +1661,11 @@ void bool_funcwrapper(int value)
1658} 1661}
1659 1662
1660bool set_bool_options(char* string, bool* variable, 1663bool set_bool_options(char* string, bool* variable,
1661 char* yes_str, char* no_str, void (*function)(bool)) 1664 char* yes_str, int yes_voice,
1665 char* no_str, int no_voice,
1666 void (*function)(bool))
1662{ 1667{
1663 char* names[] = { no_str, yes_str }; 1668 struct opt_items names[] = { {no_str, no_voice}, {yes_str, yes_voice} };
1664 bool result; 1669 bool result;
1665 1670
1666 boolfunction = function; 1671 boolfunction = function;
@@ -1775,13 +1780,14 @@ bool set_int(char* string,
1775 code. */ 1780 code. */
1776 1781
1777bool set_option(char* string, void* variable, enum optiontype type, 1782bool set_option(char* string, void* variable, enum optiontype type,
1778 char* options[], int numoptions, void (*function)(int)) 1783 struct opt_items* options, int numoptions, void (*function)(int))
1779{ 1784{
1780 bool done = false; 1785 bool done = false;
1781 int button; 1786 int button;
1782 int* intvar = (int*)variable; 1787 int* intvar = (int*)variable;
1783 bool* boolvar = (bool*)variable; 1788 bool* boolvar = (bool*)variable;
1784 int oldval = 0; 1789 int oldval = 0;
1790 int index, oldindex = -1; /* remember what we said */
1785 1791
1786 if (type==INT) 1792 if (type==INT)
1787 oldval=*intvar; 1793 oldval=*intvar;
@@ -1799,7 +1805,13 @@ bool set_option(char* string, void* variable, enum optiontype type,
1799 lcd_puts_scroll(0, 0, string); 1805 lcd_puts_scroll(0, 0, string);
1800 1806
1801 while ( !done ) { 1807 while ( !done ) {
1802 lcd_puts(0, 1, options[type==INT ? *intvar : (int)*boolvar]); 1808 index = type==INT ? *intvar : (int)*boolvar;
1809 lcd_puts(0, 1, options[index].string);
1810 if (index != oldindex)
1811 {
1812 talk_id(options[index].voice_id, false);
1813 oldindex = index;
1814 }
1803#ifdef HAVE_LCD_BITMAP 1815#ifdef HAVE_LCD_BITMAP
1804 status_draw(true); 1816 status_draw(true);
1805#endif 1817#endif
diff --git a/apps/settings.h b/apps/settings.h
index 3634087cab..ab3cd6fca8 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -60,6 +60,9 @@
60#define FF_REWIND_45000 12 60#define FF_REWIND_45000 12
61#define FF_REWIND_60000 13 61#define FF_REWIND_60000 13
62 62
63/* convenience macro to have both string and ID as arguments */
64#define STR(id) str(id), id
65
63 66
64struct user_settings 67struct user_settings
65{ 68{
@@ -203,6 +206,11 @@ struct user_settings
203 206
204enum optiontype { INT, BOOL }; 207enum optiontype { INT, BOOL };
205 208
209struct opt_items {
210 char* string;
211 int voice_id;
212};
213
206/* prototypes */ 214/* prototypes */
207 215
208int settings_save(void); 216int settings_save(void);
@@ -215,11 +223,13 @@ void settings_display(void);
215bool settings_load_config(char* file); 223bool settings_load_config(char* file);
216bool settings_save_config(void); 224bool settings_save_config(void);
217bool set_bool_options(char* string, bool* variable, 225bool set_bool_options(char* string, bool* variable,
218 char* yes_str, char* no_str, void (*function)(bool)); 226 char* yes_str, int yes_voice,
227 char* no_str, int no_voice,
228 void (*function)(bool));
219 229
220bool set_bool(char* string, bool* variable ); 230bool set_bool(char* string, bool* variable );
221bool set_option(char* string, void* variable, enum optiontype type, 231bool set_option(char* string, void* variable, enum optiontype type,
222 char* options[], int numoptions, void (*function)(int)); 232 struct opt_items* options, int numoptions, void (*function)(int));
223bool set_int(char* string, char* unit, int* variable, 233bool set_int(char* string, char* unit, int* variable,
224 void (*function)(int), int step, int min, int max ); 234 void (*function)(int), int step, int min, int max );
225bool set_time(char* string, int timedate[]); 235bool set_time(char* string, int timedate[]);
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 75c78a7de3..ea2738f176 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -55,8 +55,8 @@ static bool car_adapter_mode(void)
55{ 55{
56 return set_bool_options( str(LANG_CAR_ADAPTER_MODE), 56 return set_bool_options( str(LANG_CAR_ADAPTER_MODE),
57 &global_settings.car_adapter_mode, 57 &global_settings.car_adapter_mode,
58 str(LANG_SET_BOOL_YES), 58 STR(LANG_SET_BOOL_YES),
59 str(LANG_SET_BOOL_NO), 59 STR(LANG_SET_BOOL_NO),
60 set_car_adapter_mode); 60 set_car_adapter_mode);
61} 61}
62 62
@@ -92,8 +92,8 @@ static bool invert(void)
92{ 92{
93 bool rc = set_bool_options(str(LANG_INVERT), 93 bool rc = set_bool_options(str(LANG_INVERT),
94 &global_settings.invert, 94 &global_settings.invert,
95 str(LANG_INVERT_LCD_INVERSE), 95 STR(LANG_INVERT_LCD_INVERSE),
96 str(LANG_INVERT_LCD_NORMAL), 96 STR(LANG_INVERT_LCD_NORMAL),
97 lcd_set_invert_display); 97 lcd_set_invert_display);
98 return rc; 98 return rc;
99} 99}
@@ -105,8 +105,8 @@ static bool invert_cursor(void)
105{ 105{
106 return set_bool_options(str(LANG_INVERT_CURSOR), 106 return set_bool_options(str(LANG_INVERT_CURSOR),
107 &global_settings.invert_cursor, 107 &global_settings.invert_cursor,
108 str(LANG_INVERT_CURSOR_BAR), 108 STR(LANG_INVERT_CURSOR_BAR),
109 str(LANG_INVERT_CURSOR_POINTER), 109 STR(LANG_INVERT_CURSOR_POINTER),
110 NULL); 110 NULL);
111} 111}
112 112
@@ -129,9 +129,10 @@ static bool flip_display(void)
129 */ 129 */
130static bool battery_type(void) 130static bool battery_type(void)
131{ 131{
132 char* names[] = { str(LANG_DISPLAY_GRAPHIC), 132 struct opt_items names[] = {
133 str(LANG_DISPLAY_NUMERIC) }; 133 { STR(LANG_DISPLAY_GRAPHIC) },
134 134 { STR(LANG_DISPLAY_NUMERIC) }
135 };
135 return set_option( str(LANG_BATTERY_DISPLAY), 136 return set_option( str(LANG_BATTERY_DISPLAY),
136 &global_settings.battery_type, INT, names, 2, NULL); 137 &global_settings.battery_type, INT, names, 2, NULL);
137} 138}
@@ -141,9 +142,10 @@ static bool battery_type(void)
141 */ 142 */
142static bool volume_type(void) 143static bool volume_type(void)
143{ 144{
144 char* names[] = { str(LANG_DISPLAY_GRAPHIC), 145 struct opt_items names[] = {
145 str(LANG_DISPLAY_NUMERIC) }; 146 { STR(LANG_DISPLAY_GRAPHIC) },
146 147 { STR(LANG_DISPLAY_NUMERIC) }
148 };
147 return set_option( str(LANG_VOLUME_DISPLAY), &global_settings.volume_type, 149 return set_option( str(LANG_VOLUME_DISPLAY), &global_settings.volume_type,
148 INT, names, 2, NULL); 150 INT, names, 2, NULL);
149} 151}
@@ -163,11 +165,25 @@ static bool peak_meter_fps_menu(void) {
163 */ 165 */
164static bool peak_meter_hold(void) { 166static bool peak_meter_hold(void) {
165 bool retval = false; 167 bool retval = false;
166 char* names[] = { str(LANG_OFF), 168 struct opt_items names[] = {
167 "200 ms ", "300 ms ", "500 ms ", "1 s ", "2 s ", 169 { STR(LANG_OFF) },
168 "3 s ", "4 s ", "5 s ", "6 s ", "7 s", 170 { "200 ms " , -1 },
169 "8 s", "9 s", "10 s", "15 s", "20 s", 171 { "300 ms " , -1 },
170 "30 s", "1 min" 172 { "500 ms " , -1 },
173 { "1 s " , -1 },
174 { "2 s " , -1 },
175 { "3 s " , -1 },
176 { "4 s " , -1 },
177 { "5 s " , -1 },
178 { "6 s " , -1 },
179 { "7 s" , -1 },
180 { "8 s" , -1 },
181 { "9 s" , -1 },
182 { "10 s" , -1 },
183 { "15 s" , -1 },
184 { "20 s" , -1 },
185 { "30 s" , -1 },
186 { "1 min" , -1 }
171 }; 187 };
172 retval = set_option( str(LANG_PM_PEAK_HOLD), 188 retval = set_option( str(LANG_PM_PEAK_HOLD),
173 &global_settings.peak_meter_hold, INT, names, 189 &global_settings.peak_meter_hold, INT, names,
@@ -186,14 +202,33 @@ static bool peak_meter_hold(void) {
186static bool peak_meter_clip_hold(void) { 202static bool peak_meter_clip_hold(void) {
187 bool retval = false; 203 bool retval = false;
188 204
189 char* names[] = { str(LANG_PM_ETERNAL), 205 struct opt_items names[] = {
190 "1s ", "2s ", "3s ", "4s ", "5s ", 206 { STR(LANG_PM_ETERNAL) },
191 "6s ", "7s ", "8s ", "9s ", "10s", 207 { "1s " , -1 },
192 "15s", "20s", "25s", "30s", "45s", 208 { "2s " , -1 },
193 "60s", "90s", "2min", "3min", "5min", 209 { "3s " , -1 },
194 "10min", "20min", "45min", "90min" 210 { "4s " , -1 },
211 { "5s " , -1 },
212 { "6s " , -1 },
213 { "7s " , -1 },
214 { "8s " , -1 },
215 { "9s " , -1 },
216 { "10s" , -1 },
217 { "15s" , -1 },
218 { "20s" , -1 },
219 { "25s" , -1 },
220 { "30s" , -1 },
221 { "45s" , -1 },
222 { "60s" , -1 },
223 { "90s" , -1 },
224 { "2min" , -1 },
225 { "3min" , -1 },
226 { "5min" , -1 },
227 { "10min" , -1 },
228 { "20min" , -1 },
229 { "45min" , -1 },
230 { "90min" , -1 }
195 }; 231 };
196
197 retval = set_option( str(LANG_PM_CLIP_HOLD), 232 retval = set_option( str(LANG_PM_CLIP_HOLD),
198 &global_settings.peak_meter_clip_hold, INT, names, 233 &global_settings.peak_meter_clip_hold, INT, names,
199 25, peak_meter_set_clip_hold); 234 25, peak_meter_set_clip_hold);
@@ -235,7 +270,7 @@ static bool peak_meter_scale(void) {
235 bool use_dbfs = global_settings.peak_meter_dbfs; 270 bool use_dbfs = global_settings.peak_meter_dbfs;
236 retval = set_bool_options(str(LANG_PM_SCALE), 271 retval = set_bool_options(str(LANG_PM_SCALE),
237 &use_dbfs, 272 &use_dbfs,
238 str(LANG_PM_DBFS), str(LANG_PM_LINEAR), 273 STR(LANG_PM_DBFS), STR(LANG_PM_LINEAR),
239 NULL); 274 NULL);
240 275
241 /* has the user really changed the scale? */ 276 /* has the user really changed the scale? */
@@ -348,7 +383,7 @@ static bool peak_meter_performance(void) {
348 bool retval = false; 383 bool retval = false;
349 retval = set_bool_options(str(LANG_PM_PERFORMANCE), 384 retval = set_bool_options(str(LANG_PM_PERFORMANCE),
350 &global_settings.peak_meter_performance, 385 &global_settings.peak_meter_performance,
351 str(LANG_PM_HIGH_PERFORMANCE), str(LANG_PM_ENERGY_SAVER), 386 STR(LANG_PM_HIGH_PERFORMANCE), STR(LANG_PM_ENERGY_SAVER),
352 NULL); 387 NULL);
353 388
354 if (global_settings.peak_meter_performance) { 389 if (global_settings.peak_meter_performance) {
@@ -395,10 +430,11 @@ static bool shuffle(void)
395static bool repeat_mode(void) 430static bool repeat_mode(void)
396{ 431{
397 bool result; 432 bool result;
398 char* names[] = { str(LANG_OFF), 433 struct opt_items names[] = {
399 str(LANG_REPEAT_ALL), 434 { STR(LANG_OFF) },
400 str(LANG_REPEAT_ONE) }; 435 { STR(LANG_REPEAT_ALL) },
401 436 { STR(LANG_REPEAT_ONE) }
437 };
402 int old_repeat = global_settings.repeat_mode; 438 int old_repeat = global_settings.repeat_mode;
403 439
404 result = set_option( str(LANG_REPEAT), &global_settings.repeat_mode, 440 result = set_option( str(LANG_REPEAT), &global_settings.repeat_mode,
@@ -417,11 +453,12 @@ static bool play_selected(void)
417 453
418static bool dir_filter(void) 454static bool dir_filter(void)
419{ 455{
420 char* names[] = { str(LANG_FILTER_ALL), 456 struct opt_items names[] = {
421 str(LANG_FILTER_SUPPORTED), 457 { STR(LANG_FILTER_ALL) },
422 str(LANG_FILTER_MUSIC), 458 { STR(LANG_FILTER_SUPPORTED) },
423 str(LANG_FILTER_PLAYLIST) }; 459 { STR(LANG_FILTER_MUSIC) },
424 460 { STR(LANG_FILTER_PLAYLIST) }
461 };
425 return set_option( str(LANG_FILTER), &global_settings.dirfilter, INT, 462 return set_option( str(LANG_FILTER), &global_settings.dirfilter, INT,
426 names, 4, NULL ); 463 names, 4, NULL );
427} 464}
@@ -433,23 +470,25 @@ static bool sort_case(void)
433 470
434static bool resume(void) 471static bool resume(void)
435{ 472{
436 char* names[] = { str(LANG_SET_BOOL_NO), 473 struct opt_items names[] = {
437 str(LANG_RESUME_SETTING_ASK), 474 { STR(LANG_SET_BOOL_NO) },
438 str(LANG_RESUME_SETTING_ASK_ONCE), 475 { STR(LANG_RESUME_SETTING_ASK) },
439 str(LANG_SET_BOOL_YES) }; 476 { STR(LANG_RESUME_SETTING_ASK_ONCE) },
440 477 { STR(LANG_SET_BOOL_YES) }
478 };
441 return set_option( str(LANG_RESUME), &global_settings.resume, INT, 479 return set_option( str(LANG_RESUME), &global_settings.resume, INT,
442 names, 4, NULL ); 480 names, 4, NULL );
443} 481}
444 482
445static bool autocreatebookmark(void) 483static bool autocreatebookmark(void)
446{ 484{
447 char* names[] = { str(LANG_SET_BOOL_NO), 485 struct opt_items names[] = {
448 str(LANG_SET_BOOL_YES), 486 { STR(LANG_SET_BOOL_NO) },
449 str(LANG_RESUME_SETTING_ASK), 487 { STR(LANG_SET_BOOL_YES) },
450 str(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_YES), 488 { STR(LANG_RESUME_SETTING_ASK) },
451 str(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_ASK) }; 489 { STR(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_YES) },
452 490 { STR(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_ASK) }
491 };
453 return set_option( str(LANG_BOOKMARK_SETTINGS_AUTOCREATE), 492 return set_option( str(LANG_BOOKMARK_SETTINGS_AUTOCREATE),
454 &global_settings.autocreatebookmark, INT, 493 &global_settings.autocreatebookmark, INT,
455 names, 5, NULL ); 494 names, 5, NULL );
@@ -457,10 +496,11 @@ static bool autocreatebookmark(void)
457 496
458static bool autoloadbookmark(void) 497static bool autoloadbookmark(void)
459{ 498{
460 char* names[] = { str(LANG_SET_BOOL_NO), 499 struct opt_items names[] = {
461 str(LANG_SET_BOOL_YES), 500 { STR(LANG_SET_BOOL_NO) },
462 str(LANG_RESUME_SETTING_ASK) }; 501 { STR(LANG_SET_BOOL_YES) },
463 502 { STR(LANG_RESUME_SETTING_ASK) }
503 };
464 return set_option( str(LANG_BOOKMARK_SETTINGS_AUTOLOAD), 504 return set_option( str(LANG_BOOKMARK_SETTINGS_AUTOLOAD),
465 &global_settings.autoloadbookmark, INT, 505 &global_settings.autoloadbookmark, INT,
466 names, 3, NULL ); 506 names, 3, NULL );
@@ -468,10 +508,11 @@ static bool autoloadbookmark(void)
468 508
469static bool useMRB(void) 509static bool useMRB(void)
470{ 510{
471 char* names[] = { str(LANG_SET_BOOL_NO), 511 struct opt_items names[] = {
472 str(LANG_SET_BOOL_YES), 512 { STR(LANG_SET_BOOL_NO) },
473 str(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY)}; 513 { STR(LANG_SET_BOOL_YES) },
474 514 { STR(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY) }
515 };
475 return set_option( str(LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS), 516 return set_option( str(LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS),
476 &global_settings.usemrb, INT, 517 &global_settings.usemrb, INT,
477 names, 3, NULL ); 518 names, 3, NULL );
@@ -486,23 +527,50 @@ static bool backlight_on_when_charging(void)
486 527
487static bool backlight_timer(void) 528static bool backlight_timer(void)
488{ 529{
489 char* names[] = { str(LANG_OFF), str(LANG_ON), 530 struct opt_items names[] = {
490 "1s ", "2s ", "3s ", "4s ", "5s ", 531 { STR(LANG_OFF) },
491 "6s ", "7s ", "8s ", "9s ", "10s", 532 { STR(LANG_ON) },
492 "15s", "20s", "25s", "30s", "45s", 533 { "1s ", -1 },
493 "60s", "90s"}; 534 { "2s ", -1 },
494 535 { "3s ", -1 },
536 { "4s ", -1 },
537 { "5s ", -1 },
538 { "6s ", -1 },
539 { "7s ", -1 },
540 { "8s ", -1 },
541 { "9s ", -1 },
542 { "10s", -1 },
543 { "15s", -1 },
544 { "20s", -1 },
545 { "25s", -1 },
546 { "30s", -1 },
547 { "45s", -1 },
548 { "60s", -1 },
549 { "90s", -1 }
550 };
495 return set_option(str(LANG_BACKLIGHT), &global_settings.backlight_timeout, 551 return set_option(str(LANG_BACKLIGHT), &global_settings.backlight_timeout,
496 INT, names, 19, backlight_set_timeout ); 552 INT, names, 19, backlight_set_timeout );
497} 553}
498 554
499static bool poweroff_idle_timer(void) 555static bool poweroff_idle_timer(void)
500{ 556{
501 char* names[] = { str(LANG_OFF), 557 struct opt_items names[] = {
502 "1m ", "2m ", "3m ", "4m ", "5m ", 558 { STR(LANG_OFF) },
503 "6m ", "7m ", "8m ", "9m ", "10m", 559 { "1m ", -1 },
504 "15m", "30m", "45m", "60m"}; 560 { "2m ", -1 },
505 561 { "3m ", -1 },
562 { "4m ", -1 },
563 { "5m ", -1 },
564 { "6m ", -1 },
565 { "7m ", -1 },
566 { "8m ", -1 },
567 { "9m ", -1 },
568 { "10m", -1 },
569 { "15m", -1 },
570 { "30m", -1 },
571 { "45m", -1 },
572 { "60m", -1 }
573 };
506 return set_option(str(LANG_POWEROFF_IDLE), &global_settings.poweroff, 574 return set_option(str(LANG_POWEROFF_IDLE), &global_settings.poweroff,
507 INT, names, 15, set_poweroff_timeout); 575 INT, names, 15, set_poweroff_timeout);
508} 576}
@@ -541,8 +609,14 @@ static bool bidir_limit(void)
541#ifdef HAVE_LCD_CHARCELLS 609#ifdef HAVE_LCD_CHARCELLS
542static bool jump_scroll(void) 610static bool jump_scroll(void)
543{ 611{
544 char* names[] = { str(LANG_OFF), str(LANG_ONE_TIME), "2", 612 struct opt_items names[] = {
545 "3", "4", str(LANG_ALWAYS)}; 613 { STR(LANG_OFF) },
614 { STR(LANG_ONE_TIME) },
615 { "2", -1 },
616 { "3", -1 },
617 { "4", -1 },
618 { STR(LANG_ALWAYS) }
619 };
546 bool ret; 620 bool ret;
547 ret=set_option(str(LANG_JUMP_SCROLL), &global_settings.jump_scroll, 621 ret=set_option(str(LANG_JUMP_SCROLL), &global_settings.jump_scroll,
548 INT, names, 6, lcd_jump_scroll); 622 INT, names, 6, lcd_jump_scroll);
@@ -667,9 +741,10 @@ static bool timedate_set(void)
667 741
668static bool timeformat_set(void) 742static bool timeformat_set(void)
669{ 743{
670 char* names[] = { str(LANG_24_HOUR_CLOCK), 744 struct opt_items names[] = {
671 str(LANG_12_HOUR_CLOCK) }; 745 { STR(LANG_24_HOUR_CLOCK) },
672 746 { STR(LANG_12_HOUR_CLOCK) }
747 };
673 return set_option(str(LANG_TIMEFORMAT), &global_settings.timeformat, 748 return set_option(str(LANG_TIMEFORMAT), &global_settings.timeformat,
674 INT, names, 2, NULL); 749 INT, names, 2, NULL);
675} 750}
@@ -722,11 +797,22 @@ static bool buffer_margin(void)
722 797
723static bool ff_rewind_min_step(void) 798static bool ff_rewind_min_step(void)
724{ 799{
725 char* names[] = { "1s", "2s", "3s", "4s", 800 struct opt_items names[] = {
726 "5s", "6s", "8s", "10s", 801 { "1s", -1 },
727 "15s", "20s", "25s", "30s", 802 { "2s", -1 },
728 "45s", "60s" }; 803 { "3s", -1 },
729 804 { "4s", -1 },
805 { "5s", -1 },
806 { "6s", -1 },
807 { "8s", -1 },
808 { "10s", -1 },
809 { "15s", -1 },
810 { "20s", -1 },
811 { "25s", -1 },
812 { "30s", -1 },
813 { "45s", -1 },
814 { "60s", -1 }
815 };
730 return set_option(str(LANG_FFRW_STEP), &global_settings.ff_rewind_min_step, 816 return set_option(str(LANG_FFRW_STEP), &global_settings.ff_rewind_min_step,
731 INT, names, 14, NULL ); 817 INT, names, 14, NULL );
732} 818}
@@ -739,11 +825,24 @@ static bool set_fade_on_stop(void)
739 825
740static bool ff_rewind_accel(void) 826static bool ff_rewind_accel(void)
741{ 827{
742 char* names[] = { str(LANG_OFF), "2x/1s", "2x/2s", "2x/3s", 828 struct opt_items names[] = {
743 "2x/4s", "2x/5s", "2x/6s", "2x/7s", 829 { STR(LANG_OFF) },
744 "2x/8s", "2x/9s", "2x/10s", "2x/11s", 830 { "2x/1s", -1 },
745 "2x/12s", "2x/13s", "2x/14s", "2x/15s", }; 831 { "2x/2s", -1 },
746 832 { "2x/3s", -1 },
833 { "2x/4s", -1 },
834 { "2x/5s", -1 },
835 { "2x/6s", -1 },
836 { "2x/7s", -1 },
837 { "2x/8s", -1 },
838 { "2x/9s", -1 },
839 { "2x/10s", -1 },
840 { "2x/11s", -1 },
841 { "2x/12s", -1 },
842 { "2x/13s", -1 },
843 { "2x/14s", -1 },
844 { "2x/15s", -1 }
845 };
747 return set_option(str(LANG_FFRW_ACCEL), &global_settings.ff_rewind_accel, 846 return set_option(str(LANG_FFRW_ACCEL), &global_settings.ff_rewind_accel,
748 INT, names, 16, NULL ); 847 INT, names, 16, NULL );
749} 848}
diff --git a/apps/sound_menu.c b/apps/sound_menu.c
index e0415cd293..34904e0aa0 100644
--- a/apps/sound_menu.c
+++ b/apps/sound_menu.c
@@ -181,15 +181,23 @@ static void set_avc(int val)
181 181
182static bool avc(void) 182static bool avc(void)
183{ 183{
184 char* names[] = { str(LANG_OFF), "2s", "4s", "8s" }; 184 struct opt_items names[] = {
185 { STR(LANG_OFF) },
186 { "2s", -1 },
187 { "4s", -1 },
188 { "8s", -1 }
189 };
185 return set_option(str(LANG_DECAY), &global_settings.avc, INT, 190 return set_option(str(LANG_DECAY), &global_settings.avc, INT,
186 names, 4, set_avc); 191 names, 4, set_avc);
187} 192}
188 193
189static bool recsource(void) 194static bool recsource(void)
190{ 195{
191 char *names[] = {str(LANG_RECORDING_SRC_MIC), str(LANG_RECORDING_SRC_LINE), 196 struct opt_items names[] = {
192 str(LANG_RECORDING_SRC_DIGITAL) }; 197 { STR(LANG_RECORDING_SRC_MIC) },
198 { STR(LANG_RECORDING_SRC_LINE) },
199 { STR(LANG_RECORDING_SRC_DIGITAL) }
200 };
193 return set_option(str(LANG_RECORDING_SOURCE), 201 return set_option(str(LANG_RECORDING_SOURCE),
194 &global_settings.rec_source, INT, 202 &global_settings.rec_source, INT,
195 names, 3, NULL ); 203 names, 3, NULL );
@@ -197,9 +205,14 @@ static bool recsource(void)
197 205
198static bool recfrequency(void) 206static bool recfrequency(void)
199{ 207{
200 char *names[] = {"44.1kHz", "48kHz", "32kHz", 208 struct opt_items names[] = {
201 "22.05kHz", "24kHz", "16kHz"}; 209 { "44.1kHz", -1 },
202 210 { "48kHz", -1 },
211 { "32kHz", -1 },
212 { "22.05kHz", -1 },
213 { "24kHz", -1 },
214 { "16kHz", -1 }
215 };
203 return set_option(str(LANG_RECORDING_FREQUENCY), 216 return set_option(str(LANG_RECORDING_FREQUENCY),
204 &global_settings.rec_frequency, INT, 217 &global_settings.rec_frequency, INT,
205 names, 6, NULL ); 218 names, 6, NULL );
@@ -207,8 +220,10 @@ static bool recfrequency(void)
207 220
208static bool recchannels(void) 221static bool recchannels(void)
209{ 222{
210 char *names[] = {str(LANG_CHANNEL_STEREO), str(LANG_CHANNEL_MONO)}; 223 struct opt_items names[] = {
211 224 { STR(LANG_CHANNEL_STEREO) },
225 { STR(LANG_CHANNEL_MONO) }
226 };
212 return set_option(str(LANG_RECORDING_CHANNELS), 227 return set_option(str(LANG_RECORDING_CHANNELS),
213 &global_settings.rec_channels, INT, 228 &global_settings.rec_channels, INT,
214 names, 2, NULL ); 229 names, 2, NULL );
@@ -229,13 +244,22 @@ static bool receditable(void)
229 244
230static bool rectimesplit(void) 245static bool rectimesplit(void)
231{ 246{
232 char *names[] = { 247 struct opt_items names[] = {
233 str(LANG_OFF), "00:05","00:10","00:15", 248 { STR(LANG_OFF) },
234 "00:30","01:00","02:00","04:00", 249 { "00:05" , -1 },
235 "06:00","08:00","10:00","12:00", 250 { "00:10" , -1 },
236 "18:00","24:00" 251 { "00:15" , -1 },
252 { "00:30" , -1 },
253 { "01:00" , -1 },
254 { "02:00" , -1 },
255 { "04:00" , -1 },
256 { "06:00" , -1 },
257 { "08:00" , -1 },
258 { "10:00" , -1 },
259 { "12:00" , -1 },
260 { "18:00" , -1 },
261 { "24:00" , -1 }
237 }; 262 };
238
239 return set_option(str(LANG_RECORD_TIMESPLIT), 263 return set_option(str(LANG_RECORD_TIMESPLIT),
240 &global_settings.rec_timesplit, INT, 264 &global_settings.rec_timesplit, INT,
241 names, 14, NULL ); 265 names, 14, NULL );
@@ -243,13 +267,39 @@ static bool rectimesplit(void)
243 267
244static bool recprerecord(void) 268static bool recprerecord(void)
245{ 269{
246 char *names[] = { 270 struct opt_items names[] = {
247 str(LANG_OFF),"1s","2s", "3s", "4s", "5s", "6s", "7s", "8s", "9s", 271 { STR(LANG_OFF) },
248 "10s", "11s", "12s", "13s", "14s", "15s", "16s", "17s", "18s", "19s", 272 { "1s", -1 },
249 "20s", "21s", "22s", "23s", "24s", "25s", "26s", "27s", "28s", "29s", 273 { "2s", -1 },
250 "30s" 274 { "3s", -1 },
275 { "4s", -1 },
276 { "5s", -1 },
277 { "6s", -1 },
278 { "7s", -1 },
279 { "8s", -1 },
280 { "9s", -1 },
281 { "10s", -1 },
282 { "11s", -1 },
283 { "12s", -1 },
284 { "13s", -1 },
285 { "14s", -1 },
286 { "15s", -1 },
287 { "16s", -1 },
288 { "17s", -1 },
289 { "18s", -1 },
290 { "19s", -1 },
291 { "10s", -1 },
292 { "21s", -1 },
293 { "22s", -1 },
294 { "23s", -1 },
295 { "24s", -1 },
296 { "25s", -1 },
297 { "26s", -1 },
298 { "27s", -1 },
299 { "28s", -1 },
300 { "29s", -1 },
301 { "30s", -1 }
251 }; 302 };
252
253 return set_option(str(LANG_RECORD_PRERECORD_TIME), 303 return set_option(str(LANG_RECORD_PRERECORD_TIME),
254 &global_settings.rec_prerecord_time, INT, 304 &global_settings.rec_prerecord_time, INT,
255 names, 31, NULL ); 305 names, 31, NULL );
@@ -257,10 +307,10 @@ static bool recprerecord(void)
257 307
258static bool recdirectory(void) 308static bool recdirectory(void)
259{ 309{
260 char *names[] = { 310 struct opt_items names[] = {
261 rec_base_directory, str(LANG_RECORD_CURRENT_DIR) 311 { rec_base_directory, -1 },
312 { STR(LANG_RECORD_CURRENT_DIR) }
262 }; 313 };
263
264 return set_option(str(LANG_RECORD_DIRECTORY), 314 return set_option(str(LANG_RECORD_DIRECTORY),
265 &global_settings.rec_directory, INT, 315 &global_settings.rec_directory, INT,
266 names, 2, NULL ); 316 names, 2, NULL );
@@ -275,16 +325,18 @@ static void set_chanconf(int val)
275 325
276static bool chanconf(void) 326static bool chanconf(void)
277{ 327{
278 char *names[] = { 328 struct opt_items names[] = {
279 str(LANG_CHANNEL_STEREO), 329 { STR(LANG_CHANNEL_STEREO) },
280#ifdef HAVE_LCD_CHARCELLS 330#ifdef HAVE_LCD_CHARCELLS
281 str(LANG_CHANNEL_STEREO_NARROW_PLAYER), 331 { STR(LANG_CHANNEL_STEREO_NARROW_PLAYER) },
282#else 332#else
283 str(LANG_CHANNEL_STEREO_NARROW_RECORDER), 333 { STR(LANG_CHANNEL_STEREO_NARROW_RECORDER) },
284#endif 334#endif
285 str(LANG_CHANNEL_MONO), 335 { STR(LANG_CHANNEL_MONO) },
286 str(LANG_CHANNEL_LEFT), str(LANG_CHANNEL_RIGHT), 336 { STR(LANG_CHANNEL_LEFT) },
287 str(LANG_CHANNEL_KARAOKE), str(LANG_CHANNEL_STEREO_WIDE) 337 { STR(LANG_CHANNEL_RIGHT) },
338 { STR(LANG_CHANNEL_KARAOKE) },
339 { STR(LANG_CHANNEL_STEREO_WIDE) }
288 }; 340 };
289 return set_option(str(LANG_CHANNEL), &global_settings.channel_config, INT, 341 return set_option(str(LANG_CHANNEL), &global_settings.channel_config, INT,
290 names, 7, set_chanconf ); 342 names, 7, set_chanconf );