summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2006-09-26 17:44:43 +0000
committerMichael Sevakis <jethead71@rockbox.org>2006-09-26 17:44:43 +0000
commit287deb0e74855349baebe30162303b08ff4bbf5e (patch)
tree5f0f0b82aefa00c0e65ade8811d498b125ad2886 /apps
parent183499a2d43ebcec9a522bbcbde506f0b3c5e01d (diff)
downloadrockbox-287deb0e74855349baebe30162303b08ff4bbf5e.tar.gz
rockbox-287deb0e74855349baebe30162303b08ff4bbf5e.zip
Fixed voice units in recording quality and filesplit by size options.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11063 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/talk.c40
-rw-r--r--apps/talk.h3
2 files changed, 29 insertions, 14 deletions
diff --git a/apps/talk.c b/apps/talk.c
index 21c6f4bb1a..1da24153d2 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -717,19 +717,33 @@ int talk_value(long n, int unit, bool enqueue)
int unit_id;
static const int unit_voiced[] =
{ /* lookup table for the voice ID of the units */
- -1, -1, -1, /* regular ID, int, signed */
- VOICE_MILLISECONDS, /* here come the "real" units */
- VOICE_SECONDS,
- VOICE_MINUTES,
- VOICE_HOURS,
- VOICE_KHZ,
- VOICE_DB,
- VOICE_PERCENT,
- VOICE_MILLIAMPHOURS,
- VOICE_PIXEL,
- VOICE_PER_SEC,
- VOICE_HERTZ,
- VOICE_KBIT_PER_SEC,
+ [0 ... UNIT_LAST-1] = -1, /* regular ID, int, signed */
+ [UNIT_MS]
+ = VOICE_MILLISECONDS, /* here come the "real" units */
+ [UNIT_SEC]
+ = VOICE_SECONDS,
+ [UNIT_MIN]
+ = VOICE_MINUTES,
+ [UNIT_HOUR]
+ = VOICE_HOURS,
+ [UNIT_KHZ]
+ = VOICE_KHZ,
+ [UNIT_DB]
+ = VOICE_DB,
+ [UNIT_PERCENT]
+ = VOICE_PERCENT,
+ [UNIT_MAH]
+ = VOICE_MILLIAMPHOURS,
+ [UNIT_PIXEL]
+ = VOICE_PIXEL,
+ [UNIT_PER_SEC]
+ = VOICE_PER_SEC,
+ [UNIT_HERTZ]
+ = VOICE_HERTZ,
+ [UNIT_MB]
+ = LANG_MEGABYTE,
+ [UNIT_KBIT]
+ = VOICE_KBIT_PER_SEC,
};
#if CONFIG_CODEC != SWCODEC
diff --git a/apps/talk.h b/apps/talk.h
index 2f2099a8c4..bfd08354aa 100644
--- a/apps/talk.h
+++ b/apps/talk.h
@@ -27,6 +27,7 @@
#include <stdbool.h>
enum {
+ /* See array "unit_voiced" in talk.c function "talk_value" */
UNIT_INT = 1, /* plain number */
UNIT_SIGNED, /* number with mandatory sign (even if positive) */
UNIT_MS, /* milliseconds */
@@ -45,7 +46,7 @@ enum {
UNIT_LAST /* END MARKER */
};
-#define UNIT_SHIFT (32-4) /* this many bits left from UNIT_xx enum */
+#define UNIT_SHIFT (32-5) /* this many bits left from UNIT_xx enum */
/* make a "talkable" ID from number + unit
unit is upper 4 bits, number the remaining (in regular 2's complement) */