summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2008-08-02 21:32:48 +0000
committerBertrik Sikken <bertrik@sikken.nl>2008-08-02 21:32:48 +0000
commit7a4c33358122e73afc06ea1d417365f06445aefb (patch)
treeb3f0ef90a358ec634f138a6fe8be030cb1f596a3
parent02103a2fa701954e42c8081fccf75eea26f52ce8 (diff)
downloadrockbox-7a4c33358122e73afc06ea1d417365f06445aefb.tar.gz
rockbox-7a4c33358122e73afc06ea1d417365f06445aefb.zip
Fix voicing of incorrect run time (top time instead of run time). Simplify runtime callback a bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18186 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/screens.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/apps/screens.c b/apps/screens.c
index 8560dadf23..af81e5a907 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -844,16 +844,17 @@ bool browse_id3(void)
844static char* runtime_get_data(int selected_item, void* data, 844static char* runtime_get_data(int selected_item, void* data,
845 char* buffer, size_t buffer_len) 845 char* buffer, size_t buffer_len)
846{ 846{
847 (void)data; 847 (void)data;
848 unsigned char *headers[] = {str(LANG_RUNNING_TIME), str(LANG_TOP_TIME) };
849 int t; 848 int t;
850 if(!(selected_item%2)) 849 switch (selected_item)
851 return headers[selected_item/2]; 850 {
852 851 case 0: return str(LANG_RUNNING_TIME);
853 if(selected_item/2) 852 case 1: t = global_status.runtime; break;
854 t = global_status.topruntime; 853 case 2: return str(LANG_TOP_TIME);
855 854 case 3: t = global_status.topruntime; break;
856 else t = global_status.runtime; 855 default:
856 return "";
857 }
857 858
858 snprintf(buffer, buffer_len, "%dh %dm %ds", 859 snprintf(buffer, buffer_len, "%dh %dm %ds",
859 t / 3600, (t % 3600) / 60, t % 60); 860 t / 3600, (t % 3600) / 60, t % 60);
@@ -863,10 +864,9 @@ static char* runtime_get_data(int selected_item, void* data,
863static int runtime_speak_data(int selected_item, void* data) 864static int runtime_speak_data(int selected_item, void* data)
864{ 865{
865 (void) data; 866 (void) data;
866 long title_ids[] = {LANG_RUNNING_TIME, LANG_TOP_TIME};
867 talk_ids(false, 867 talk_ids(false,
868 title_ids[selected_item/2], 868 (selected_item < 2) ? LANG_RUNNING_TIME : LANG_TOP_TIME,
869 TALK_ID((selected_item == 0) ? global_status.runtime 869 TALK_ID((selected_item < 2) ? global_status.runtime
870 : global_status.topruntime, UNIT_TIME)); 870 : global_status.topruntime, UNIT_TIME));
871 return 0; 871 return 0;
872} 872}