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)
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 {
bool (*function) (void); /* return true if USB was connected */
};
-/* convenience macro to have both string and ID as arguments */
-#define STR(id) str(id), id
-
int menu_init(struct menu_items* items, int count, int (*callback) (int keycode, int menu));
void menu_exit(int menu);
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)
static bool recurse_directory(void)
{
- char* names[] = { str(LANG_OFF),
- str(LANG_ON),
- str(LANG_RESUME_SETTING_ASK) };
+ struct opt_items names[] = {
+ { STR(LANG_OFF) },
+ { STR(LANG_ON) },
+ { STR(LANG_RESUME_SETTING_ASK)},
+ };
return set_option( str(LANG_RECURSE_DIRECTORY),
&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)
/* How to display a track */
static bool track_display(void)
{
- char* names[] = {
- str(LANG_DISPLAY_TRACK_NAME_ONLY),
- str(LANG_DISPLAY_FULL_PATH)
+ struct opt_items names[] = {
+ { STR(LANG_DISPLAY_TRACK_NAME_ONLY) },
+ { STR(LANG_DISPLAY_FULL_PATH) }
};
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 @@
#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
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 @@
#define FF_REWIND_45000 12
#define FF_REWIND_60000 13
+/* convenience macro to have both string and ID as arguments */
+#define STR(id) str(id), id
+
struct user_settings
{
@@ -203,6 +206,11 @@ struct user_settings
enum optiontype { INT, BOOL };
+struct opt_items {
+ char* string;
+ int voice_id;
+};
+
/* prototypes */
int settings_save(void);
@@ -215,11 +223,13 @@ void settings_display(void);
bool settings_load_config(char* file);
bool settings_save_config(void);
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));
bool set_bool(char* string, bool* variable );
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 set_int(char* string, char* unit, int* variable,
void (*function)(int), int step, int min, int max );
bool 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)
{
return set_bool_options( str(LANG_CAR_ADAPTER_MODE),
&global_settings.car_adapter_mode,
- str(LANG_SET_BOOL_YES),
- str(LANG_SET_BOOL_NO),
+ STR(LANG_SET_BOOL_YES),
+ STR(LANG_SET_BOOL_NO),
set_car_adapter_mode);
}
@@ -92,8 +92,8 @@ static bool invert(void)
{
bool rc = set_bool_options(str(LANG_INVERT),
&global_settings.invert,
- str(LANG_INVERT_LCD_INVERSE),
- str(LANG_INVERT_LCD_NORMAL),
+ STR(LANG_INVERT_LCD_INVERSE),
+ STR(LANG_INVERT_LCD_NORMAL),
lcd_set_invert_display);
return rc;
}
@@ -105,8 +105,8 @@ static bool invert_cursor(void)
{
return set_bool_options(str(LANG_INVERT_CURSOR),
&global_settings.invert_cursor,
- str(LANG_INVERT_CURSOR_BAR),
- str(LANG_INVERT_CURSOR_POINTER),
+ STR(LANG_INVERT_CURSOR_BAR),
+ STR(LANG_INVERT_CURSOR_POINTER),
NULL);
}
@@ -129,9 +129,10 @@ static bool flip_display(void)
*/
static bool battery_type(void)
{
- char* names[] = { str(LANG_DISPLAY_GRAPHIC),
- str(LANG_DISPLAY_NUMERIC) };
-
+ struct opt_items names[] = {
+ { STR(LANG_DISPLAY_GRAPHIC) },
+ { STR(LANG_DISPLAY_NUMERIC) }
+ };
return set_option( str(LANG_BATTERY_DISPLAY),
&global_settings.battery_type, INT, names, 2, NULL);
}
@@ -141,9 +142,10 @@ static bool battery_type(void)
*/
static bool volume_type(void)
{
- char* names[] = { str(LANG_DISPLAY_GRAPHIC),
- str(LANG_DISPLAY_NUMERIC) };
-
+ struct opt_items names[] = {
+ { STR(LANG_DISPLAY_GRAPHIC) },
+ { STR(LANG_DISPLAY_NUMERIC) }
+ };
return set_option( str(LANG_VOLUME_DISPLAY), &global_settings.volume_type,
INT, names, 2, NULL);
}
@@ -163,11 +165,25 @@ static bool peak_meter_fps_menu(void) {
*/
static bool peak_meter_hold(void) {
bool retval = false;
- char* names[] = { str(LANG_OFF),
- "200 ms ", "300 ms ", "500 ms ", "1 s ", "2 s ",
- "3 s ", "4 s ", "5 s ", "6 s ", "7 s",
- "8 s", "9 s", "10 s", "15 s", "20 s",
- "30 s", "1 min"
+ struct opt_items names[] = {
+ { STR(LANG_OFF) },
+ { "200 ms " , -1 },
+ { "300 ms " , -1 },
+ { "500 ms " , -1 },
+ { "1 s " , -1 },
+ { "2 s " , -1 },
+ { "3 s " , -1 },
+ { "4 s " , -1 },
+ { "5 s " , -1 },
+ { "6 s " , -1 },
+ { "7 s" , -1 },
+ { "8 s" , -1 },
+ { "9 s" , -1 },
+ { "10 s" , -1 },
+ { "15 s" , -1 },
+ { "20 s" , -1 },
+ { "30 s" , -1 },
+ { "1 min" , -1 }
};
retval = set_option( str(LANG_PM_PEAK_HOLD),
&global_settings.peak_meter_hold, INT, names,
@@ -186,14 +202,33 @@ static bool peak_meter_hold(void) {
static bool peak_meter_clip_hold(void) {
bool retval = false;
- char* names[] = { str(LANG_PM_ETERNAL),
- "1s ", "2s ", "3s ", "4s ", "5s ",
- "6s ", "7s ", "8s ", "9s ", "10s",
- "15s", "20s", "25s", "30s", "45s",
- "60s", "90s", "2min", "3min", "5min",
- "10min", "20min", "45min", "90min"
+ struct opt_items names[] = {
+ { STR(LANG_PM_ETERNAL) },
+ { "1s " , -1 },
+ { "2s " , -1 },
+ { "3s " , -1 },
+ { "4s " , -1 },
+ { "5s " , -1 },
+ { "6s " , -1 },
+ { "7s " , -1 },
+ { "8s " , -1 },
+ { "9s " , -1 },
+ { "10s" , -1 },
+ { "15s" , -1 },
+ { "20s" , -1 },
+ { "25s" , -1 },
+ { "30s" , -1 },
+ { "45s" , -1 },
+ { "60s" , -1 },
+ { "90s" , -1 },
+ { "2min" , -1 },
+ { "3min" , -1 },
+ { "5min" , -1 },
+ { "10min" , -1 },
+ { "20min" , -1 },
+ { "45min" , -1 },
+ { "90min" , -1 }
};
-
retval = set_option( str(LANG_PM_CLIP_HOLD),
&global_settings.peak_meter_clip_hold, INT, names,
25, peak_meter_set_clip_hold);
@@ -235,7 +270,7 @@ static bool peak_meter_scale(void) {
bool use_dbfs = global_settings.peak_meter_dbfs;
retval = set_bool_options(str(LANG_PM_SCALE),
&use_dbfs,
- str(LANG_PM_DBFS), str(LANG_PM_LINEAR),
+ STR(LANG_PM_DBFS), STR(LANG_PM_LINEAR),
NULL);
/* has the user really changed the scale? */
@@ -348,7 +383,7 @@ static bool peak_meter_performance(void) {
bool retval = false;
retval = set_bool_options(str(LANG_PM_PERFORMANCE),
&global_settings.peak_meter_performance,
- str(LANG_PM_HIGH_PERFORMANCE), str(LANG_PM_ENERGY_SAVER),
+ STR(LANG_PM_HIGH_PERFORMANCE), STR(LANG_PM_ENERGY_SAVER),
NULL);
if (global_settings.peak_meter_performance) {
@@ -395,10 +430,11 @@ static bool shuffle(void)
static bool repeat_mode(void)
{
bool result;
- char* names[] = { str(LANG_OFF),
- str(LANG_REPEAT_ALL),
- str(LANG_REPEAT_ONE) };
-
+ struct opt_items names[] = {
+ { STR(LANG_OFF) },
+ { STR(LANG_REPEAT_ALL) },
+ { STR(LANG_REPEAT_ONE) }
+ };
int old_repeat = global_settings.repeat_mode;
result = set_option( str(LANG_REPEAT), &global_settings.repeat_mode,
@@ -417,11 +453,12 @@ static bool play_selected(void)
static bool dir_filter(void)
{
- char* names[] = { str(LANG_FILTER_ALL),
- str(LANG_FILTER_SUPPORTED),
- str(LANG_FILTER_MUSIC),
- str(LANG_FILTER_PLAYLIST) };
-
+ struct opt_items names[] = {
+ { STR(LANG_FILTER_ALL) },
+ { STR(LANG_FILTER_SUPPORTED) },
+ { STR(LANG_FILTER_MUSIC) },
+ { STR(LANG_FILTER_PLAYLIST) }
+ };
return set_option( str(LANG_FILTER), &global_settings.dirfilter, INT,
names, 4, NULL );
}
@@ -433,23 +470,25 @@ static bool sort_case(void)
static bool resume(void)
{
- char* names[] = { str(LANG_SET_BOOL_NO),
- str(LANG_RESUME_SETTING_ASK),
- str(LANG_RESUME_SETTING_ASK_ONCE),
- str(LANG_SET_BOOL_YES) };
-
+ struct opt_items names[] = {
+ { STR(LANG_SET_BOOL_NO) },
+ { STR(LANG_RESUME_SETTING_ASK) },
+ { STR(LANG_RESUME_SETTING_ASK_ONCE) },
+ { STR(LANG_SET_BOOL_YES) }
+ };
return set_option( str(LANG_RESUME), &global_settings.resume, INT,
names, 4, NULL );
}
static bool autocreatebookmark(void)
{
- char* names[] = { str(LANG_SET_BOOL_NO),
- str(LANG_SET_BOOL_YES),
- str(LANG_RESUME_SETTING_ASK),
- str(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_YES),
- str(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_ASK) };
-
+ struct opt_items names[] = {
+ { STR(LANG_SET_BOOL_NO) },
+ { STR(LANG_SET_BOOL_YES) },
+ { STR(LANG_RESUME_SETTING_ASK) },
+ { STR(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_YES) },
+ { STR(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_ASK) }
+ };
return set_option( str(LANG_BOOKMARK_SETTINGS_AUTOCREATE),
&global_settings.autocreatebookmark, INT,
names, 5, NULL );
@@ -457,10 +496,11 @@ static bool autocreatebookmark(void)
static bool autoloadbookmark(void)
{
- char* names[] = { str(LANG_SET_BOOL_NO),
- str(LANG_SET_BOOL_YES),
- str(LANG_RESUME_SETTING_ASK) };
-
+ struct opt_items names[] = {
+ { STR(LANG_SET_BOOL_NO) },
+ { STR(LANG_SET_BOOL_YES) },
+ { STR(LANG_RESUME_SETTING_ASK) }
+ };
return set_option( str(LANG_BOOKMARK_SETTINGS_AUTOLOAD),
&global_settings.autoloadbookmark, INT,
names, 3, NULL );
@@ -468,10 +508,11 @@ static bool autoloadbookmark(void)
static bool useMRB(void)
{
- char* names[] = { str(LANG_SET_BOOL_NO),
- str(LANG_SET_BOOL_YES),
- str(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY)};
-
+ struct opt_items names[] = {
+ { STR(LANG_SET_BOOL_NO) },
+ { STR(LANG_SET_BOOL_YES) },
+ { STR(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY) }
+ };
return set_option( str(LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS),
&global_settings.usemrb, INT,
names, 3, NULL );
@@ -486,23 +527,50 @@ static bool backlight_on_when_charging(void)
static bool backlight_timer(void)
{
- char* names[] = { str(LANG_OFF), str(LANG_ON),
- "1s ", "2s ", "3s ", "4s ", "5s ",
- "6s ", "7s ", "8s ", "9s ", "10s",
- "15s", "20s", "25s", "30s", "45s",
- "60s", "90s"};
-
+ struct opt_items names[] = {
+ { STR(LANG_OFF) },
+ { STR(LANG_ON) },
+ { "1s ", -1 },
+ { "2s ", -1 },
+ { "3s ", -1 },
+ { "4s ", -1 },
+ { "5s ", -1 },
+ { "6s ", -1 },
+ { "7s ", -1 },
+ { "8s ", -1 },
+ { "9s ", -1 },
+ { "10s", -1 },
+ { "15s", -1 },
+ { "20s", -1 },
+ { "25s", -1 },
+ { "30s", -1 },
+ { "45s", -1 },
+ { "60s", -1 },
+ { "90s", -1 }
+ };
return set_option(str(LANG_BACKLIGHT), &global_settings.backlight_timeout,
INT, names, 19, backlight_set_timeout );
}
static bool poweroff_idle_timer(void)
{
- char* names[] = { str(LANG_OFF),
- "1m ", "2m ", "3m ", "4m ", "5m ",
- "6m ", "7m ", "8m ", "9m ", "10m",
- "15m", "30m", "45m", "60m"};
-
+ struct opt_items names[] = {
+ { STR(LANG_OFF) },
+ { "1m ", -1 },
+ { "2m ", -1 },
+ { "3m ", -1 },
+ { "4m ", -1 },
+ { "5m ", -1 },
+ { "6m ", -1 },
+ { "7m ", -1 },
+ { "8m ", -1 },
+ { "9m ", -1 },
+ { "10m", -1 },
+ { "15m", -1 },
+ { "30m", -1 },
+ { "45m", -1 },
+ { "60m", -1 }
+ };
return set_option(str(LANG_POWEROFF_IDLE), &global_settings.poweroff,
INT, names, 15, set_poweroff_timeout);
}
@@ -541,8 +609,14 @@ static bool bidir_limit(void)
#ifdef HAVE_LCD_CHARCELLS
static bool jump_scroll(void)
{
- char* names[] = { str(LANG_OFF), str(LANG_ONE_TIME), "2",
- "3", "4", str(LANG_ALWAYS)};
+ struct opt_items names[] = {
+ { STR(LANG_OFF) },
+ { STR(LANG_ONE_TIME) },
+ { "2", -1 },
+ { "3", -1 },
+ { "4", -1 },
+ { STR(LANG_ALWAYS) }
+ };
bool ret;
ret=set_option(str(LANG_JUMP_SCROLL), &global_settings.jump_scroll,
INT, names, 6, lcd_jump_scroll);
@@ -667,9 +741,10 @@ static bool timedate_set(void)
static bool timeformat_set(void)
{
- char* names[] = { str(LANG_24_HOUR_CLOCK),
- str(LANG_12_HOUR_CLOCK) };
-
+ struct opt_items names[] = {
+ { STR(LANG_24_HOUR_CLOCK) },
+ { STR(LANG_12_HOUR_CLOCK) }
+ };
return set_option(str(LANG_TIMEFORMAT), &global_settings.timeformat,
INT, names, 2, NULL);
}
@@ -722,11 +797,22 @@ static bool buffer_margin(void)
static bool ff_rewind_min_step(void)
{
- char* names[] = { "1s", "2s", "3s", "4s",
- "5s", "6s", "8s", "10s",
- "15s", "20s", "25s", "30s",
- "45s", "60s" };
-
+ struct opt_items names[] = {
+ { "1s", -1 },
+ { "2s", -1 },
+ { "3s", -1 },
+ { "4s", -1 },
+ { "5s", -1 },
+ { "6s", -1 },
+ { "8s", -1 },
+ { "10s", -1 },
+ { "15s", -1 },
+ { "20s", -1 },
+ { "25s", -1 },
+ { "30s", -1 },
+ { "45s", -1 },
+ { "60s", -1 }
+ };
return set_option(str(LANG_FFRW_STEP), &global_settings.ff_rewind_min_step,
INT, names, 14, NULL );
}
@@ -739,11 +825,24 @@ static bool set_fade_on_stop(void)
static bool ff_rewind_accel(void)
{
- char* names[] = { str(LANG_OFF), "2x/1s", "2x/2s", "2x/3s",
- "2x/4s", "2x/5s", "2x/6s", "2x/7s",
- "2x/8s", "2x/9s", "2x/10s", "2x/11s",
- "2x/12s", "2x/13s", "2x/14s", "2x/15s", };
-
+ struct opt_items names[] = {
+ { STR(LANG_OFF) },
+ { "2x/1s", -1 },
+ { "2x/2s", -1 },
+ { "2x/3s", -1 },
+ { "2x/4s", -1 },
+ { "2x/5s", -1 },
+ { "2x/6s", -1 },
+ { "2x/7s", -1 },
+ { "2x/8s", -1 },
+ { "2x/9s", -1 },
+ { "2x/10s", -1 },
+ { "2x/11s", -1 },
+ { "2x/12s", -1 },
+ { "2x/13s", -1 },
+ { "2x/14s", -1 },
+ { "2x/15s", -1 }
+ };
return set_option(str(LANG_FFRW_ACCEL), &global_settings.ff_rewind_accel,
INT, names, 16, NULL );
}
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)
static bool avc(void)
{
- char* names[] = { str(LANG_OFF), "2s", "4s", "8s" };
+ struct opt_items names[] = {
+ { STR(LANG_OFF) },
+ { "2s", -1 },
+ { "4s", -1 },
+ { "8s", -1 }
+ };
return set_option(str(LANG_DECAY), &global_settings.avc, INT,
names, 4, set_avc);
}
static bool recsource(void)
{
- char *names[] = {str(LANG_RECORDING_SRC_MIC), str(LANG_RECORDING_SRC_LINE),
- str(LANG_RECORDING_SRC_DIGITAL) };
+ struct opt_items names[] = {
+ { STR(LANG_RECORDING_SRC_MIC) },
+ { STR(LANG_RECORDING_SRC_LINE) },
+ { STR(LANG_RECORDING_SRC_DIGITAL) }
+ };
return set_option(str(LANG_RECORDING_SOURCE),
&global_settings.rec_source, INT,
names, 3, NULL );
@@ -197,9 +205,14 @@ static bool recsource(void)
static bool recfrequency(void)
{
- char *names[] = {"44.1kHz", "48kHz", "32kHz",
- "22.05kHz", "24kHz", "16kHz"};
-
+ struct opt_items names[] = {
+ { "44.1kHz", -1 },
+ { "48kHz", -1 },
+ { "32kHz", -1 },
+ { "22.05kHz", -1 },
+ { "24kHz", -1 },
+ { "16kHz", -1 }
+ };
return set_option(str(LANG_RECORDING_FREQUENCY),
&global_settings.rec_frequency, INT,
names, 6, NULL );
@@ -207,8 +220,10 @@ static bool recfrequency(void)
static bool recchannels(void)
{
- char *names[] = {str(LANG_CHANNEL_STEREO), str(LANG_CHANNEL_MONO)};
-
+ struct opt_items names[] = {
+ { STR(LANG_CHANNEL_STEREO) },
+ { STR(LANG_CHANNEL_MONO) }
+ };
return set_option(str(LANG_RECORDING_CHANNELS),
&global_settings.rec_channels, INT,
names, 2, NULL );
@@ -229,13 +244,22 @@ static bool receditable(void)
static bool rectimesplit(void)
{
- char *names[] = {
- str(LANG_OFF), "00:05","00:10","00:15",
- "00:30","01:00","02:00","04:00",
- "06:00","08:00","10:00","12:00",
- "18:00","24:00"
+ struct opt_items names[] = {
+ { STR(LANG_OFF) },
+ { "00:05" , -1 },
+ { "00:10" , -1 },
+ { "00:15" , -1 },
+ { "00:30" , -1 },
+ { "01:00" , -1 },
+ { "02:00" , -1 },
+ { "04:00" , -1 },
+ { "06:00" , -1 },
+ { "08:00" , -1 },
+ { "10:00" , -1 },
+ { "12:00" , -1 },
+ { "18:00" , -1 },
+ { "24:00" , -1 }
};
-
return set_option(str(LANG_RECORD_TIMESPLIT),
&global_settings.rec_timesplit, INT,
names, 14, NULL );
@@ -243,13 +267,39 @@ static bool rectimesplit(void)
static bool recprerecord(void)
{
- char *names[] = {
- str(LANG_OFF),"1s","2s", "3s", "4s", "5s", "6s", "7s", "8s", "9s",
- "10s", "11s", "12s", "13s", "14s", "15s", "16s", "17s", "18s", "19s",
- "20s", "21s", "22s", "23s", "24s", "25s", "26s", "27s", "28s", "29s",
- "30s"
+ struct opt_items names[] = {
+ { STR(LANG_OFF) },
+ { "1s", -1 },
+ { "2s", -1 },
+ { "3s", -1 },
+ { "4s", -1 },
+ { "5s", -1 },
+ { "6s", -1 },
+ { "7s", -1 },
+ { "8s", -1 },
+ { "9s", -1 },
+ { "10s", -1 },
+ { "11s", -1 },
+ { "12s", -1 },
+ { "13s", -1 },
+ { "14s", -1 },
+ { "15s", -1 },
+ { "16s", -1 },
+ { "17s", -1 },
+ { "18s", -1 },
+ { "19s", -1 },
+ { "10s", -1 },
+ { "21s", -1 },
+ { "22s", -1 },
+ { "23s", -1 },
+ { "24s", -1 },
+ { "25s", -1 },
+ { "26s", -1 },
+ { "27s", -1 },
+ { "28s", -1 },
+ { "29s", -1 },
+ { "30s", -1 }
};
-
return set_option(str(LANG_RECORD_PRERECORD_TIME),
&global_settings.rec_prerecord_time, INT,
names, 31, NULL );
@@ -257,10 +307,10 @@ static bool recprerecord(void)
static bool recdirectory(void)
{
- char *names[] = {
- rec_base_directory, str(LANG_RECORD_CURRENT_DIR)
+ struct opt_items names[] = {
+ { rec_base_directory, -1 },
+ { STR(LANG_RECORD_CURRENT_DIR) }
};
-
return set_option(str(LANG_RECORD_DIRECTORY),
&global_settings.rec_directory, INT,
names, 2, NULL );
@@ -275,16 +325,18 @@ static void set_chanconf(int val)
static bool chanconf(void)
{
- char *names[] = {
- str(LANG_CHANNEL_STEREO),
+ struct opt_items names[] = {
+ { STR(LANG_CHANNEL_STEREO) },
#ifdef HAVE_LCD_CHARCELLS
- str(LANG_CHANNEL_STEREO_NARROW_PLAYER),
+ { STR(LANG_CHANNEL_STEREO_NARROW_PLAYER) },
#else
- str(LANG_CHANNEL_STEREO_NARROW_RECORDER),
+ { STR(LANG_CHANNEL_STEREO_NARROW_RECORDER) },
#endif
- str(LANG_CHANNEL_MONO),
- str(LANG_CHANNEL_LEFT), str(LANG_CHANNEL_RIGHT),
- str(LANG_CHANNEL_KARAOKE), str(LANG_CHANNEL_STEREO_WIDE)
+ { STR(LANG_CHANNEL_MONO) },
+ { STR(LANG_CHANNEL_LEFT) },
+ { STR(LANG_CHANNEL_RIGHT) },
+ { STR(LANG_CHANNEL_KARAOKE) },
+ { STR(LANG_CHANNEL_STEREO_WIDE) }
};
return set_option(str(LANG_CHANNEL), &global_settings.channel_config, INT,
names, 7, set_chanconf );