summaryrefslogtreecommitdiffstats
path: root/apps/menu.c
diff options
context:
space:
mode:
authorSt├ęphane Doyon <s.doyon@videotron.ca>2007-10-09 03:48:56 +0000
committerSt├ęphane Doyon <s.doyon@videotron.ca>2007-10-09 03:48:56 +0000
commit5acf09104644a7942cf264d80a99f6bf5ae20792 (patch)
treea9705adea534e53795112eecde1d5b08171c9ac1 /apps/menu.c
parent3fd073ed4d5e0bb819b30ee71546151f13aa2150 (diff)
downloadrockbox-5acf09104644a7942cf264d80a99f6bf5ae20792.tar.gz
rockbox-5acf09104644a7942cf264d80a99f6bf5ae20792.tar.bz2
rockbox-5acf09104644a7942cf264d80a99f6bf5ae20792.zip
Add a voice callback to dynamic menus, along side the text_callback.
From FS#7563. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15042 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menu.c')
-rw-r--r--apps/menu.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/apps/menu.c b/apps/menu.c
index e369f4d390..1dedc42a5c 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -237,12 +237,22 @@ static void talk_menu_item(const struct menu_item_ex *menu,
{
if (menu->submenus[sel]->flags&(MENU_DYNAMIC_DESC))
{
- char buffer[80];
- str = menu->submenus[sel]->menu_get_name_and_icon->
- list_get_name(sel, menu->submenus[sel]->
- menu_get_name_and_icon->
- list_get_name_data, buffer);
- id = P2ID(str);
+ int (*list_speak_item)(int selected_item, void * data)
+ = menu->submenus[sel]->menu_get_name_and_icon->
+ list_speak_item;
+ if(list_speak_item)
+ list_speak_item(sel, menu->submenus[sel]->
+ menu_get_name_and_icon->
+ list_get_name_data);
+ else
+ {
+ char buffer[80];
+ str = menu->submenus[sel]->menu_get_name_and_icon->
+ list_get_name(sel, menu->submenus[sel]->
+ menu_get_name_and_icon->
+ list_get_name_data, buffer);
+ id = P2ID(str);
+ }
}
else
id = P2ID(menu->submenus[sel]->callback_and_desc->desc);