diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-08-16 20:12:27 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-08-16 20:12:27 +0000 |
commit | f39add3d197fd0fcf8f7a381fd0fec76b6a51b95 (patch) | |
tree | a1d6e7b4294039d0abecb45a0d736a651a340d32 /apps/keymaps/keymap-player.c | |
parent | 0fec0f540c1d6fed77a297cb971e1d74021935ef (diff) | |
download | rockbox-f39add3d197fd0fcf8f7a381fd0fec76b6a51b95.tar.gz rockbox-f39add3d197fd0fcf8f7a381fd0fec76b6a51b95.zip |
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.c | 65 |
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 @@ | |||
25 | #include "action.h" | 25 | #include "action.h" |
26 | #include "button.h" | 26 | #include "button.h" |
27 | 27 | ||
28 | const struct button_mapping button_context_standard[] = { | 28 | static const struct button_mapping button_context_standard[] = { |
29 | { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, | 29 | { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, |
30 | { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | 30 | { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
31 | { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, | 31 | { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, |
@@ -39,7 +39,7 @@ const struct button_mapping button_context_standard[] = { | |||
39 | LAST_ITEM_IN_LIST | 39 | LAST_ITEM_IN_LIST |
40 | }; | 40 | }; |
41 | 41 | ||
42 | const struct button_mapping button_context_wps[] = { | 42 | static const struct button_mapping button_context_wps[] = { |
43 | { ACTION_WPS_PLAY, BUTTON_PLAY, BUTTON_NONE }, | 43 | { ACTION_WPS_PLAY, BUTTON_PLAY, BUTTON_NONE }, |
44 | { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | 44 | { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, |
45 | { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | 45 | { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, |
@@ -59,37 +59,77 @@ const struct button_mapping button_context_wps[] = { | |||
59 | { ACTION_WPS_CONTEXT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, | 59 | { ACTION_WPS_CONTEXT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, |
60 | { ACTION_WPS_ID3SCREEN, BUTTON_MENU|BUTTON_ON, BUTTON_NONE }, | 60 | { ACTION_WPS_ID3SCREEN, BUTTON_MENU|BUTTON_ON, BUTTON_NONE }, |
61 | 61 | ||
62 | |||
63 | LAST_ITEM_IN_LIST | 62 | LAST_ITEM_IN_LIST |
64 | }; | 63 | }; |
65 | 64 | ||
66 | const struct button_mapping button_context_settings[] = { | 65 | static const struct button_mapping button_context_settings[] = { |
67 | { ACTION_SETTINGS_INC, BUTTON_LEFT, BUTTON_NONE }, | 66 | { ACTION_SETTINGS_INC, BUTTON_LEFT, BUTTON_NONE }, |
68 | { ACTION_SETTINGS_INCREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | 67 | { ACTION_SETTINGS_INCREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
69 | { ACTION_SETTINGS_DEC, BUTTON_RIGHT, BUTTON_NONE }, | 68 | { ACTION_SETTINGS_DEC, BUTTON_RIGHT, BUTTON_NONE }, |
70 | { ACTION_SETTINGS_DECREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | 69 | { ACTION_SETTINGS_DECREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
71 | 70 | ||
72 | LAST_ITEM_IN_LIST | 71 | LAST_ITEM_IN_LIST |
73 | }; | 72 | }; |
74 | 73 | ||
75 | const struct button_mapping button_context_tree[] = { | 74 | static const struct button_mapping button_context_tree[] = { |
76 | { ACTION_TREE_WPS, BUTTON_ON, BUTTON_NONE }, | 75 | { ACTION_TREE_WPS, BUTTON_ON, BUTTON_NONE }, |
77 | 76 | ||
78 | LAST_ITEM_IN_LIST | 77 | LAST_ITEM_IN_LIST |
79 | }; /* button_context_listtree */ | 78 | }; /* button_context_listtree */ |
80 | 79 | ||
81 | const struct button_mapping button_context_yesno[] = { | 80 | static const struct button_mapping button_context_yesno[] = { |
82 | { ACTION_YESNO_ACCEPT, BUTTON_PLAY, BUTTON_NONE }, | 81 | { ACTION_YESNO_ACCEPT, BUTTON_PLAY, BUTTON_NONE }, |
82 | |||
83 | LAST_ITEM_IN_LIST | 83 | LAST_ITEM_IN_LIST |
84 | }; /* button_context_settings_yesno */ | 84 | }; /* button_context_settings_yesno */ |
85 | 85 | ||
86 | /***************************************************************************** | ||
87 | * Remote control mappings | ||
88 | *****************************************************************************/ | ||
89 | |||
90 | static const struct button_mapping remote_button_context_standard[] = { | ||
91 | { ACTION_STD_PREV, BUTTON_RC_LEFT, BUTTON_NONE }, | ||
92 | { ACTION_STD_NEXT, BUTTON_RC_RIGHT, BUTTON_NONE }, | ||
93 | { ACTION_STD_CANCEL, BUTTON_RC_STOP, BUTTON_NONE }, | ||
94 | { ACTION_STD_OK, BUTTON_RC_PLAY, BUTTON_NONE }, | ||
95 | |||
96 | LAST_ITEM_IN_LIST | ||
97 | }; | ||
98 | |||
99 | static const struct button_mapping remote_button_context_wps[] = { | ||
100 | { ACTION_WPS_PLAY, BUTTON_RC_PLAY, BUTTON_NONE }, | ||
101 | { ACTION_WPS_SKIPNEXT, BUTTON_RC_RIGHT, BUTTON_NONE }, | ||
102 | { ACTION_WPS_SKIPPREV, BUTTON_RC_LEFT, BUTTON_NONE }, | ||
103 | { ACTION_WPS_STOP, BUTTON_RC_STOP, BUTTON_NONE }, | ||
104 | |||
105 | { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, | ||
106 | { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE }, | ||
107 | |||
108 | LAST_ITEM_IN_LIST | ||
109 | }; | ||
110 | |||
111 | |||
112 | static const struct button_mapping* get_context_mapping_remote( int context ) | ||
113 | { | ||
114 | context ^= CONTEXT_REMOTE; | ||
115 | |||
116 | switch (context) | ||
117 | { | ||
118 | case CONTEXT_WPS: | ||
119 | return remote_button_context_wps; | ||
120 | |||
121 | default: | ||
122 | return remote_button_context_standard; | ||
123 | } | ||
124 | } | ||
125 | |||
86 | const struct button_mapping* get_context_mapping( int context ) | 126 | const struct button_mapping* get_context_mapping( int context ) |
87 | { | 127 | { |
88 | switch( context ) | 128 | if (context&CONTEXT_REMOTE) |
129 | return get_context_mapping_remote(context); | ||
130 | |||
131 | switch (context) | ||
89 | { | 132 | { |
90 | case CONTEXT_STD: | ||
91 | return button_context_standard; | ||
92 | |||
93 | case CONTEXT_WPS: | 133 | case CONTEXT_WPS: |
94 | return button_context_wps; | 134 | return button_context_wps; |
95 | 135 | ||
@@ -102,6 +142,7 @@ const struct button_mapping* get_context_mapping( int context ) | |||
102 | case CONTEXT_TREE: | 142 | case CONTEXT_TREE: |
103 | return button_context_tree; | 143 | return button_context_tree; |
104 | 144 | ||
145 | case CONTEXT_STD: | ||
105 | case CONTEXT_LIST: | 146 | case CONTEXT_LIST: |
106 | case CONTEXT_MAINMENU: | 147 | case CONTEXT_MAINMENU: |
107 | default: | 148 | default: |