summaryrefslogtreecommitdiffstats
path: root/apps/talk.c
diff options
context:
space:
mode:
authorSteve Bavin <pondlife@pondlife.me>2007-06-11 08:28:38 +0000
committerSteve Bavin <pondlife@pondlife.me>2007-06-11 08:28:38 +0000
commit24d9f59c784ab07241b51851a2683ea1c90e89e2 (patch)
tree5a9140a80bd279870a5e6d6aa4e6f0d9797eb24f /apps/talk.c
parent0fba85fe9ee8775aed331e4a9f60d91ac78ade9c (diff)
downloadrockbox-24d9f59c784ab07241b51851a2683ea1c90e89e2.tar.gz
rockbox-24d9f59c784ab07241b51851a2683ea1c90e89e2.zip
When recording, disable voice menus without actually modifying user settings. Patch FS#7272, fixes bug FS #6163
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13615 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/talk.c')
-rw-r--r--apps/talk.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/talk.c b/apps/talk.c
index e9307f056f..1f1eefd51d 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -127,6 +127,7 @@ static unsigned char* p_lastclip; /* address of latest clip, for silence add */
static unsigned long voicefile_size = 0; /* size of the loaded voice file */
static unsigned char last_lang[MAX_FILENAME+1]; /* name of last used lang file (in talk_init) */
static bool talk_initialized; /* true if talk_init has been called */
+static int talk_menu_disable; /* if non-zero, temporarily disable voice UI (not saved) */
/***************** Private prototypes *****************/
@@ -498,6 +499,7 @@ static void reset_state(void)
void talk_init(void)
{
+ talk_menu_disable = 0;
if (talk_initialized && !strcasecmp(last_lang, global_settings.lang_file))
{
/* not a new file, nothing to do */
@@ -819,3 +821,19 @@ int talk_spell(const char* spell, bool enqueue)
return 0;
}
+
+bool talk_menus_enabled(void)
+{
+ return (global_settings.talk_menu && talk_menu_disable == 0);
+}
+
+
+void talk_disable_menus(void)
+{
+ talk_menu_disable++;
+}
+
+void talk_enable_menus(void)
+{
+ talk_menu_disable--;
+}