diff options
author | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-03-19 22:15:53 +0000 |
---|---|---|
committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-03-19 22:15:53 +0000 |
commit | fa97f161abc45bfd5db86bceb8803d2661e65447 (patch) | |
tree | 1e06ac8c47bd9165e46e85235f059372ddad2b90 /apps/talk.h | |
parent | 239b70fad38be55075dd14ea8e3c0f6f54a1f35b (diff) | |
download | rockbox-fa97f161abc45bfd5db86bceb8803d2661e65447.tar.gz rockbox-fa97f161abc45bfd5db86bceb8803d2661e65447.zip |
Third step of the voice-UI: numerical settings are spoken (composed at runtime), needs new voicefont at the new location ".rockbox/langs/english.voice"
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4414 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/talk.h')
-rw-r--r-- | apps/talk.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/apps/talk.h b/apps/talk.h new file mode 100644 index 0000000000..4851e7b6fb --- /dev/null +++ b/apps/talk.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2004 Jörg Hohensohn | ||
11 | * | ||
12 | * This module collects the Talkbox and voice UI functions. | ||
13 | * (Talkbox reads directory names from mp3 clips called thumbnails, | ||
14 | * the voice UI lets menus and screens "talk" from a voicefont in memory. | ||
15 | * | ||
16 | * All files in this archive are subject to the GNU General Public License. | ||
17 | * See the file COPYING in the source tree root for full license agreement. | ||
18 | * | ||
19 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
20 | * KIND, either express or implied. | ||
21 | * | ||
22 | ****************************************************************************/ | ||
23 | |||
24 | #ifndef __TALK_H__ | ||
25 | #define __TALK_H__ | ||
26 | |||
27 | #include <stdbool.h> | ||
28 | |||
29 | enum { | ||
30 | UNIT_INT = 1, /* plain number */ | ||
31 | UNIT_SIGNED, /* number with mandatory sign (even if positive) */ | ||
32 | UNIT_MS, /* milliseconds */ | ||
33 | UNIT_SEC, /* seconds */ | ||
34 | UNIT_MIN, /* minutes */ | ||
35 | UNIT_HOUR, /* hours */ | ||
36 | UNIT_KHZ, /* kHz */ | ||
37 | UNIT_DB, /* dB, mandatory sign */ | ||
38 | UNIT_PERCENT, /* % */ | ||
39 | UNIT_MB, /* megabyte */ | ||
40 | UNIT_GB, /* gigabyte */ | ||
41 | UNIT_LAST /* END MARKER */ | ||
42 | }; | ||
43 | |||
44 | #define UNIT_SHIFT (32-4) /* this many bits left from UNIT_xx enum */ | ||
45 | |||
46 | /* make a "talkable" ID from number + unit | ||
47 | unit is upper 4 bits, number the remaining (in regular 2's complement) */ | ||
48 | #define TALK_ID(n,u) ((u)<<UNIT_SHIFT | ((n) & ~(-1<<UNIT_SHIFT))) | ||
49 | |||
50 | /* convenience macro to have both string and ID as arguments */ | ||
51 | #define STR(id) str(id), id | ||
52 | |||
53 | |||
54 | void talk_init(void); | ||
55 | int talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */ | ||
56 | int talk_id(int id, bool enqueue); /* play a voice ID from voicefont */ | ||
57 | int talk_file(char* filename, bool enqueue); /* play a thumbnail from file */ | ||
58 | int talk_number(int n, bool enqueue); /* say a number */ | ||
59 | int talk_value(int n, int unit, bool enqueue); /* say a numeric value */ | ||
60 | |||
61 | #endif /* __TALK_H__ */ | ||