summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJonas Häggqvist <rasher@rasher.dk>2007-08-21 22:54:57 +0000
committerJonas Häggqvist <rasher@rasher.dk>2007-08-21 22:54:57 +0000
commit496206be6e71169bcbb6516c435c604c5ae91948 (patch)
tree1f7ab9128bc2bb2511e36ed259fd977aad02be26 /apps
parent167564b1431d61ebd629835796f31471ec3b6b58 (diff)
downloadrockbox-496206be6e71169bcbb6516c435c604c5ae91948.tar.gz
rockbox-496206be6e71169bcbb6516c435c604c5ae91948.zip
Voice the time in the format the user selects in the time format setting. Patch FS#7561 by Daniel Dalton.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14418 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/lang/english.lang51
-rw-r--r--apps/menus/main_menu.c49
2 files changed, 97 insertions, 3 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 9c656fba69..29e2d1df79 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -11054,3 +11054,54 @@
11054 *: "units per tick" 11054 *: "units per tick"
11055 </voice> 11055 </voice>
11056</phrase> 11056</phrase>
11057<phrase>
11058 id: VOICE_OCLOCK
11059 desc: spoken only, for wall clock announce
11060 user:
11061 <source>
11062 *: none
11063 rtc: ""
11064 </source>
11065 <dest>
11066 *: none
11067 rtc: ""
11068 </dest>
11069 <voice>
11070 *: none
11071 rtc: "o'clock"
11072 </voice>
11073</phrase>
11074<phrase>
11075 id: VOICE_PM
11076 desc: spoken only, for wall clock announce
11077 user:
11078 <source>
11079 *: none
11080 rtc: ""
11081 </source>
11082 <dest>
11083 *: none
11084 rtc: ""
11085 </dest>
11086 <voice>
11087 *: none
11088 rtc: "P M"
11089 </voice>
11090</phrase>
11091<phrase>
11092 id: VOICE_AM
11093 desc: spoken only, for wall clock announce
11094 user:
11095 <source>
11096 *: none
11097 rtc: ""
11098 </source>
11099 <dest>
11100 *: none
11101 rtc: ""
11102 </dest>
11103 <voice>
11104 *: none
11105 rtc: "A M"
11106 </voice>
11107</phrase>
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 1ae5774d15..6c828ce1be 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -209,9 +209,52 @@ static bool show_info(void)
209 { 209 {
210 struct tm* tm = get_time(); 210 struct tm* tm = get_time();
211 talk_id(VOICE_CURRENT_TIME, true); 211 talk_id(VOICE_CURRENT_TIME, true);
212 talk_value(tm->tm_hour, UNIT_HOUR, true); 212 if (global_settings.timeformat == 1)
213 talk_value(tm->tm_min, UNIT_MIN, true); 213 {
214 talk_value(tm->tm_sec, UNIT_SEC, true); 214 /* Voice the time in 12 hour format */
215 if (tm->tm_hour == 0)
216 {
217 /* Make it say 12 am instead of 0 am */
218 talk_value(12, UNIT_INT, true);
219 }
220 else if (tm->tm_hour <= 12)
221 {
222 /* If between 0 and 12, we voice the hour as-is */
223 talk_value(tm->tm_hour, UNIT_INT, true);
224 }
225 else
226 {
227 /* Subtract 12 hours if we're past noon */
228 talk_value(tm->tm_hour-12, UNIT_INT, true);
229 }
230
231 /* Voice the minutes */
232 if (tm->tm_min == 0)
233 {
234 /*say o'clock if the minute is 0. */
235 talk_id(VOICE_OCLOCK, true);
236 }
237 else
238 {
239 talk_value(tm->tm_min, UNIT_INT, true);
240 }
241
242 /* Voice the suffix */
243 if (tm->tm_hour >= 12)
244 {
245 talk_id(VOICE_PM, true);
246 }
247 else
248 {
249 talk_id(VOICE_AM, true);
250 }
251 }
252 else
253 {
254 /*voice the time in 24 hour format*/
255 talk_value(tm->tm_hour, UNIT_HOUR, true);
256 talk_value(tm->tm_min, UNIT_MIN, true);
257 }
215 talk_id(LANG_MONTH_JANUARY + tm->tm_mon, true); 258 talk_id(LANG_MONTH_JANUARY + tm->tm_mon, true);
216 talk_number(tm->tm_mday, true); 259 talk_number(tm->tm_mday, true);
217 talk_number(1900 + tm->tm_year, true); 260 talk_number(1900 + tm->tm_year, true);