diff options
| author | Nils Wallménius <nils@rockbox.org> | 2008-04-19 13:19:04 +0000 |
|---|---|---|
| committer | Nils Wallménius <nils@rockbox.org> | 2008-04-19 13:19:04 +0000 |
| commit | 05d2bfd5e096d76ede965226520e680cafe22dc4 (patch) | |
| tree | 13b4b4c8fc13e82755cee2fe1f4aad4e244bf4f4 /apps/talk.h | |
| parent | a1b3c69a0fd3c16d09e284fb2365c69b7efdd555 (diff) | |
| download | rockbox-05d2bfd5e096d76ede965226520e680cafe22dc4.zip rockbox-05d2bfd5e096d76ede965226520e680cafe22dc4.tar.gz rockbox-05d2bfd5e096d76ede965226520e680cafe22dc4.tar.bz2 rockbox-05d2bfd5e096d76ede965226520e680cafe22dc4.tar.xz | |
Introduce support for passing decimal numbers in talk ids and speak them, use in the settings menu to fix FS#7622
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17168 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/talk.h')
| -rw-r--r-- | apps/talk.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/talk.h b/apps/talk.h index 97b8c58..afd280e 100644 --- a/apps/talk.h +++ b/apps/talk.h @@ -55,10 +55,18 @@ enum { #define UNIT_SHIFT (32-5) /* this many bits left from UNIT_xx enum */ +#define DECIMAL_SHIFT (32 - 8) + /* make a "talkable" ID from number + unit unit is upper 4 bits, number the remaining (in regular 2's complement) */ #define TALK_ID(n,u) (((long)(u))<<UNIT_SHIFT | ((n) & ~(-1L<<UNIT_SHIFT))) +/* make a "talkable" ID from a decimal number + unit, the decimal number + is represented like x*10*d where d is the number of decimal digits */ +#define TALK_ID_DECIMAL(n,d,u) (((long)(u))<<UNIT_SHIFT |\ + ((long)(d))<<DECIMAL_SHIFT |\ + ((n) & ~(-1L<<DECIMAL_SHIFT))) + /* convenience macro to have both virtual pointer and ID as arguments */ #define STR(id) ID2P(id), id @@ -77,6 +85,7 @@ int talk_id(int32_t id, bool enqueue); /* play a voice ID from voicefont */ int talk_file(const char* filename, bool enqueue); /* play a thumbnail from file */ int talk_number(long n, bool enqueue); /* say a number */ int talk_value(long n, int unit, bool enqueue); /* say a numeric value */ +int talk_value_decimal(long n, int unit, int decimals, bool enqueue); int talk_spell(const char* spell, bool enqueue); /* spell a string */ void talk_setting(const void *global_settings_variable); /* read a setting */ void talk_disable(bool disable); /* temporarily disable (or re-enable) talking (temporarily, not persisted) */ |