summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSt├ęphane Doyon <s.doyon@videotron.ca>2007-11-07 03:58:13 +0000
committerSt├ęphane Doyon <s.doyon@videotron.ca>2007-11-07 03:58:13 +0000
commit22e3d5694030a919402a77c31178a60ce3839194 (patch)
treeda35523d048110cc3f56fd249295e6b879fc2b70
parenta4f491cac1f17dd338ba6d4c39537f5223c988ec (diff)
downloadrockbox-22e3d5694030a919402a77c31178a60ce3839194.tar.gz
rockbox-22e3d5694030a919402a77c31178a60ce3839194.zip
Accept FS#7777: Voice for the "Running Time" screen
(slightly simplified). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15509 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/screens.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/apps/screens.c b/apps/screens.c
index 564a9d9db0..8b23fe3201 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -1284,10 +1284,21 @@ static char* runtime_get_data(int selected_item, void* data, char* buffer)
}
+static int runtime_speak_data(int selected_item, void* data)
+{
+ (void) data;
+ long title_ids[] = {LANG_RUNNING_TIME, LANG_TOP_TIME};
+ talk_ids(false,
+ title_ids[selected_item/2],
+ TALK_ID((selected_item == 0) ? global_status.runtime
+ : global_status.topruntime, UNIT_TIME));
+ return 0;
+}
+
bool view_runtime(void)
{
- unsigned char *lines[]={str(LANG_CLEAR_TIME)};
+ unsigned char *lines[]={ID2P(LANG_CLEAR_TIME)};
struct text_message message={(char **)lines, 1};
struct gui_synclist lists;
@@ -1298,8 +1309,11 @@ bool view_runtime(void)
#else
gui_synclist_set_title(&lists, NULL, NOICON);
#endif
+ if(global_settings.talk_menu)
+ gui_synclist_set_voice_callback(&lists, runtime_speak_data);
gui_synclist_set_icon_callback(&lists, NULL);
gui_synclist_set_nb_items(&lists, 4);
+ gui_synclist_speak_item(&lists);
while(1)
{
#if CONFIG_CHARGING
@@ -1319,8 +1333,8 @@ bool view_runtime(void)
lasttime = current_tick;
gui_synclist_draw(&lists);
gui_syncstatusbar_draw(&statusbars, true);
- action = get_action(CONTEXT_STD, HZ);
- gui_synclist_do_button(&lists, &action, LIST_WRAP_UNLESS_HELD);
+ list_do_action(CONTEXT_STD, HZ,
+ &lists, &action, LIST_WRAP_UNLESS_HELD);
if(action == ACTION_STD_CANCEL)
break;
if(action == ACTION_STD_OK) {
@@ -1330,6 +1344,7 @@ bool view_runtime(void)
global_status.runtime = 0;
else
global_status.topruntime = 0;
+ gui_synclist_speak_item(&lists);
}
}
if(default_event_handler(action) == SYS_USB_CONNECTED)