summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/splash.c2
-rw-r--r--apps/talk.c3
-rw-r--r--apps/talk.h20
3 files changed, 20 insertions, 5 deletions
diff --git a/apps/gui/splash.c b/apps/gui/splash.c
index 94d9ef6a5c..c690777cc6 100644
--- a/apps/gui/splash.c
+++ b/apps/gui/splash.c
@@ -200,12 +200,14 @@ void gui_syncsplash(int ticks, const unsigned char *fmt, ...)
200{ 200{
201 va_list ap; 201 va_list ap;
202 int i; 202 int i;
203#if !defined(SIMULATOR) || CONFIG_CODEC == SWCODEC
203 long id; 204 long id;
204 /* fmt may be a so called virtual pointer. See settings.h. */ 205 /* fmt may be a so called virtual pointer. See settings.h. */
205 if((id = P2ID(fmt)) >= 0) 206 if((id = P2ID(fmt)) >= 0)
206 /* If fmt specifies a voicefont ID, and voice menus are 207 /* If fmt specifies a voicefont ID, and voice menus are
207 enabled, then speak it. */ 208 enabled, then speak it. */
208 cond_talk_ids_fq(id); 209 cond_talk_ids_fq(id);
210#endif
209 /* If fmt is a lang ID then get the corresponding string (which 211 /* If fmt is a lang ID then get the corresponding string (which
210 still might contain % place holders). */ 212 still might contain % place holders). */
211 fmt = P2STR(fmt); 213 fmt = P2STR(fmt);
diff --git a/apps/talk.c b/apps/talk.c
index 3b7ab2a03f..e1bf6cbc5c 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -139,7 +139,8 @@ static void mp3_callback(unsigned char** start, size_t* size);
139static int queue_clip(unsigned char* buf, long size, bool enqueue); 139static int queue_clip(unsigned char* buf, long size, bool enqueue);
140static int open_voicefile(void); 140static int open_voicefile(void);
141static unsigned char* get_clip(long id, long* p_size); 141static unsigned char* get_clip(long id, long* p_size);
142 142static int shutup(void); /* Interrupt voice, as when enqueue is false */
143static int do_shutup(void); /* kill voice unconditionally */
143 144
144/***************** Private implementation *****************/ 145/***************** Private implementation *****************/
145 146
diff --git a/apps/talk.h b/apps/talk.h
index d471ec7ca8..5374ae9b20 100644
--- a/apps/talk.h
+++ b/apps/talk.h
@@ -66,8 +66,6 @@ bool talk_voice_required(void); /* returns true if voice codec required */
66int talk_get_bufsize(void); /* get the loaded voice file size */ 66int talk_get_bufsize(void); /* get the loaded voice file size */
67/* talk_buffer_steal - on SWCODEC, for use by buffer functions only */ 67/* talk_buffer_steal - on SWCODEC, for use by buffer functions only */
68int talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */ 68int talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */
69//int shutup(void); /* Interrupt voice, as when enqueue is false */
70//int do_shutup(void); /* kill voice unconditionally */
71bool is_voice_queued(void); /* Are there more voice clips to be spoken? */ 69bool 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 */ 70int 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 */ 71int talk_file(const char* filename, bool enqueue); /* play a thumbnail from file */
@@ -78,14 +76,27 @@ bool talk_menus_enabled(void); /* returns true if menus should be voiced */
78void talk_disable_menus(void); /* disable voice menus (temporarily, not persisted) */ 76void talk_disable_menus(void); /* disable voice menus (temporarily, not persisted) */
79void talk_enable_menus(void); /* re-enable voice menus */ 77void talk_enable_menus(void); /* re-enable voice menus */
80 78
79
80
81
82/* This (otherwise invalid) ID signals the end of the array. */
83#define TALK_FINAL_ID LANG_LAST_INDEX_IN_ARRAY
84
85/* We don't build talk.c for hwcodec sims so we need to define these as empty */
86#if defined(SIMULATOR) && !(CONFIG_CODEC == SWCODEC)
87#define talk_force_enqueue_next(...)
88#define talk_idarray(...)
89#define talk_ids(...)
90#define cond_talk_ids(...)
91#define cond_talk_ids_fq(...)
92#else
93
81/* Enqueue next utterance even if enqueue parameter is false: don't 94/* Enqueue next utterance even if enqueue parameter is false: don't
82 interrupt the current utterance. */ 95 interrupt the current utterance. */
83void talk_force_enqueue_next(void); 96void talk_force_enqueue_next(void);
84 97
85/* speaks one or more IDs (from an array)). */ 98/* speaks one or more IDs (from an array)). */
86int talk_idarray(long *idarray, bool enqueue); 99int talk_idarray(long *idarray, bool enqueue);
87/* This (otherwise invalid) ID signals the end of the array. */
88#define TALK_FINAL_ID LANG_LAST_INDEX_IN_ARRAY
89/* This makes an initializer for the array of IDs and takes care to 100/* This makes an initializer for the array of IDs and takes care to
90 put the final sentinel element at the end. */ 101 put the final sentinel element at the end. */
91#define TALK_IDARRAY(ids...) ((long[]){ids,TALK_FINAL_ID}) 102#define TALK_IDARRAY(ids...) ((long[]){ids,TALK_FINAL_ID})
@@ -110,4 +121,5 @@ int talk_idarray(long *idarray, bool enqueue);
110 talk_force_enqueue_next(); \ 121 talk_force_enqueue_next(); \
111 } \ 122 } \
112 }while(0) 123 }while(0)
124#endif /*defined(SIMULATOR) && !(CONFIG_CODEC == SWCODEC)*/
113#endif /* __TALK_H__ */ 125#endif /* __TALK_H__ */