diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-10-10 05:56:53 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-10-10 05:56:53 +0000 |
commit | 100d343963ad2cc86727be8d438eb7e66ef40db3 (patch) | |
tree | e28999f820d5e17b752ccc4df3fa7fbef4828c42 | |
parent | ddf33db8c4389582dfb99e80d56b82d2226eb9d4 (diff) | |
download | rockbox-100d343963ad2cc86727be8d438eb7e66ef40db3.tar.gz rockbox-100d343963ad2cc86727be8d438eb7e66ef40db3.zip |
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.c | 23 | ||||
-rw-r--r-- | apps/recorder/keyboard.c | 10 |
2 files changed, 26 insertions, 7 deletions
diff --git a/apps/player/keyboard.c b/apps/player/keyboard.c index dcff7e7d62..6baa0d5c90 100644 --- a/apps/player/keyboard.c +++ b/apps/player/keyboard.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "talk.h" | 28 | #include "talk.h" |
29 | #include "misc.h" | 29 | #include "misc.h" |
30 | #include "rbunicode.h" | 30 | #include "rbunicode.h" |
31 | #include "lang.h" | ||
31 | 32 | ||
32 | #define KBD_BUF_SIZE 64 | 33 | #define KBD_BUF_SIZE 64 |
33 | #define KEYBOARD_PAGES 3 | 34 | #define KEYBOARD_PAGES 3 |
@@ -73,15 +74,25 @@ static unsigned short *kbd_setupkeys(int page, int* len) | |||
73 | /* helper function to spell a char if voice UI is enabled */ | 74 | /* helper function to spell a char if voice UI is enabled */ |
74 | static void kbd_spellchar(char c) | 75 | static void kbd_spellchar(char c) |
75 | { | 76 | { |
76 | static char spell_char[2] = "\0\0"; /* store char to pass to talk_spell */ | ||
77 | |||
78 | if (talk_menus_enabled()) /* voice UI? */ | 77 | if (talk_menus_enabled()) /* voice UI? */ |
79 | { | 78 | { |
80 | spell_char[0] = c; | 79 | unsigned char tmp[5]; |
81 | talk_spell(spell_char, false); | 80 | /* store char to pass to talk_spell */ |
81 | unsigned char* utf8 = utf8encode(c, tmp); | ||
82 | *utf8 = 0; | ||
83 | |||
84 | if(c == ' ') | ||
85 | talk_id(VOICE_BLANK, false); | ||
86 | else talk_spell(tmp, false); | ||
82 | } | 87 | } |
83 | } | 88 | } |
84 | 89 | ||
90 | static void say_edit(void) | ||
91 | { | ||
92 | if (talk_menus_enabled()) | ||
93 | talk_id(VOICE_EDIT, false); | ||
94 | } | ||
95 | |||
85 | int kbd_input(char* text, int buflen) | 96 | int kbd_input(char* text, int buflen) |
86 | { | 97 | { |
87 | bool done = false; | 98 | bool done = false; |
@@ -184,7 +195,9 @@ int kbd_input(char* text, int buflen) | |||
184 | 195 | ||
185 | case BUTTON_ON: /* toggle mode */ | 196 | case BUTTON_ON: /* toggle mode */ |
186 | line_edit = !line_edit; | 197 | line_edit = !line_edit; |
187 | if (!line_edit) | 198 | if (line_edit) |
199 | say_edit(); | ||
200 | else | ||
188 | kbd_spellchar(line[x]); | 201 | kbd_spellchar(line[x]); |
189 | break; | 202 | break; |
190 | 203 | ||
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c index ea068b2569..7a46431881 100644 --- a/apps/recorder/keyboard.c +++ b/apps/recorder/keyboard.c | |||
@@ -828,8 +828,11 @@ int kbd_input(char* text, int buflen) | |||
828 | { | 828 | { |
829 | int c = utf8seek(text, ++editpos); | 829 | int c = utf8seek(text, ++editpos); |
830 | kbd_spellchar(text[c]); | 830 | kbd_spellchar(text[c]); |
831 | } else if(talk_menus_enabled()) | 831 | } |
832 | #if CONFIG_CODEC == SWCODEC | ||
833 | else if (talk_menus_enabled()) | ||
832 | pcmbuf_beep(1000, 150, 1500); | 834 | pcmbuf_beep(1000, 150, 1500); |
835 | #endif | ||
833 | } | 836 | } |
834 | else | 837 | else |
835 | #endif /* KBD_MODES */ | 838 | #endif /* KBD_MODES */ |
@@ -870,8 +873,11 @@ int kbd_input(char* text, int buflen) | |||
870 | { | 873 | { |
871 | int c = utf8seek(text, --editpos); | 874 | int c = utf8seek(text, --editpos); |
872 | kbd_spellchar(text[c]); | 875 | kbd_spellchar(text[c]); |
873 | } else if(talk_menus_enabled()) | 876 | } |
877 | #if CONFIG_CODEC == SWCODEC | ||
878 | else if (talk_menus_enabled()) | ||
874 | pcmbuf_beep(1000, 150, 1500); | 879 | pcmbuf_beep(1000, 150, 1500); |
880 | #endif | ||
875 | } | 881 | } |
876 | else | 882 | else |
877 | #endif /* KBD_MODES */ | 883 | #endif /* KBD_MODES */ |