diff options
author | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-04-04 19:08:44 +0000 |
---|---|---|
committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-04-04 19:08:44 +0000 |
commit | c8592bac33920c367ae574e76ac7b6b73e0353c3 (patch) | |
tree | 05872941fd109f8e7b0cc63f2fadddb31e4aba06 /apps/talk.c | |
parent | dd264a8c42f1fbe37774d9c13c744a92ea99ce70 (diff) | |
download | rockbox-c8592bac33920c367ae574e76ac7b6b73e0353c3.tar.gz rockbox-c8592bac33920c367ae574e76ac7b6b73e0353c3.zip |
Voice UI: option to spell dirs/files, say (known) extension with file number, minor fixes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4465 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/talk.c')
-rw-r--r-- | apps/talk.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/apps/talk.c b/apps/talk.c index 7ba858b47d..a0c730cbcc 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -35,7 +35,7 @@ extern void bitswap(unsigned char *data, int length); /* no header for this */ | |||
35 | 35 | ||
36 | /***************** Constants *****************/ | 36 | /***************** Constants *****************/ |
37 | 37 | ||
38 | #define QUEUE_SIZE 20 | 38 | #define QUEUE_SIZE 50 |
39 | const char* voicefont_file = "/.rockbox/langs/english.voice"; | 39 | const char* voicefont_file = "/.rockbox/langs/english.voice"; |
40 | const char* dir_thumbnail_name = ".dirname.mp3"; | 40 | const char* dir_thumbnail_name = ".dirname.mp3"; |
41 | 41 | ||
@@ -487,3 +487,33 @@ int talk_value(int n, int unit, bool enqueue) | |||
487 | return 0; | 487 | return 0; |
488 | } | 488 | } |
489 | 489 | ||
490 | /* spell a string */ | ||
491 | int talk_spell(char* spell, bool enqueue) | ||
492 | { | ||
493 | char c; /* currently processed char */ | ||
494 | |||
495 | if (mpeg_status()) /* busy, buffer in use */ | ||
496 | return -1; | ||
497 | |||
498 | if (!enqueue) | ||
499 | shutup(); /* cut off all the pending stuff */ | ||
500 | |||
501 | while ((c = *spell++) != '\0') | ||
502 | { | ||
503 | /* if this grows into too many cases, I should use a table */ | ||
504 | if (c >= 'A' && c <= 'Z') | ||
505 | talk_id(VOICE_CHAR_A + c - 'A', true); | ||
506 | else if (c >= 'a' && c <= 'z') | ||
507 | talk_id(VOICE_CHAR_A + c - 'a', true); | ||
508 | else if (c >= '0' && c <= '9') | ||
509 | talk_id(VOICE_ZERO + c - '0', true); | ||
510 | else if (c == '-') | ||
511 | talk_id(VOICE_MINUS, true); | ||
512 | else if (c == '+') | ||
513 | talk_id(VOICE_PLUS, true); | ||
514 | else if (c == '.') | ||
515 | talk_id(VOICE_POINT, true); | ||
516 | } | ||
517 | |||
518 | return 0; | ||
519 | } | ||