diff options
author | Steve Bavin <pondlife@pondlife.me> | 2007-06-11 08:28:38 +0000 |
---|---|---|
committer | Steve Bavin <pondlife@pondlife.me> | 2007-06-11 08:28:38 +0000 |
commit | 24d9f59c784ab07241b51851a2683ea1c90e89e2 (patch) | |
tree | 5a9140a80bd279870a5e6d6aa4e6f0d9797eb24f /apps/talk.c | |
parent | 0fba85fe9ee8775aed331e4a9f60d91ac78ade9c (diff) | |
download | rockbox-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.c | 18 |
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 */ | |||
127 | static unsigned long voicefile_size = 0; /* size of the loaded voice file */ | 127 | static unsigned long voicefile_size = 0; /* size of the loaded voice file */ |
128 | static unsigned char last_lang[MAX_FILENAME+1]; /* name of last used lang file (in talk_init) */ | 128 | static unsigned char last_lang[MAX_FILENAME+1]; /* name of last used lang file (in talk_init) */ |
129 | static bool talk_initialized; /* true if talk_init has been called */ | 129 | static bool talk_initialized; /* true if talk_init has been called */ |
130 | static int talk_menu_disable; /* if non-zero, temporarily disable voice UI (not saved) */ | ||
130 | 131 | ||
131 | /***************** Private prototypes *****************/ | 132 | /***************** Private prototypes *****************/ |
132 | 133 | ||
@@ -498,6 +499,7 @@ static void reset_state(void) | |||
498 | 499 | ||
499 | void talk_init(void) | 500 | void talk_init(void) |
500 | { | 501 | { |
502 | talk_menu_disable = 0; | ||
501 | if (talk_initialized && !strcasecmp(last_lang, global_settings.lang_file)) | 503 | if (talk_initialized && !strcasecmp(last_lang, global_settings.lang_file)) |
502 | { | 504 | { |
503 | /* not a new file, nothing to do */ | 505 | /* not a new file, nothing to do */ |
@@ -819,3 +821,19 @@ int talk_spell(const char* spell, bool enqueue) | |||
819 | 821 | ||
820 | return 0; | 822 | return 0; |
821 | } | 823 | } |
824 | |||
825 | bool talk_menus_enabled(void) | ||
826 | { | ||
827 | return (global_settings.talk_menu && talk_menu_disable == 0); | ||
828 | } | ||
829 | |||
830 | |||
831 | void talk_disable_menus(void) | ||
832 | { | ||
833 | talk_menu_disable++; | ||
834 | } | ||
835 | |||
836 | void talk_enable_menus(void) | ||
837 | { | ||
838 | talk_menu_disable--; | ||
839 | } | ||