diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-08-22 05:16:10 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-08-22 05:16:10 +0000 |
commit | 94381ebc30ff784fbc987d164554310602880b87 (patch) | |
tree | 1b2e3579b61cf168ce8723a43061107ff8ed4a50 | |
parent | ec6ca5ae9489c3fefee7d3ab59a93fead3513e84 (diff) | |
download | rockbox-94381ebc30ff784fbc987d164554310602880b87.tar.gz rockbox-94381ebc30ff784fbc987d164554310602880b87.zip |
Simplified 12 hour time voicing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14425 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/menus/main_menu.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 6c828ce1be..022fb9b7e7 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c | |||
@@ -211,22 +211,18 @@ static bool show_info(void) | |||
211 | talk_id(VOICE_CURRENT_TIME, true); | 211 | talk_id(VOICE_CURRENT_TIME, true); |
212 | if (global_settings.timeformat == 1) | 212 | if (global_settings.timeformat == 1) |
213 | { | 213 | { |
214 | /* Voice the time in 12 hour format */ | 214 | bool pm = false; |
215 | if (tm->tm_hour == 0) | 215 | int hour = tm->tm_hour; |
216 | |||
217 | if (hour >= 12) | ||
216 | { | 218 | { |
217 | /* Make it say 12 am instead of 0 am */ | 219 | pm = true; |
218 | talk_value(12, UNIT_INT, true); | 220 | hour -= 12; |
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 | } | 221 | } |
222 | if (hour == 0) | ||
223 | hour = 12; | ||
224 | |||
225 | talk_value(hour, UNIT_INT, true); | ||
230 | 226 | ||
231 | /* Voice the minutes */ | 227 | /* Voice the minutes */ |
232 | if (tm->tm_min == 0) | 228 | if (tm->tm_min == 0) |
@@ -239,15 +235,7 @@ static bool show_info(void) | |||
239 | talk_value(tm->tm_min, UNIT_INT, true); | 235 | talk_value(tm->tm_min, UNIT_INT, true); |
240 | } | 236 | } |
241 | 237 | ||
242 | /* Voice the suffix */ | 238 | talk_id(pm ? VOICE_PM : VOICE_AM, true); |
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 | } | 239 | } |
252 | else | 240 | else |
253 | { | 241 | { |