summaryrefslogtreecommitdiff
path: root/apps/talk.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/talk.c')
-rw-r--r--apps/talk.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/apps/talk.c b/apps/talk.c
index 2e73001c46..ab4a97397c 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -44,6 +44,7 @@
44#include "debug.h" 44#include "debug.h"
45#include "panic.h" 45#include "panic.h"
46#include "misc.h" /* time_split_units() */ 46#include "misc.h" /* time_split_units() */
47#include "mv.h"
47 48
48/***************** Constants *****************/ 49/***************** Constants *****************/
49 50
@@ -1167,6 +1168,21 @@ int talk_file_or_spell(const char *dirname, const char *filename,
1167 return 0; 1168 return 0;
1168} 1169}
1169 1170
1171#ifdef HAVE_MULTIVOLUME
1172int talk_volume_id(int volume)
1173{
1174 if (volume == -1)
1175 return 0;
1176
1177 int drive = volume_drive(volume);
1178 // XXX voice "VOLUME" or something like that?
1179
1180 talk_id(drive? LANG_DISK_NAME_MMC : LANG_DISK_NAME_INTERNAL, true);
1181 talk_value(volume, UNIT_INT, true);
1182 return 1;
1183}
1184#endif
1185
1170/* Play a directory's .talk thumbnail, fallback to spelling the filename, or 1186/* Play a directory's .talk thumbnail, fallback to spelling the filename, or
1171 go straight to spelling depending on settings. */ 1187 go straight to spelling depending on settings. */
1172int talk_dir_or_spell(const char* dirname, 1188int talk_dir_or_spell(const char* dirname,
@@ -1174,13 +1190,14 @@ int talk_dir_or_spell(const char* dirname,
1174{ 1190{
1175 if (global_settings.talk_dir_clip) 1191 if (global_settings.talk_dir_clip)
1176 { /* .talk clips enabled */ 1192 { /* .talk clips enabled */
1177 if(talk_file(dirname, NULL, dir_thumbnail_name, NULL, 1193 if (talk_file(dirname, NULL, dir_thumbnail_name, NULL,
1178 prefix_ids, enqueue) >0) 1194 prefix_ids, enqueue) >0)
1179 return 0; 1195 return 0;
1180 } 1196 }
1181 if (global_settings.talk_dir == TALK_SPEAK_SPELL) 1197 if (global_settings.talk_dir == TALK_SPEAK_SPELL) {
1182 /* Either .talk clips disabled or as a fallback */ 1198 /* Either .talk clips disabled or as a fallback */
1183 return talk_spell_basename(dirname, prefix_ids, enqueue); 1199 return talk_spell_basename(dirname, prefix_ids, enqueue);
1200 }
1184 return 0; 1201 return 0;
1185} 1202}
1186 1203
@@ -1201,12 +1218,20 @@ int talk_fullpath(const char* path, bool enqueue)
1201 while(ptr) { /* There are more slashes ahead */ 1218 while(ptr) { /* There are more slashes ahead */
1202 /* temporarily poke a NULL at end of component to truncate string */ 1219 /* temporarily poke a NULL at end of component to truncate string */
1203 *ptr = '\0'; 1220 *ptr = '\0';
1204 talk_dir_or_spell(buf, NULL, true); 1221#ifdef HAVE_MULTIVOLUME
1222 if (start == buf+1) {
1223 int vol = path_get_volume_id(buf+1);
1224 if (!talk_volume_id(vol))
1225 talk_dir_or_spell(buf, NULL, true);
1226 } else
1227#endif
1228 talk_dir_or_spell(buf, NULL, true);
1205 *ptr = '/'; /* restore string */ 1229 *ptr = '/'; /* restore string */
1206 talk_id(VOICE_CHAR_SLASH, true); 1230 talk_id(VOICE_CHAR_SLASH, true);
1207 start = ptr+1; /* setup for next component */ 1231 start = ptr+1; /* setup for next component */
1208 ptr = strchr(start, '/'); 1232 ptr = strchr(start, '/');
1209 } 1233 }
1234
1210 /* no more slashes, final component is a filename */ 1235 /* no more slashes, final component is a filename */
1211 return talk_file_or_spell(NULL, buf, NULL, true); 1236 return talk_file_or_spell(NULL, buf, NULL, true);
1212} 1237}