diff options
author | Steve Bavin <pondlife@pondlife.me> | 2007-10-24 12:32:12 +0000 |
---|---|---|
committer | Steve Bavin <pondlife@pondlife.me> | 2007-10-24 12:32:12 +0000 |
commit | 072a3c5017e4d97a0d8bc56b71d1a8b100784ef7 (patch) | |
tree | 879e85636ba10520bbd0cdd20389f87d1b335dbe /apps/talk.c | |
parent | 537b27d58f382277e239bbefaab3bb48a8df245e (diff) | |
download | rockbox-072a3c5017e4d97a0d8bc56b71d1a8b100784ef7.tar.gz rockbox-072a3c5017e4d97a0d8bc56b71d1a8b100784ef7.zip |
Complete info screen voicing; now consistent with displayed screen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15284 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/talk.c')
-rw-r--r-- | apps/talk.c | 99 |
1 files changed, 47 insertions, 52 deletions
diff --git a/apps/talk.c b/apps/talk.c index ede0aff66b..0c8fafbe59 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -848,66 +848,61 @@ void talk_disable(bool disable) | |||
848 | } | 848 | } |
849 | 849 | ||
850 | #if CONFIG_RTC | 850 | #if CONFIG_RTC |
851 | void talk_date_time(struct tm *tm, bool speak_current_time_string) | 851 | void talk_date(struct tm *tm, bool enqueue) |
852 | { | 852 | { |
853 | if(global_settings.talk_menu) | 853 | talk_id(LANG_MONTH_JANUARY + tm->tm_mon, enqueue); |
854 | talk_number(tm->tm_mday, true); | ||
855 | talk_number(1900 + tm->tm_year, true); | ||
856 | } | ||
857 | |||
858 | void talk_time(struct tm *tm, bool enqueue) | ||
859 | { | ||
860 | if (global_settings.timeformat == 1) | ||
854 | { | 861 | { |
855 | if(speak_current_time_string) | 862 | /* Voice the hour */ |
856 | talk_id(VOICE_CURRENT_TIME, true); | 863 | long am_pm_id = VOICE_AM; |
857 | if (global_settings.timeformat == 1) | 864 | int hour = tm->tm_hour; |
865 | if (hour >= 12) | ||
858 | { | 866 | { |
859 | long am_pm_id = VOICE_AM; | 867 | am_pm_id = VOICE_PM; |
860 | int hour = tm->tm_hour; | 868 | hour -= 12; |
861 | 869 | } | |
862 | if (hour >= 12) | 870 | if (hour == 0) |
863 | { | 871 | hour = 12; |
864 | am_pm_id = VOICE_PM; | 872 | talk_number(hour, enqueue); |
865 | hour -= 12; | ||
866 | } | ||
867 | if (hour == 0) | ||
868 | hour = 12; | ||
869 | |||
870 | talk_number(hour, true); | ||
871 | 873 | ||
872 | /* Voice the minutes */ | 874 | /* Voice the minutes */ |
873 | if (tm->tm_min == 0) | 875 | if (tm->tm_min == 0) |
874 | { | 876 | { |
875 | /* Say o'clock if the minute is 0. */ | 877 | /* Say o'clock if the minute is 0. */ |
876 | talk_id(VOICE_OCLOCK, true); | 878 | talk_id(VOICE_OCLOCK, true); |
877 | } | ||
878 | else | ||
879 | { | ||
880 | /* Pronounce the leading 0 */ | ||
881 | if(tm->tm_min < 10) | ||
882 | { | ||
883 | talk_id(VOICE_OH, true); | ||
884 | } | ||
885 | talk_number(tm->tm_min, true); | ||
886 | } | ||
887 | talk_id(am_pm_id, true); | ||
888 | } | 879 | } |
889 | else | 880 | else |
890 | { | 881 | { |
891 | /* Voice the time in 24 hour format */ | 882 | /* Pronounce the leading 0 */ |
892 | talk_number(tm->tm_hour, true); | 883 | if(tm->tm_min < 10) |
893 | if (tm->tm_min == 0) | 884 | talk_id(VOICE_OH, true); |
894 | { | 885 | talk_number(tm->tm_min, true); |
895 | talk_id(VOICE_HUNDRED, true); | 886 | } |
896 | talk_id(VOICE_HOUR, true); | 887 | talk_id(am_pm_id, true); |
897 | } | 888 | } |
898 | else | 889 | else |
899 | { | 890 | { |
900 | /* Pronounce the leading 0 */ | 891 | /* Voice the time in 24 hour format */ |
901 | if(tm->tm_min < 10) | 892 | talk_number(tm->tm_hour, enqueue); |
902 | { | 893 | if (tm->tm_min == 0) |
903 | talk_id(VOICE_OH, true); | 894 | { |
904 | } | 895 | talk_id(VOICE_HUNDRED, true); |
905 | talk_number(tm->tm_min, true); | 896 | talk_id(VOICE_HOUR, true); |
906 | } | 897 | } |
898 | else | ||
899 | { | ||
900 | /* Pronounce the leading 0 */ | ||
901 | if(tm->tm_min < 10) | ||
902 | talk_id(VOICE_OH, true); | ||
903 | talk_number(tm->tm_min, true); | ||
907 | } | 904 | } |
908 | talk_id(LANG_MONTH_JANUARY + tm->tm_mon, true); | ||
909 | talk_number(tm->tm_mday, true); | ||
910 | talk_number(1900 + tm->tm_year, true); | ||
911 | } | 905 | } |
912 | } | 906 | } |
907 | |||
913 | #endif | 908 | #endif |