summaryrefslogtreecommitdiff
path: root/apps/keymaps/keymap-player.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-08-16 20:12:27 +0000
committerJens Arnold <amiconn@rockbox.org>2006-08-16 20:12:27 +0000
commitf39add3d197fd0fcf8f7a381fd0fec76b6a51b95 (patch)
treea1d6e7b4294039d0abecb45a0d736a651a340d32 /apps/keymaps/keymap-player.c
parent0fec0f540c1d6fed77a297cb971e1d74021935ef (diff)
Remote button mappings for archos player & recorders. Made keymap-internal stuff static for better optimisation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10620 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/keymaps/keymap-player.c')
-rw-r--r--apps/keymaps/keymap-player.c65
1 files changed, 53 insertions, 12 deletions
diff --git a/apps/keymaps/keymap-player.c b/apps/keymaps/keymap-player.c
index eecd9b99b7..8ed5d9dc55 100644
--- a/apps/keymaps/keymap-player.c
+++ b/apps/keymaps/keymap-player.c
@@ -25,7 +25,7 @@
#include "action.h"
#include "button.h"
-const struct button_mapping button_context_standard[] = {
+static const struct button_mapping button_context_standard[] = {
{ ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
{ ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
@@ -39,7 +39,7 @@ const struct button_mapping button_context_standard[] = {
LAST_ITEM_IN_LIST
};
-const struct button_mapping button_context_wps[] = {
+static const struct button_mapping button_context_wps[] = {
{ ACTION_WPS_PLAY, BUTTON_PLAY, BUTTON_NONE },
{ ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
{ ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
@@ -59,37 +59,77 @@ const struct button_mapping button_context_wps[] = {
{ ACTION_WPS_CONTEXT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
{ ACTION_WPS_ID3SCREEN, BUTTON_MENU|BUTTON_ON, BUTTON_NONE },
-
LAST_ITEM_IN_LIST
};
-const struct button_mapping button_context_settings[] = {
- { ACTION_SETTINGS_INC, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+static const struct button_mapping button_context_settings[] = {
+ { ACTION_SETTINGS_INC, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_SETTINGS_INCREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_SETTINGS_DECREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
LAST_ITEM_IN_LIST
};
-const struct button_mapping button_context_tree[] = {
+static const struct button_mapping button_context_tree[] = {
{ ACTION_TREE_WPS, BUTTON_ON, BUTTON_NONE },
LAST_ITEM_IN_LIST
}; /* button_context_listtree */
-const struct button_mapping button_context_yesno[] = {
+static const struct button_mapping button_context_yesno[] = {
{ ACTION_YESNO_ACCEPT, BUTTON_PLAY, BUTTON_NONE },
+
LAST_ITEM_IN_LIST
}; /* button_context_settings_yesno */
+/*****************************************************************************
+ * Remote control mappings
+ *****************************************************************************/
+
+static const struct button_mapping remote_button_context_standard[] = {
+ { ACTION_STD_PREV, BUTTON_RC_LEFT, BUTTON_NONE },
+ { ACTION_STD_NEXT, BUTTON_RC_RIGHT, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_RC_STOP, BUTTON_NONE },
+ { ACTION_STD_OK, BUTTON_RC_PLAY, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST
+};
+
+static const struct button_mapping remote_button_context_wps[] = {
+ { ACTION_WPS_PLAY, BUTTON_RC_PLAY, BUTTON_NONE },
+ { ACTION_WPS_SKIPNEXT, BUTTON_RC_RIGHT, BUTTON_NONE },
+ { ACTION_WPS_SKIPPREV, BUTTON_RC_LEFT, BUTTON_NONE },
+ { ACTION_WPS_STOP, BUTTON_RC_STOP, BUTTON_NONE },
+
+ { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
+ { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST
+};
+
+
+static const struct button_mapping* get_context_mapping_remote( int context )
+{
+ context ^= CONTEXT_REMOTE;
+
+ switch (context)
+ {
+ case CONTEXT_WPS:
+ return remote_button_context_wps;
+
+ default:
+ return remote_button_context_standard;
+ }
+}
+
const struct button_mapping* get_context_mapping( int context )
{
- switch( context )
+ if (context&CONTEXT_REMOTE)
+ return get_context_mapping_remote(context);
+
+ switch (context)
{
- case CONTEXT_STD:
- return button_context_standard;
-
case CONTEXT_WPS:
return button_context_wps;
@@ -102,6 +142,7 @@ const struct button_mapping* get_context_mapping( int context )
case CONTEXT_TREE:
return button_context_tree;
+ case CONTEXT_STD:
case CONTEXT_LIST:
case CONTEXT_MAINMENU:
default: