diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2010-07-06 16:20:38 +0000 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2010-07-06 16:20:38 +0000 |
commit | 76f2b9c6056d3b5dd29503fa77323aac5088e1e6 (patch) | |
tree | d8686c64755d7e4b95b5fb5b154312819ec51b0e | |
parent | 72e463fae9fb352352bb6ba1f5da12aa4a3c10dd (diff) | |
download | rockbox-76f2b9c6056d3b5dd29503fa77323aac5088e1e6.tar.gz rockbox-76f2b9c6056d3b5dd29503fa77323aac5088e1e6.zip |
HD200 - add remote keymap
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27312 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/keymaps/keymap-mpio-hd200.c | 165 |
1 files changed, 155 insertions, 10 deletions
diff --git a/apps/keymaps/keymap-mpio-hd200.c b/apps/keymaps/keymap-mpio-hd200.c index 58a95046b4..7286c3789c 100644 --- a/apps/keymaps/keymap-mpio-hd200.c +++ b/apps/keymaps/keymap-mpio-hd200.c | |||
@@ -30,12 +30,9 @@ | |||
30 | * Insert LAST_ITEM_IN_LIST at the end of each mapping | 30 | * Insert LAST_ITEM_IN_LIST at the end of each mapping |
31 | */ | 31 | */ |
32 | 32 | ||
33 | /* CONTEXT_CUSTOM's used in this file... | 33 | /***************************************************************************** |
34 | 34 | * Main control mappings | |
35 | CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) | 35 | *****************************************************************************/ |
36 | |||
37 | |||
38 | */ | ||
39 | 36 | ||
40 | static const struct button_mapping button_context_standard[] = { | 37 | static const struct button_mapping button_context_standard[] = { |
41 | { ACTION_STD_PREV, BUTTON_PREV, BUTTON_NONE }, | 38 | { ACTION_STD_PREV, BUTTON_PREV, BUTTON_NONE }, |
@@ -83,8 +80,8 @@ static const struct button_mapping button_context_wps[] = { | |||
83 | /* { ACTION_WPS_PITCHSCREEN, BUTTON_, BUTTON_ }, */ | 80 | /* { ACTION_WPS_PITCHSCREEN, BUTTON_, BUTTON_ }, */ |
84 | /* { ACTION_WPS_ID3SCREEN, BUTTON_, BUTTON_ }, */ | 81 | /* { ACTION_WPS_ID3SCREEN, BUTTON_, BUTTON_ }, */ |
85 | { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | 82 | { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, |
86 | { ACTION_WPS_QUICKSCREEN, BUTTON_REC|BUTTON_REL, BUTTON_REC }, | 83 | { ACTION_WPS_QUICKSCREEN, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC }, |
87 | { ACTION_WPS_MENU, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC }, | 84 | { ACTION_WPS_MENU, BUTTON_REC|BUTTON_REL, BUTTON_REC }, |
88 | /* { ACTION_WPS_VIEW_PLAYLIST, BUTTON_, BUTTON_ }, */ | 85 | /* { ACTION_WPS_VIEW_PLAYLIST, BUTTON_, BUTTON_ }, */ |
89 | /* { ACTION_WPS_REC, BUTTON_, BUTTON_ }, */ | 86 | /* { ACTION_WPS_REC, BUTTON_, BUTTON_ }, */ |
90 | /* { ACTION_WPS_ABSETA_PREVDIR, BUTTON_, BUTTON_ }, */ | 87 | /* { ACTION_WPS_ABSETA_PREVDIR, BUTTON_, BUTTON_ }, */ |
@@ -169,7 +166,7 @@ static const struct button_mapping button_context_radio[] = { | |||
169 | static const struct button_mapping button_context_recscreen[] = { | 166 | static const struct button_mapping button_context_recscreen[] = { |
170 | /* { ACTION_REC_LCD, BUTTON_, BUTTON_ }, */ | 167 | /* { ACTION_REC_LCD, BUTTON_, BUTTON_ }, */ |
171 | { ACTION_REC_PAUSE, BUTTON_PLAY, BUTTON_NONE }, | 168 | { ACTION_REC_PAUSE, BUTTON_PLAY, BUTTON_NONE }, |
172 | { ACTION_REC_NEWFILE, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC }, | 169 | { ACTION_REC_NEWFILE, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, |
173 | /* { ACTION_REC_F2, BUTTON_, BUTTON_ }, */ | 170 | /* { ACTION_REC_F2, BUTTON_, BUTTON_ }, */ |
174 | /* { ACTION_REC_F3, BUTTON_, BUTTON_ }, */ | 171 | /* { ACTION_REC_F3, BUTTON_, BUTTON_ }, */ |
175 | 172 | ||
@@ -198,8 +195,157 @@ static const struct button_mapping button_context_keyboard[] = { | |||
198 | LAST_ITEM_IN_LIST | 195 | LAST_ITEM_IN_LIST |
199 | }; /* button_context_keyboard */ | 196 | }; /* button_context_keyboard */ |
200 | 197 | ||
198 | /***************************************************************************** | ||
199 | * Remote control mappings | ||
200 | *****************************************************************************/ | ||
201 | |||
202 | static const struct button_mapping button_rc_context_standard[] = { | ||
203 | { ACTION_STD_PREV, BUTTON_RC_PREV, BUTTON_NONE }, | ||
204 | { ACTION_STD_PREVREPEAT, BUTTON_RC_PREV|BUTTON_REPEAT, BUTTON_NONE }, | ||
205 | { ACTION_STD_NEXT, BUTTON_RC_NEXT, BUTTON_NONE }, | ||
206 | { ACTION_STD_NEXTREPEAT, BUTTON_RC_NEXT|BUTTON_REPEAT, BUTTON_NONE }, | ||
207 | { ACTION_STD_OK, BUTTON_RC_SELECT|BUTTON_REL, BUTTON_RC_SELECT }, | ||
208 | { ACTION_STD_CANCEL, BUTTON_RC_PLAY|BUTTON_RC_SELECT, BUTTON_RC_SELECT }, | ||
209 | { ACTION_STD_CONTEXT, BUTTON_RC_SELECT|BUTTON_REPEAT, BUTTON_RC_SELECT }, | ||
210 | { ACTION_STD_MENU, BUTTON_RC_SELECT|BUTTON_RC_PLAY, BUTTON_RC_SELECT }, | ||
211 | /* { ACTION_STD_QUICKSCREEN, BUTTON_, BUTTON_ }, */ | ||
212 | /* { ACTION_STD_KEYLOCK, BUTTON_, BUTTON_ }, */ | ||
213 | /* { ACTION_STD_REC, BUTTON_, BUTTON_ }, */ | ||
214 | /* { ACTION_STD_HOTKEY, BUTTON_, BUTTON_ }, */ | ||
215 | /* { ACTION_F3, BUTTON_, BUTTON_ }, */ | ||
216 | |||
217 | LAST_ITEM_IN_LIST | ||
218 | }; /* button_context_standard */ | ||
219 | |||
220 | static const struct button_mapping button_rc_context_tree[] = { | ||
221 | /* { ACTION_TREE_ROOT_INIT, BUTTON_, BUTTON_ }, */ | ||
222 | /* { ACTION_TREE_PGLEFT, BUTTON_, BUTTON_ }, */ | ||
223 | /* { ACTION_TREE_PGRIGHT, BUTTON_, BUTTON_ }, */ | ||
224 | { ACTION_TREE_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY }, | ||
225 | { ACTION_TREE_WPS, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY }, | ||
226 | /* { ACTION_TREE_HOTKEY, BUTTON_, BUTTON_ }, */ | ||
227 | |||
228 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
229 | }; /* button_context_tree */ | ||
230 | |||
231 | static const struct button_mapping button_rc_context_wps[] = { | ||
232 | { ACTION_WPS_BROWSE, BUTTON_RC_SELECT|BUTTON_REL, BUTTON_RC_SELECT }, | ||
233 | { ACTION_WPS_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY }, | ||
234 | { ACTION_WPS_SEEKBACK, BUTTON_RC_PREV|BUTTON_REPEAT, BUTTON_NONE }, | ||
235 | { ACTION_WPS_SEEKFWD, BUTTON_RC_NEXT|BUTTON_REPEAT, BUTTON_NONE }, | ||
236 | { ACTION_WPS_STOPSEEK, BUTTON_RC_PREV|BUTTON_REL, BUTTON_RC_PREV|BUTTON_REPEAT }, | ||
237 | { ACTION_WPS_STOPSEEK, BUTTON_RC_NEXT|BUTTON_REL, BUTTON_RC_NEXT|BUTTON_REPEAT }, | ||
238 | { ACTION_WPS_SKIPNEXT, BUTTON_RC_NEXT|BUTTON_REL, BUTTON_RC_NEXT }, | ||
239 | { ACTION_WPS_SKIPPREV, BUTTON_RC_PREV|BUTTON_REL, BUTTON_RC_PREV }, | ||
240 | { ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY }, | ||
241 | { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, | ||
242 | { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
243 | { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE }, | ||
244 | { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
245 | /* { ACTION_WPS_PITCHSCREEN, BUTTON_, BUTTON_ }, */ | ||
246 | /* { ACTION_WPS_ID3SCREEN, BUTTON_, BUTTON_ }, */ | ||
247 | { ACTION_WPS_CONTEXT, BUTTON_RC_SELECT|BUTTON_REPEAT, BUTTON_RC_SELECT }, | ||
248 | /* { ACTION_WPS_QUICKSCREEN, BUTTON_REC|BUTTON_REL, BUTTON_REC }, */ | ||
249 | { ACTION_WPS_MENU, BUTTON_RC_SELECT|BUTTON_RC_PLAY, BUTTON_RC_SELECT }, | ||
250 | /* { ACTION_WPS_VIEW_PLAYLIST, BUTTON_, BUTTON_ }, */ | ||
251 | /* { ACTION_WPS_REC, BUTTON_, BUTTON_ }, */ | ||
252 | /* { ACTION_WPS_ABSETA_PREVDIR, BUTTON_, BUTTON_ }, */ | ||
253 | /* { ACTION_WPS_ABSETB_NEXTDIR, BUTTON_, BUTTON_ }, */ | ||
254 | /* { ACTION_WPS_ABRESET, BUTTON_, BUTTON_ }, */ | ||
255 | /* { ACTION_WPS_HOTKEY, BUTTON_, BUTTON_ }, */ | ||
256 | |||
257 | LAST_ITEM_IN_LIST, | ||
258 | }; /* button_context_wps */ | ||
259 | |||
260 | static const struct button_mapping button_rc_context_settings[] = { | ||
261 | { ACTION_SETTINGS_INC, BUTTON_RC_VOL_UP, BUTTON_NONE }, | ||
262 | { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
263 | /* { ACTION_SETTINGS_INCBIGSTEP,BUTTON_, BUTTON_ }, */ | ||
264 | { ACTION_SETTINGS_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, | ||
265 | { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
266 | /* { ACTION_SETTINGS_DECBIGSTEP,BUTTON_, BUTTON_ }, */ | ||
267 | |||
268 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
269 | }; /* button_context_settings */ | ||
270 | |||
271 | static const struct button_mapping button_rc_context_yesno[] = { | ||
272 | { ACTION_YESNO_ACCEPT, BUTTON_RC_SELECT, BUTTON_NONE }, | ||
273 | { ACTION_YESNO_ACCEPT, BUTTON_RC_PLAY, BUTTON_NONE }, | ||
274 | |||
275 | LAST_ITEM_IN_LIST | ||
276 | }; /* button_context_yesno */ | ||
277 | |||
278 | static const struct button_mapping button_rc_context_radio[] = { | ||
279 | { ACTION_FM_MENU, BUTTON_RC_SELECT|BUTTON_REPEAT, BUTTON_NONE }, | ||
280 | { ACTION_FM_PRESET, BUTTON_RC_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
281 | /* { ACTION_FM_RECORD, BUTTON_, BUTTON_ }, */ | ||
282 | /* { ACTION_FM_FREEZE, BUTTON_, BUTTON_ }, */ | ||
283 | { ACTION_FM_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, | ||
284 | { ACTION_FM_MODE, BUTTON_RC_SELECT, BUTTON_NONE }, | ||
285 | { ACTION_FM_EXIT, BUTTON_RC_SELECT|BUTTON_RC_PLAY, BUTTON_RC_SELECT }, | ||
286 | { ACTION_FM_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_PLAY }, | ||
287 | /* { ACTION_FM_RECORD_DBLPRE, BUTTON_, BUTTON_ }, */ | ||
288 | /* { ACTION_FM_NEXT_PRESET, BUTTON_, BUTTON_ }, */ | ||
289 | /* { ACTION_FM_PREV_PRESET, BUTTON_, BUTTON_ }, */ | ||
290 | |||
291 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) | ||
292 | }; /* button_context_radio */ | ||
293 | |||
294 | static const struct button_mapping button_rc_context_recscreen[] = { | ||
295 | /* { ACTION_REC_LCD, BUTTON_, BUTTON_ }, */ | ||
296 | { ACTION_REC_PAUSE, BUTTON_RC_PLAY, BUTTON_NONE }, | ||
297 | { ACTION_REC_NEWFILE, BUTTON_RC_SELECT|BUTTON_REPEAT, BUTTON_RC_SELECT }, | ||
298 | /* { ACTION_REC_F2, BUTTON_, BUTTON_ }, */ | ||
299 | /* { ACTION_REC_F3, BUTTON_, BUTTON_ }, */ | ||
300 | |||
301 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) | ||
302 | }; /* button_context_recscreen */ | ||
303 | |||
304 | static const struct button_mapping* get_context_mapping_remote(int context) | ||
305 | { | ||
306 | context ^= CONTEXT_REMOTE; | ||
307 | |||
308 | switch (context) | ||
309 | { | ||
310 | case CONTEXT_STD: | ||
311 | return button_rc_context_standard; | ||
312 | |||
313 | case CONTEXT_WPS: | ||
314 | return button_rc_context_wps; | ||
315 | |||
316 | #if CONFIG_TUNER | ||
317 | case CONTEXT_FM: | ||
318 | return button_rc_context_radio; | ||
319 | #endif | ||
320 | |||
321 | #ifdef HAVE_RECORDING | ||
322 | case CONTEXT_RECSCREEN: | ||
323 | return button_rc_context_recscreen; | ||
324 | #endif | ||
325 | |||
326 | case CONTEXT_YESNOSCREEN: | ||
327 | return button_rc_context_yesno; | ||
328 | |||
329 | case CONTEXT_SETTINGS: | ||
330 | case CONTEXT_SETTINGS_EQ: | ||
331 | return button_rc_context_settings; | ||
332 | |||
333 | case CONTEXT_TREE: | ||
334 | case CONTEXT_MAINMENU: | ||
335 | case CONTEXT_CUSTOM|CONTEXT_TREE: | ||
336 | return button_rc_context_tree; | ||
337 | |||
338 | case CONTEXT_LIST: | ||
339 | default: | ||
340 | return button_rc_context_standard; | ||
341 | } | ||
342 | } | ||
343 | |||
201 | const struct button_mapping* get_context_mapping(int context) | 344 | const struct button_mapping* get_context_mapping(int context) |
202 | { | 345 | { |
346 | if (context&CONTEXT_REMOTE) | ||
347 | return get_context_mapping_remote(context); | ||
348 | |||
203 | switch (context) | 349 | switch (context) |
204 | { | 350 | { |
205 | case CONTEXT_STD: | 351 | case CONTEXT_STD: |
@@ -236,7 +382,6 @@ const struct button_mapping* get_context_mapping(int context) | |||
236 | 382 | ||
237 | case CONTEXT_SETTINGS: | 383 | case CONTEXT_SETTINGS: |
238 | case CONTEXT_SETTINGS_EQ: | 384 | case CONTEXT_SETTINGS_EQ: |
239 | case CONTEXT_SETTINGS|CONTEXT_REMOTE: | ||
240 | return button_context_settings; | 385 | return button_context_settings; |
241 | 386 | ||
242 | case CONTEXT_TREE: | 387 | case CONTEXT_TREE: |