summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-10-10 05:56:53 +0000
committerJens Arnold <amiconn@rockbox.org>2007-10-10 05:56:53 +0000
commit100d343963ad2cc86727be8d438eb7e66ef40db3 (patch)
treee28999f820d5e17b752ccc4df3fa7fbef4828c42
parentddf33db8c4389582dfb99e80d56b82d2226eb9d4 (diff)
downloadrockbox-100d343963ad2cc86727be8d438eb7e66ef40db3.zip
rockbox-100d343963ad2cc86727be8d438eb7e66ef40db3.tar.gz
rockbox-100d343963ad2cc86727be8d438eb7e66ef40db3.tar.bz2
rockbox-100d343963ad2cc86727be8d438eb7e66ef40db3.tar.xz
Fix red Ondio builds. Hwcodec targets can't beep that way, so disable that beep for them.* Port the other vkeyboard enhancements (fixed character spelling and edit mode announcement) to the charcell vkeyboard (Player).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15064 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/player/keyboard.c23
-rw-r--r--apps/recorder/keyboard.c10
2 files changed, 26 insertions, 7 deletions
diff --git a/apps/player/keyboard.c b/apps/player/keyboard.c
index dcff7e7..6baa0d5 100644
--- a/apps/player/keyboard.c
+++ b/apps/player/keyboard.c
@@ -28,6 +28,7 @@
#include "talk.h"
#include "misc.h"
#include "rbunicode.h"
+#include "lang.h"
#define KBD_BUF_SIZE 64
#define KEYBOARD_PAGES 3
@@ -73,15 +74,25 @@ static unsigned short *kbd_setupkeys(int page, int* len)
/* helper function to spell a char if voice UI is enabled */
static void kbd_spellchar(char c)
{
- static char spell_char[2] = "\0\0"; /* store char to pass to talk_spell */
-
if (talk_menus_enabled()) /* voice UI? */
{
- spell_char[0] = c;
- talk_spell(spell_char, false);
+ unsigned char tmp[5];
+ /* store char to pass to talk_spell */
+ unsigned char* utf8 = utf8encode(c, tmp);
+ *utf8 = 0;
+
+ if(c == ' ')
+ talk_id(VOICE_BLANK, false);
+ else talk_spell(tmp, false);
}
}
+static void say_edit(void)
+{
+ if (talk_menus_enabled())
+ talk_id(VOICE_EDIT, false);
+}
+
int kbd_input(char* text, int buflen)
{
bool done = false;
@@ -184,7 +195,9 @@ int kbd_input(char* text, int buflen)
case BUTTON_ON: /* toggle mode */
line_edit = !line_edit;
- if (!line_edit)
+ if (line_edit)
+ say_edit();
+ else
kbd_spellchar(line[x]);
break;
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index ea068b2..7a46431 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -828,8 +828,11 @@ int kbd_input(char* text, int buflen)
{
int c = utf8seek(text, ++editpos);
kbd_spellchar(text[c]);
- } else if(talk_menus_enabled())
+ }
+#if CONFIG_CODEC == SWCODEC
+ else if (talk_menus_enabled())
pcmbuf_beep(1000, 150, 1500);
+#endif
}
else
#endif /* KBD_MODES */
@@ -870,8 +873,11 @@ int kbd_input(char* text, int buflen)
{
int c = utf8seek(text, --editpos);
kbd_spellchar(text[c]);
- } else if(talk_menus_enabled())
+ }
+#if CONFIG_CODEC == SWCODEC
+ else if (talk_menus_enabled())
pcmbuf_beep(1000, 150, 1500);
+#endif
}
else
#endif /* KBD_MODES */