Index: rockbox-devel/apps/filetree.c
===================================================================
--- rockbox-devel.orig/apps/filetree.c
+++ rockbox-devel/apps/filetree.c
@@ -323,7 +323,7 @@ int ft_load(struct tree_context* c, cons
/* If thumbnail talking is enabled, make an extra run to mark files with
associated thumbnails, so we don't do unsuccessful spinups later. */
- if (global_settings.talk_file == 3)
+ if (global_settings.talk_file_dottalk)
check_file_thumbnails(c); /* map .talk to ours */
return 0;
Index: rockbox-devel/apps/lang/english.lang
===================================================================
--- rockbox-devel.orig/apps/lang/english.lang
+++ rockbox-devel/apps/lang/english.lang
@@ -2516,7 +2516,7 @@
- id: LANG_VOICE_DIR
+ id: LANG_VOICE_DIR_SPEAK
desc: item of voice menu, set the "talkbox" mode for directories
user:
@@ -2530,7 +2530,7 @@
- id: LANG_VOICE_FILE
+ id: LANG_VOICE_FILE_SPEAK
desc: item of voice menu, set the voive mode for files
user:
@@ -2573,16 +2573,16 @@
id: LANG_VOICE_DIR_HOVER
- desc: "talkbox" mode for directories + files
+ desc: DEPRECATED
user:
- *: ".talk mp3 clip"
+ *: ""
- *: ".talk mp3 clip"
+ *: ""
- *: "talk mp3 clip"
+ *: ""
@@ -10100,3 +10100,45 @@
*: "Track lock step"
+
+ id: LANG_VOICE_DIR_DOTTALK
+ desc: voice settings menu, "talkbox" mode for directories
+ user:
+
+ *: "Use dot talk clip for directories"
+
+
+ *: "Use dot talk clip for directories"
+
+
+ *: "Use dot talk clip for directories"
+
+
+
+ id: LANG_VOICE_FILE_DOTTALK
+ desc: voice settings menu, "talkbox" mode for files
+ user:
+
+ *: "Use dot talk clip for files"
+
+
+ *: "Use dot talk clip for files"
+
+
+ *: "Use dot talk clip for files"
+
+
+
+ id: LANG_VOICE_FILETYPE
+ desc: voice settings menu
+ user:
+
+ *: "Say file type"
+
+
+ *: "Say file type"
+
+
+ *: "Say file type"
+
+
Index: rockbox-devel/apps/settings_menu.c
===================================================================
--- rockbox-devel.orig/apps/settings_menu.c
+++ rockbox-devel/apps/settings_menu.c
@@ -1299,34 +1299,47 @@ static bool voice_menus(void)
}
/* this is used 2 times below, so it saves memory to put it in global scope */
-static const struct opt_items voice_names[] = {
+static const struct opt_items speak_files_options[] = {
{ STR(LANG_OFF) },
{ STR(LANG_VOICE_NUMBER) },
{ STR(LANG_VOICE_SPELL) },
- { STR(LANG_VOICE_DIR_HOVER) }
};
-static bool voice_dirs(void)
+static bool voice_dirs_speak(void)
{
- bool ret = set_option( str(LANG_VOICE_DIR),
- &global_settings.talk_dir, INT, voice_names, 4, NULL);
+ return set_option( str(LANG_VOICE_DIR_SPEAK),
+ &global_settings.talk_dir_speak, INT,
+ speak_files_options, 3, NULL);
+}
+
+static bool voice_dirs_dottalk(void)
+{
+ bool ret = set_bool(str(LANG_VOICE_DIR_DOTTALK),
+ &global_settings.talk_dir_dottalk);
#if CONFIG_CODEC == SWCODEC
audio_set_crossfade(global_settings.crossfade);
#endif
return ret;
}
-static bool voice_files(void)
+static bool voice_files_speak(void)
{
- int oldval = global_settings.talk_file;
+ return set_option( str(LANG_VOICE_FILE_SPEAK),
+ &global_settings.talk_file_speak, INT,
+ speak_files_options, 3, NULL);
+}
+
+static bool voice_files_dottalk(void)
+{
+ int oldval = global_settings.talk_file_dottalk;
bool ret;
- ret = set_option( str(LANG_VOICE_FILE),
- &global_settings.talk_file, INT, voice_names, 4, NULL);
+ ret = set_bool(str(LANG_VOICE_FILE_DOTTALK),
+ &global_settings.talk_file_dottalk);
#if CONFIG_CODEC == SWCODEC
audio_set_crossfade(global_settings.crossfade);
#endif
- if (oldval != 3 && global_settings.talk_file == 3)
+ if (oldval == false && global_settings.talk_file_dottalk == true)
{ /* force reload if newly talking thumbnails,
because the clip presence is cached only if enabled */
reload_directory();
@@ -1334,6 +1347,12 @@ static bool voice_files(void)
return ret;
}
+static bool voice_filetype(void)
+{
+ return set_bool(str(LANG_VOICE_FILETYPE),
+ &global_settings.talk_filetype);
+}
+
static bool voice_menu(void)
{
int m;
@@ -1341,8 +1360,11 @@ static bool voice_menu(void)
static const struct menu_item items[] = {
{ ID2P(LANG_VOICE_MENU), voice_menus },
- { ID2P(LANG_VOICE_DIR), voice_dirs },
- { ID2P(LANG_VOICE_FILE), voice_files }
+ { ID2P(LANG_VOICE_DIR_SPEAK), voice_dirs_speak },
+ { ID2P(LANG_VOICE_DIR_DOTTALK), voice_dirs_dottalk },
+ { ID2P(LANG_VOICE_FILE_SPEAK), voice_files_speak },
+ { ID2P(LANG_VOICE_FILE_DOTTALK), voice_files_dottalk },
+ { ID2P(LANG_VOICE_FILETYPE), voice_filetype }
};
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
Index: rockbox-devel/apps/talk.c
===================================================================
--- rockbox-devel.orig/apps/talk.c
+++ rockbox-devel/apps/talk.c
@@ -534,8 +534,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_dottalk) /* Thumbnail clips are required */
+ || (global_settings.talk_file_dottalk);
}
/* return size of voice file */
Index: rockbox-devel/apps/tree.c
===================================================================
--- rockbox-devel.orig/apps/tree.c
+++ rockbox-devel/apps/tree.c
@@ -154,6 +154,8 @@ static bool start_wps = false;
static bool dirbrowse(void);
static int curr_context = false;/* id3db or tree*/
+void say_filetype(int attr, bool enqueue);
+
/*
* removes the extension of filename (if it doesn't start with a .)
* puts the result in buffer
@@ -859,9 +861,23 @@ static bool dirbrowse(void)
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);
+ {
+ switch (global_settings.talk_dir_speak) {
+ case 1: /* say the number instead */
+ talk_id(VOICE_DIR, false);
+ talk_number(lasti+1, true);
+ break;
+ case 2: /* spell the name instead */
+ if(global_settings.talk_filetype)
+ {
+ talk_id(VOICE_DIR, false);
+ talk_spell(name, true);
+ }
+ else talk_spell(name, false);
+ break;
+ default:
+ break;
+ }
}
}
else
@@ -1000,52 +1016,48 @@ static bool dirbrowse(void)
if (attr & ATTR_DIRECTORY)
{
/* play directory thumbnail */
- switch (global_settings.talk_dir) {
- case 1: /* dirs as numbers */
+ if(global_settings.talk_dir_dottalk)
+ /* "schedule" a thumbnail, to have a little delay */
+ thumbnail_time = current_tick + HOVER_DELAY;
+ else
+ switch (global_settings.talk_dir_speak) {
+ case 1: /* dirs as numbers */
talk_id(VOICE_DIR, false);
talk_number(tc.selected_item+1, true);
break;
-
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;
+ if(global_settings.talk_filetype)
+ {
+ talk_id(VOICE_DIR, false);
+ talk_spell(name, true);
+ }
+ else talk_spell(name, false);
break;
-
default:
break;
- }
+ }
}
else /* file */
{
- switch (global_settings.talk_file) {
+ if(global_settings.talk_file_dottalk
+ && (attr & TREE_ATTR_THUMBNAIL))
+ /* "schedule" a thumbnail, to have a little delay */
+ thumbnail_time = current_tick + HOVER_DELAY;
+ else
+ switch (global_settings.talk_file_speak) {
case 1: /* files as numbers */
ft_play_filenumber(
- tc.selected_item-tc.dirsindir+1,
- attr & TREE_ATTR_MASK);
+ tc.selected_item-tc.dirsindir+1, attr);
break;
case 2: /* files spelled */
- talk_spell(name, false);
- break;
-
- case 3: /* thumbnail clip */
- /* "schedule" a thumbnail, to have a little
- delay */
- if (attr & TREE_ATTR_THUMBNAIL)
- thumbnail_time = current_tick + HOVER_DELAY;
- else
- /* spell the number as fallback */
- talk_spell(name, false);
+ say_filetype(attr, false);
+ talk_spell(name, true);
break;
default:
break;
- }
+ }
}
}
}
@@ -1299,11 +1311,12 @@ void bookmark_play(char *resume_file, in
start_wps=true;
}
-int ft_play_filenumber(int pos, int attr)
+long get_filetype_voice_id(int attr)
{
/* try to find a voice ID for the extension, if known */
unsigned int j;
- int ext_id = -1; /* default to none */
+ long ext_id = -1; /* default to none */
+ attr &= TREE_ATTR_MASK; /* file type */
for (j=0; j