summaryrefslogtreecommitdiff
path: root/apps/keymaps/keymap-recorder.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-recorder.c
parent0fec0f540c1d6fed77a297cb971e1d74021935ef (diff)
downloadrockbox-f39add3d197fd0fcf8f7a381fd0fec76b6a51b95.zip
rockbox-f39add3d197fd0fcf8f7a381fd0fec76b6a51b95.tar.gz
rockbox-f39add3d197fd0fcf8f7a381fd0fec76b6a51b95.tar.bz2
rockbox-f39add3d197fd0fcf8f7a381fd0fec76b6a51b95.tar.xz
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-recorder.c')
-rw-r--r--apps/keymaps/keymap-recorder.c65
1 files changed, 56 insertions, 9 deletions
diff --git a/apps/keymaps/keymap-recorder.c b/apps/keymaps/keymap-recorder.c
index 5dae21c..a16f5ee 100644
--- a/apps/keymaps/keymap-recorder.c
+++ b/apps/keymaps/keymap-recorder.c
@@ -34,7 +34,7 @@ CONTEXT_CUSTOM|1 = the standard list/tree defines (without directions)
*/
-const struct button_mapping button_context_standard[] = {
+static const struct button_mapping button_context_standard[] = {
{ ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
{ ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
@@ -55,7 +55,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 },
@@ -79,7 +79,7 @@ const struct button_mapping button_context_wps[] = {
LAST_ITEM_IN_LIST
};
-const struct button_mapping button_context_settings[] = {
+static const struct button_mapping button_context_settings[] = {
{ ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
{ ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
@@ -88,13 +88,14 @@ const struct button_mapping button_context_settings[] = {
LAST_ITEM_IN_LIST
};
-const struct button_mapping button_context_tree[] = {
+static const struct button_mapping button_context_tree[] = {
{ ACTION_TREE_WPS, BUTTON_PLAY, BUTTON_NONE },
{ ACTION_TREE_STOP, BUTTON_OFF, BUTTON_NONE },
LAST_ITEM_IN_LIST
}; /* button_context_listtree */
-const struct button_mapping button_context_tree_scroll_lr[] = {
+
+static const struct button_mapping button_context_tree_scroll_lr[] = {
{ ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
{ ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
{ ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
@@ -106,12 +107,12 @@ const struct button_mapping button_context_tree_scroll_lr[] = {
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|1),
};
-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
};
-const struct button_mapping button_context_quickscreen[] = {
+static const struct button_mapping button_context_quickscreen[] = {
{ ACTION_QS_DOWNINV, BUTTON_UP, BUTTON_NONE },
{ ACTION_QS_DOWNINV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE },
@@ -125,7 +126,7 @@ const struct button_mapping button_context_quickscreen[] = {
LAST_ITEM_IN_LIST
}; /* button_context_quickscreen */
-const struct button_mapping button_context_pitchscreen[] = {
+static const struct button_mapping button_context_pitchscreen[] = {
{ ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
{ ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
@@ -140,8 +141,51 @@ const struct button_mapping button_context_pitchscreen[] = {
LAST_ITEM_IN_LIST
}; /* button_context_pitchcreen */
+/*****************************************************************************
+ * 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 )
{
+ if (context&CONTEXT_REMOTE)
+ return get_context_mapping_remote(context);
+
switch( context )
{
case CONTEXT_WPS:
@@ -152,17 +196,20 @@ const struct button_mapping* get_context_mapping( int context )
case CONTEXT_YESNOSCREEN:
return button_context_yesno;
+
case CONTEXT_PITCHSCREEN:
return button_context_pitchscreen;
-
+
case CONTEXT_TREE:
if (global_settings.hold_lr_for_scroll_in_list)
return button_context_tree_scroll_lr;
/* else fall through to CUSTOM|1 */
case CONTEXT_CUSTOM|1:
return button_context_tree;
+
case CONTEXT_QUICKSCREEN:
return button_context_quickscreen;
+
case CONTEXT_STD:
case CONTEXT_LIST:
case CONTEXT_MAINMENU: