diff options
| author | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-03-14 21:33:53 +0000 |
|---|---|---|
| committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-03-14 21:33:53 +0000 |
| commit | 4f36ea8fbf877e8af938c0bb16591f3c6cffd4f8 (patch) | |
| tree | c0dbd4a148a54c8c2851d95149ed6d4e91053bd6 /apps/menu.c | |
| parent | 62b095d02972ac8c6fb63ab0a38d1fa0c483b85b (diff) | |
| download | rockbox-4f36ea8fbf877e8af938c0bb16591f3c6cffd4f8.zip rockbox-4f36ea8fbf877e8af938c0bb16591f3c6cffd4f8.tar.gz rockbox-4f36ea8fbf877e8af938c0bb16591f3c6cffd4f8.tar.bz2 rockbox-4f36ea8fbf877e8af938c0bb16591f3c6cffd4f8.tar.xz | |
First step of the voice-UI: the menus can talk. You need a "voicefont" file in .rockbox to use this.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4381 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menu.c')
| -rw-r--r-- | apps/menu.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/menu.c b/apps/menu.c index f187b5d..f944354 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -32,6 +32,7 @@ #include "settings.h" #include "status.h" #include "screens.h" +#include "talk.h" #ifdef HAVE_LCD_BITMAP #include "icons.h" @@ -216,6 +217,13 @@ static void put_cursor(int m, int target) lcd_update(); } + if (do_update) + { /* "say" the entry under the cursor */ + int voice_id = menus[m].items[menus[m].cursor].voice_id; + if (voice_id >= 0) /* valid ID given? */ + talk_id(voice_id, false); /* say it */ + } + } int menu_init(struct menu_items* mitems, int count, int (*callback)(int, int)) @@ -250,6 +258,7 @@ int menu_show(int m) { bool exit = false; int key; + int voice_id; #ifdef HAVE_LCD_BITMAP int fw, fh; int menu_lines; @@ -263,9 +272,16 @@ int menu_show(int m) menu_draw(m); + /* say current entry */ + voice_id = menus[m].items[menus[m].cursor].voice_id; + if (voice_id >= 0) /* valid ID given? */ + talk_id(voice_id, false); /* say it */ + while (!exit) { key = button_get_w_tmo(HZ/2); + + /* * "short-circuit" the default keypresses by running the callback function */ @@ -274,6 +290,7 @@ int menu_show(int m) key = menus[m].callback(key, m); /* make sure there's no match in the switch */ switch( key ) { + #ifdef HAVE_RECORDER_KEYPAD case BUTTON_UP: case BUTTON_UP | BUTTON_REPEAT: |