summaryrefslogtreecommitdiff
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)
1284 1284
1285} 1285}
1286 1286
1287static int runtime_speak_data(int selected_item, void* data)
1288{
1289 (void) data;
1290 long title_ids[] = {LANG_RUNNING_TIME, LANG_TOP_TIME};
1291 talk_ids(false,
1292 title_ids[selected_item/2],
1293 TALK_ID((selected_item == 0) ? global_status.runtime
1294 : global_status.topruntime, UNIT_TIME));
1295 return 0;
1296}
1297
1287 1298
1288bool view_runtime(void) 1299bool view_runtime(void)
1289{ 1300{
1290 unsigned char *lines[]={str(LANG_CLEAR_TIME)}; 1301 unsigned char *lines[]={ID2P(LANG_CLEAR_TIME)};
1291 struct text_message message={(char **)lines, 1}; 1302 struct text_message message={(char **)lines, 1};
1292 1303
1293 struct gui_synclist lists; 1304 struct gui_synclist lists;
@@ -1298,8 +1309,11 @@ bool view_runtime(void)
1298#else 1309#else
1299 gui_synclist_set_title(&lists, NULL, NOICON); 1310 gui_synclist_set_title(&lists, NULL, NOICON);
1300#endif 1311#endif
1312 if(global_settings.talk_menu)
1313 gui_synclist_set_voice_callback(&lists, runtime_speak_data);
1301 gui_synclist_set_icon_callback(&lists, NULL); 1314 gui_synclist_set_icon_callback(&lists, NULL);
1302 gui_synclist_set_nb_items(&lists, 4); 1315 gui_synclist_set_nb_items(&lists, 4);
1316 gui_synclist_speak_item(&lists);
1303 while(1) 1317 while(1)
1304 { 1318 {
1305#if CONFIG_CHARGING 1319#if CONFIG_CHARGING
@@ -1319,8 +1333,8 @@ bool view_runtime(void)
1319 lasttime = current_tick; 1333 lasttime = current_tick;
1320 gui_synclist_draw(&lists); 1334 gui_synclist_draw(&lists);
1321 gui_syncstatusbar_draw(&statusbars, true); 1335 gui_syncstatusbar_draw(&statusbars, true);
1322 action = get_action(CONTEXT_STD, HZ); 1336 list_do_action(CONTEXT_STD, HZ,
1323 gui_synclist_do_button(&lists, &action, LIST_WRAP_UNLESS_HELD); 1337 &lists, &action, LIST_WRAP_UNLESS_HELD);
1324 if(action == ACTION_STD_CANCEL) 1338 if(action == ACTION_STD_CANCEL)
1325 break; 1339 break;
1326 if(action == ACTION_STD_OK) { 1340 if(action == ACTION_STD_OK) {
@@ -1330,6 +1344,7 @@ bool view_runtime(void)
1330 global_status.runtime = 0; 1344 global_status.runtime = 0;
1331 else 1345 else
1332 global_status.topruntime = 0; 1346 global_status.topruntime = 0;
1347 gui_synclist_speak_item(&lists);
1333 } 1348 }
1334 } 1349 }
1335 if(default_event_handler(action) == SYS_USB_CONNECTED) 1350 if(default_event_handler(action) == SYS_USB_CONNECTED)