diff options
author | Steve Bavin <pondlife@pondlife.me> | 2007-10-19 15:31:42 +0000 |
---|---|---|
committer | Steve Bavin <pondlife@pondlife.me> | 2007-10-19 15:31:42 +0000 |
commit | 32a95751301a4aa5f51ea76b7eb3764d197dd6e3 (patch) | |
tree | 860d5e0c767cc53d038bb72ff19c237215dd3eee /apps/talk.h | |
parent | 877ea486bad40bde6f8b969acc8af50f244884c0 (diff) | |
download | rockbox-32a95751301a4aa5f51ea76b7eb3764d197dd6e3.tar.gz rockbox-32a95751301a4aa5f51ea76b7eb3764d197dd6e3.zip |
FS#7994 - Rename talk.c API, make talk_disable() affect all talking (not just menus), hopefully save some space.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15206 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/talk.h')
-rw-r--r-- | apps/talk.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/apps/talk.h b/apps/talk.h index e25a11c702..a939c1f3d1 100644 --- a/apps/talk.h +++ b/apps/talk.h | |||
@@ -66,19 +66,16 @@ void talk_init(void); | |||
66 | bool talk_voice_required(void); /* returns true if voice codec required */ | 66 | bool talk_voice_required(void); /* returns true if voice codec required */ |
67 | #endif | 67 | #endif |
68 | int talk_get_bufsize(void); /* get the loaded voice file size */ | 68 | int talk_get_bufsize(void); /* get the loaded voice file size */ |
69 | /* talk_buffer_steal - on SWCODEC, for use by buffer functions only */ | 69 | void talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */ |
70 | int talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */ | ||
71 | bool is_voice_queued(void); /* Are there more voice clips to be spoken? */ | 70 | bool is_voice_queued(void); /* Are there more voice clips to be spoken? */ |
72 | int talk_id(long id, bool enqueue); /* play a voice ID from voicefont */ | 71 | int talk_id(long id, bool enqueue); /* play a voice ID from voicefont */ |
73 | int talk_file(const char* filename, bool enqueue); /* play a thumbnail from file */ | 72 | int talk_file(const char* filename, bool enqueue); /* play a thumbnail from file */ |
74 | int talk_number(long n, bool enqueue); /* say a number */ | 73 | int talk_number(long n, bool enqueue); /* say a number */ |
75 | int talk_value(long n, int unit, bool enqueue); /* say a numeric value */ | 74 | int talk_value(long n, int unit, bool enqueue); /* say a numeric value */ |
76 | int talk_spell(const char* spell, bool enqueue); /* spell a string */ | 75 | int talk_spell(const char* spell, bool enqueue); /* spell a string */ |
77 | bool talk_menus_enabled(void); /* returns true if menus should be voiced */ | 76 | void talk_disable(bool disable); /* temporarily disable (or re-enable) talking (temporarily, not persisted) */ |
78 | void talk_disable_menus(void); /* disable voice menus (temporarily, not persisted) */ | 77 | void talk_force_shutup(void); /* kill voice unconditionally */ |
79 | void talk_enable_menus(void); /* re-enable voice menus */ | 78 | void talk_shutup(void); /* Interrupt voice, as when enqueue is false */ |
80 | int do_shutup(void); /* kill voice unconditionally */ | ||
81 | int shutup(void); /* Interrupt voice, as when enqueue is false */ | ||
82 | 79 | ||
83 | #if CONFIG_RTC | 80 | #if CONFIG_RTC |
84 | /* this is in talk.c which isnt compiled for hwcodec simulator */ | 81 | /* this is in talk.c which isnt compiled for hwcodec simulator */ |
@@ -94,12 +91,14 @@ void talk_date_time(struct tm *time, bool speak_current_time_string); | |||
94 | 91 | ||
95 | /* We don't build talk.c for hwcodec sims so we need to define these as empty */ | 92 | /* We don't build talk.c for hwcodec sims so we need to define these as empty */ |
96 | #if defined(SIMULATOR) && !(CONFIG_CODEC == SWCODEC) | 93 | #if defined(SIMULATOR) && !(CONFIG_CODEC == SWCODEC) |
94 | #define talk_init(...) | ||
95 | #define talk_buffer_steal(...) | ||
96 | #define talk_shutup(...) | ||
97 | #define talk_force_enqueue_next(...) | 97 | #define talk_force_enqueue_next(...) |
98 | #define talk_idarray(...) | 98 | #define talk_idarray(...) |
99 | #define talk_ids(...) | 99 | #define talk_ids(...) |
100 | #define cond_talk_ids(...) | 100 | #define cond_talk_ids(...) |
101 | #define cond_talk_ids_fq(...) | 101 | #define cond_talk_ids_fq(...) |
102 | #define shutup(...) | ||
103 | #else | 102 | #else |
104 | 103 | ||
105 | /* Enqueue next utterance even if enqueue parameter is false: don't | 104 | /* Enqueue next utterance even if enqueue parameter is false: don't |
@@ -116,18 +115,18 @@ int talk_idarray(long *idarray, bool enqueue); | |||
116 | /* This version talks only if talking menus are enabled, and does not | 115 | /* This version talks only if talking menus are enabled, and does not |
117 | enqueue the initial id. */ | 116 | enqueue the initial id. */ |
118 | #define cond_talk_ids(ids...) do { \ | 117 | #define cond_talk_ids(ids...) do { \ |
119 | if (talk_menus_enabled()) \ | 118 | if (global_settings.talk_menu) \ |
120 | talk_ids(false, ids); \ | 119 | talk_ids(false, ids); \ |
121 | } while(0) | 120 | } while(0) |
122 | /* And a version that takes the array parameter... */ | 121 | /* And a version that takes the array parameter... */ |
123 | #define cond_talk_idarray(idarray) do { \ | 122 | #define cond_talk_idarray(idarray) do { \ |
124 | if (talk_menus_enabled() \ | 123 | if (global_settings.talk_menu \ |
125 | talk_idarray(idarray, false); \ | 124 | talk_idarray(idarray, false); \ |
126 | } while(0) | 125 | } while(0) |
127 | /* Convenience macro to conditionally speak something and not have | 126 | /* Convenience macro to conditionally speak something and not have |
128 | it interrupted. */ | 127 | it interrupted. */ |
129 | #define cond_talk_ids_fq(ids...) do { \ | 128 | #define cond_talk_ids_fq(ids...) do { \ |
130 | if (talk_menus_enabled()) { \ | 129 | if (global_settings.talk_menu) { \ |
131 | talk_ids(false, ids); \ | 130 | talk_ids(false, ids); \ |
132 | talk_force_enqueue_next(); \ | 131 | talk_force_enqueue_next(); \ |
133 | } \ | 132 | } \ |