summaryrefslogtreecommitdiff
path: root/apps/onplay.c
diff options
context:
space:
mode:
authorJeffrey Goode <jeffg7@gmail.com>2010-04-11 00:32:16 +0000
committerJeffrey Goode <jeffg7@gmail.com>2010-04-11 00:32:16 +0000
commitef30d7ef712faf1c98ccc8289dc64854994f0397 (patch)
treec440c6150ebc774b5cbf52540b77905c0bd9b683 /apps/onplay.c
parent66fa12726212c5b597b44bfb5654312f0580953f (diff)
FS#11195, plus. Simplified hotkey struct, thanks alle!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25581 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/onplay.c')
-rw-r--r--apps/onplay.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/apps/onplay.c b/apps/onplay.c
index 27a3196e16..87474956c4 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -1218,8 +1218,7 @@ struct hotkey_assignment {
int item; /* Bit or'd hotkey_action and HOTKEY_CTX_x */
struct menu_func func; /* Function to run if this entry is selected */
int return_code; /* What to return after the function is run */
- const struct menu_item_ex *menu_addr;
- int lang_id; /* How to present the item to the user */
+ const struct menu_item_ex *menu_addr; /* Must be a MENUITEM_FUNCTION */
};
#define HOTKEY_FUNC(func, param) {{(void *)func}, param}
@@ -1228,49 +1227,42 @@ struct hotkey_assignment {
static struct hotkey_assignment hotkey_items[] = {
{ HOTKEY_VIEW_PLAYLIST | HOTKEY_CTX_WPS,
HOTKEY_FUNC(NULL, NULL),
- ONPLAY_PLAYLIST, &view_cur_playlist,
- LANG_VIEW_DYNAMIC_PLAYLIST },
+ ONPLAY_PLAYLIST, &view_cur_playlist },
{ HOTKEY_SHOW_TRACK_INFO| HOTKEY_CTX_WPS,
HOTKEY_FUNC(browse_id3, NULL),
- ONPLAY_RELOAD_DIR, &browse_id3_item,
- LANG_MENU_SHOW_ID3_INFO },
+ ONPLAY_RELOAD_DIR, &browse_id3_item },
#ifdef HAVE_PITCHSCREEN
{ HOTKEY_PITCHSCREEN | HOTKEY_CTX_WPS,
HOTKEY_FUNC(gui_syncpitchscreen_run, NULL),
- ONPLAY_RELOAD_DIR, &pitch_screen_item,
- LANG_PITCH },
+ ONPLAY_RELOAD_DIR, &pitch_screen_item },
#endif
{ HOTKEY_OPEN_WITH | HOTKEY_CTX_WPS | HOTKEY_CTX_TREE,
HOTKEY_FUNC(open_with, NULL),
- ONPLAY_RELOAD_DIR, &list_viewers_item,
- LANG_ONPLAY_OPEN_WITH },
+ ONPLAY_RELOAD_DIR, &list_viewers_item },
{ HOTKEY_DELETE | HOTKEY_CTX_WPS | HOTKEY_CTX_TREE,
HOTKEY_FUNC(delete_item, NULL),
- ONPLAY_RELOAD_DIR, &delete_file_item,
- LANG_DELETE },
+ ONPLAY_RELOAD_DIR, &delete_file_item },
{ HOTKEY_DELETE | HOTKEY_CTX_TREE,
HOTKEY_FUNC(delete_item, NULL),
- ONPLAY_RELOAD_DIR, &delete_dir_item,
- LANG_DELETE },
+ ONPLAY_RELOAD_DIR, &delete_dir_item },
{ HOTKEY_INSERT | HOTKEY_CTX_TREE,
HOTKEY_FUNC(playlist_insert_func, (intptr_t*)PLAYLIST_INSERT),
- ONPLAY_START_PLAY, &i_pl_item,
- LANG_INSERT },
+ ONPLAY_START_PLAY, &i_pl_item },
};
static const int num_hotkey_items = sizeof(hotkey_items) / sizeof(hotkey_items[0]);
/* Return the language ID for the input function */
-int get_hotkey_desc_id(int hk_func)
+char* get_hotkey_desc(int hk_func)
{
int i;
for (i = 0; i < num_hotkey_items; i++)
{
if ((hotkey_items[i].item & HOTKEY_ACTION_MASK) == hk_func)
- return hotkey_items[i].lang_id;
+ return P2STR(hotkey_items[i].menu_addr->callback_and_desc->desc);
}
- return LANG_HOTKEY_NOT_SET;
+ return str(LANG_HOTKEY_NOT_SET);
}
/* Execute the hotkey function, if listed for this screen */