summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Bavin <pondlife@pondlife.me>2007-06-07 09:24:53 +0000
committerSteve Bavin <pondlife@pondlife.me>2007-06-07 09:24:53 +0000
commit6fd10bacceb576ee39e7ecfa32510ae8c97815ba (patch)
treed7a55ab832c6943fb469c34bd85d15e0fc7e2f2c
parent44034055500509b3b2b85b6df66172abbf77399c (diff)
downloadrockbox-6fd10bacceb576ee39e7ecfa32510ae8c97815ba.zip
rockbox-6fd10bacceb576ee39e7ecfa32510ae8c97815ba.tar.gz
rockbox-6fd10bacceb576ee39e7ecfa32510ae8c97815ba.tar.bz2
rockbox-6fd10bacceb576ee39e7ecfa32510ae8c97815ba.tar.xz
Separate out voice options for .talk clips (FS #7249). This removes the assumptions about what to speak if a .talk clip is not available for a particular file or directory,
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13584 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/lang/english.lang32
-rw-r--r--apps/menus/settings_menu.c20
-rw-r--r--apps/settings.h6
-rw-r--r--apps/settings_list.c14
-rw-r--r--apps/talk.c4
-rw-r--r--apps/tree.c59
6 files changed, 87 insertions, 48 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 19e369c..8f5291d 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -2535,7 +2535,7 @@
</phrase>
<phrase>
id: LANG_VOICE_DIR
- desc: item of voice menu, set the "talkbox" mode for directories
+ desc: item of voice menu, set the voice mode for directories
user:
<source>
*: "Voice Directories"
@@ -2549,7 +2549,7 @@
</phrase>
<phrase>
id: LANG_VOICE_FILE
- desc: item of voice menu, set the voive mode for files
+ desc: item of voice menu, set the voice mode for files
user:
<source>
*: "Voice Filenames"
@@ -10978,3 +10978,31 @@
*: "List Acceleration Speed"
</voice>
</phrase>
+<phrase>
+ id: LANG_VOICE_DIR_TALK
+ desc: Item of voice menu, whether to use directory .talk clips
+ user:
+ <source>
+ *: "Use Directory .talk Clips"
+ </source>
+ <dest>
+ *: "Use Directory .talk Clips"
+ </dest>
+ <voice>
+ *: "Use Directory .talk Clips"
+ </voice>
+</phrase>
+<phrase>
+ id: LANG_VOICE_FILE_TALK
+ desc: Item of voice menu, whether to use file .talk clips
+ user:
+ <source>
+ *: "Use File .talk Clips"
+ </source>
+ <dest>
+ *: "Use File .talk Clips"
+ </dest>
+ <voice>
+ *: "Use File .talk Clips"
+ </voice>
+</phrase>
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 6d96282..a11a7f0 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -397,25 +397,28 @@ MAKE_MENU(bookmark_settings_menu, ID2P(LANG_BOOKMARK_SETTINGS), 0,
/***********************************/
/* VOICE MENU */
static int talk_callback(int action,const struct menu_item_ex *this_item);
-MENUITEM_SETTING(talk_menu, &global_settings.talk_menu, NULL);
-MENUITEM_SETTING(talk_dir, &global_settings.talk_dir, talk_callback);
-MENUITEM_SETTING(talk_file_item, &global_settings.talk_file, talk_callback);
+MENUITEM_SETTING(talk_menu_item, &global_settings.talk_menu, NULL);
+MENUITEM_SETTING(talk_dir_item, &global_settings.talk_dir, NULL);
+MENUITEM_SETTING(talk_dir_clip_item, &global_settings.talk_dir_clip, talk_callback);
+MENUITEM_SETTING(talk_file_item, &global_settings.talk_file, NULL);
+MENUITEM_SETTING(talk_file_clip_item, &global_settings.talk_file_clip, talk_callback);
static int talk_callback(int action,const struct menu_item_ex *this_item)
{
static int oldval = 0;
switch (action)
{
case ACTION_ENTER_MENUITEM:
- oldval = global_settings.talk_file;
+ oldval = global_settings.talk_file_clip;
break;
case ACTION_EXIT_MENUITEM:
#if CONFIG_CODEC == SWCODEC
audio_set_crossfade(global_settings.crossfade);
#endif
- if (this_item == &talk_dir)
+ if (this_item == &talk_dir_clip_item)
break;
- if (oldval != 3 && global_settings.talk_file == 3)
- { /* force reload if newly talking thumbnails,
+ if (!oldval && global_settings.talk_file_clip)
+ {
+ /* force reload if newly talking thumbnails,
because the clip presence is cached only if enabled */
reload_directory();
}
@@ -424,7 +427,8 @@ static int talk_callback(int action,const struct menu_item_ex *this_item)
return action;
}
MAKE_MENU(voice_settings_menu, ID2P(LANG_VOICE), 0, Icon_Voice,
- &talk_menu, &talk_dir, &talk_file_item);
+ &talk_menu_item, &talk_dir_item, &talk_dir_clip_item,
+ &talk_file_item, &talk_file_clip_item);
/* VOICE MENU */
/***********************************/
diff --git a/apps/settings.h b/apps/settings.h
index b9c67dc..4761ba4 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -524,8 +524,10 @@ struct user_settings
/* voice UI settings */
bool talk_menu; /* enable voice UI */
- int talk_dir; /* talkbox mode: 0=off 1=number 2=clip@enter 3=clip@hover */
- int talk_file; /* voice filename mode: 0=off, 1=number, other t.b.d. */
+ int talk_dir; /* voiced directories mode: 0=off 1=number 2=spell */
+ bool talk_dir_clip; /* use directory .talk clips */
+ int talk_file; /* voice file mode: 0=off, 1=number, 2=spell */
+ bool talk_file_clip; /* use file .talk clips */
/* file browser sorting */
int sort_file; /* 0=alpha, 1=date, 2=date (new first), 3=type */
diff --git a/apps/settings_list.c b/apps/settings_list.c
index f91cacf..91c4cab 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -50,7 +50,7 @@
/* some sets of values which are used more than once, to save memory */
static const char off_on[] = "off,on";
static const char off_on_ask[] = "off,on,ask";
-static const char off_number_spell_hover[] = "off,number,spell,hover";
+static const char off_number_spell[] = "off,number,spell";
#ifdef HAVE_LCD_BITMAP
static const char graphic_numeric[] = "graphic,numeric";
#endif
@@ -708,15 +708,17 @@ const struct settings_list settings[] = {
OFFON_SETTING(0,line_in,LANG_LINE_IN,false,"line in",NULL),
#endif
/* voice */
+ OFFON_SETTING(F_TEMPVAR, talk_menu, LANG_VOICE_MENU, true, "talk menu", NULL),
CHOICE_SETTING(0, talk_dir, LANG_VOICE_DIR, 0,
- "talk dir", off_number_spell_hover, NULL, 4,
+ "talk dir", off_number_spell, NULL, 3,
ID2P(LANG_OFF), ID2P(LANG_VOICE_NUMBER),
- ID2P(LANG_VOICE_SPELL), ID2P(LANG_VOICE_DIR_HOVER)),
+ ID2P(LANG_VOICE_SPELL)),
+ OFFON_SETTING(F_TEMPVAR, talk_dir_clip, LANG_VOICE_DIR_TALK, false, "talk dir clip", NULL),
CHOICE_SETTING(0, talk_file, LANG_VOICE_FILE, 0,
- "talk file", off_number_spell_hover, NULL, 4,
+ "talk file", off_number_spell, NULL, 3,
ID2P(LANG_OFF), ID2P(LANG_VOICE_NUMBER),
- ID2P(LANG_VOICE_SPELL), ID2P(LANG_VOICE_DIR_HOVER)),
- OFFON_SETTING(F_TEMPVAR, talk_menu, LANG_VOICE_MENU, true, "talk menu", NULL),
+ ID2P(LANG_VOICE_SPELL)),
+ OFFON_SETTING(F_TEMPVAR, talk_file_clip, LANG_VOICE_FILE_TALK, false, "talk file clip", NULL),
/* file sorting */
CHOICE_SETTING(0, sort_file, LANG_SORT_FILE, 0 ,
diff --git a/apps/talk.c b/apps/talk.c
index 04e3739..e9307f0 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -539,8 +539,8 @@ void talk_init(void)
bool talk_voice_required(void)
{
return (voicefile_size != 0) /* Voice file is available */
- || (global_settings.talk_dir == 3) /* Thumbnail clips are required */
- || (global_settings.talk_file == 3);
+ || (global_settings.talk_dir_clip) /* Thumbnail clips are required */
+ || (global_settings.talk_file_clip);
}
#endif
diff --git a/apps/tree.c b/apps/tree.c
index 8875cb9..53aca47 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -722,9 +722,19 @@ static int dirbrowse()
DEBUGF("Playing directory thumbnail: %s", currdir);
res = ft_play_dirname(name);
if (res < 0) /* failed, not existing */
- { /* say the number instead, as a fallback */
- talk_id(VOICE_DIR, false);
- talk_number(lasti+1, true);
+ {
+ /* say the number or spell if required as a fallback */
+ switch (global_settings.talk_dir)
+ {
+ case 1: /* dirs as numbers */
+ talk_id(VOICE_DIR, false);
+ talk_number(lasti+1, true);
+ break;
+
+ case 2: /* dirs spelled */
+ talk_spell(name, false);
+ break;
+ }
}
}
else
@@ -847,8 +857,14 @@ static int dirbrowse()
/* Directory? */
if (attr & ATTR_DIRECTORY)
{
- /* play directory thumbnail */
- switch (global_settings.talk_dir) {
+ /* schedule thumbnail playback if required */
+ if (global_settings.talk_dir_clip)
+ thumbnail_time = current_tick + HOVER_DELAY;
+ else
+ {
+ /* talk directly */
+ switch (global_settings.talk_dir)
+ {
case 1: /* dirs as numbers */
talk_id(VOICE_DIR, false);
talk_number(tc.selected_item+1, true);
@@ -857,20 +873,19 @@ static int dirbrowse()
case 2: /* dirs spelled */
talk_spell(name, false);
break;
-
- case 3: /* thumbnail clip */
- /* "schedule" a thumbnail, to have a little
- delay */
- thumbnail_time = current_tick + HOVER_DELAY;
- break;
-
- default:
- break;
+ }
}
}
else /* file */
{
- switch (global_settings.talk_file) {
+ /* schedule thumbnail playback if required */
+ if (global_settings.talk_file_clip && (attr & FILE_ATTR_THUMBNAIL))
+ thumbnail_time = current_tick + HOVER_DELAY;
+ else
+ {
+ /* talk directly */
+ switch (global_settings.talk_file)
+ {
case 1: /* files as numbers */
ft_play_filenumber(
tc.selected_item-tc.dirsindir+1,
@@ -880,19 +895,7 @@ static int dirbrowse()
case 2: /* files spelled */
talk_spell(name, false);
break;
-
- case 3: /* thumbnail clip */
- /* "schedule" a thumbnail, to have a little
- delay */
- if (attr & FILE_ATTR_THUMBNAIL)
- thumbnail_time = current_tick + HOVER_DELAY;
- else
- /* spell the number as fallback */
- talk_spell(name, false);
- break;
-
- default:
- break;
+ }
}
}
}