summaryrefslogtreecommitdiff
path: root/apps/talk.h
diff options
context:
space:
mode:
authorSteve Bavin <pondlife@pondlife.me>2007-10-19 15:31:42 +0000
committerSteve Bavin <pondlife@pondlife.me>2007-10-19 15:31:42 +0000
commit32a95751301a4aa5f51ea76b7eb3764d197dd6e3 (patch)
tree860d5e0c767cc53d038bb72ff19c237215dd3eee /apps/talk.h
parent877ea486bad40bde6f8b969acc8af50f244884c0 (diff)
downloadrockbox-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.h21
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);
66bool talk_voice_required(void); /* returns true if voice codec required */ 66bool talk_voice_required(void); /* returns true if voice codec required */
67#endif 67#endif
68int talk_get_bufsize(void); /* get the loaded voice file size */ 68int talk_get_bufsize(void); /* get the loaded voice file size */
69/* talk_buffer_steal - on SWCODEC, for use by buffer functions only */ 69void talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */
70int talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */
71bool is_voice_queued(void); /* Are there more voice clips to be spoken? */ 70bool is_voice_queued(void); /* Are there more voice clips to be spoken? */
72int talk_id(long id, bool enqueue); /* play a voice ID from voicefont */ 71int talk_id(long id, bool enqueue); /* play a voice ID from voicefont */
73int talk_file(const char* filename, bool enqueue); /* play a thumbnail from file */ 72int talk_file(const char* filename, bool enqueue); /* play a thumbnail from file */
74int talk_number(long n, bool enqueue); /* say a number */ 73int talk_number(long n, bool enqueue); /* say a number */
75int talk_value(long n, int unit, bool enqueue); /* say a numeric value */ 74int talk_value(long n, int unit, bool enqueue); /* say a numeric value */
76int talk_spell(const char* spell, bool enqueue); /* spell a string */ 75int talk_spell(const char* spell, bool enqueue); /* spell a string */
77bool talk_menus_enabled(void); /* returns true if menus should be voiced */ 76void talk_disable(bool disable); /* temporarily disable (or re-enable) talking (temporarily, not persisted) */
78void talk_disable_menus(void); /* disable voice menus (temporarily, not persisted) */ 77void talk_force_shutup(void); /* kill voice unconditionally */
79void talk_enable_menus(void); /* re-enable voice menus */ 78void talk_shutup(void); /* Interrupt voice, as when enqueue is false */
80int do_shutup(void); /* kill voice unconditionally */
81int 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 } \