1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2011 Marcin Bukat
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 /* Button Code Definitions for rk27xx reference design target */
29 * The format of the list is as follows
30 * { Action Code, Button code, Prereq button code }
31 * if there's no need to check the previous button's value, use BUTTON_NONE
32 * Insert LAST_ITEM_IN_LIST at the end of each mapping
34 static const struct button_mapping button_context_standard
[] = {
35 { ACTION_STD_PREV
, BUTTON_REW
, BUTTON_NONE
},
36 { ACTION_STD_PREVREPEAT
, BUTTON_REW
|BUTTON_REPEAT
, BUTTON_NONE
},
37 { ACTION_STD_NEXT
, BUTTON_FF
, BUTTON_NONE
},
38 { ACTION_STD_NEXTREPEAT
, BUTTON_FF
|BUTTON_REPEAT
, BUTTON_NONE
},
39 { ACTION_STD_CONTEXT
, BUTTON_PLAY
|BUTTON_REPEAT
, BUTTON_PLAY
},
40 { ACTION_STD_CANCEL
, BUTTON_VOL
, BUTTON_NONE
},
41 { ACTION_STD_OK
, BUTTON_PLAY
|BUTTON_REL
, BUTTON_PLAY
},
42 { ACTION_STD_MENU
, BUTTON_M
, BUTTON_NONE
},
45 }; /* button_context_standard */
47 static const struct button_mapping button_context_wps
[] = {
48 { ACTION_WPS_PLAY
, BUTTON_PLAY
|BUTTON_REL
, BUTTON_PLAY
},
49 { ACTION_WPS_SKIPNEXT
, BUTTON_FF
|BUTTON_REL
, BUTTON_FF
},
50 { ACTION_WPS_SKIPPREV
, BUTTON_REW
|BUTTON_REL
, BUTTON_REW
},
51 { ACTION_WPS_SEEKBACK
, BUTTON_REW
|BUTTON_REPEAT
, BUTTON_NONE
},
52 { ACTION_WPS_SEEKFWD
, BUTTON_FF
|BUTTON_REPEAT
, BUTTON_NONE
},
53 { ACTION_WPS_STOPSEEK
, BUTTON_REW
|BUTTON_REL
, BUTTON_REW
|BUTTON_REPEAT
},
54 { ACTION_WPS_STOPSEEK
, BUTTON_FF
|BUTTON_REL
, BUTTON_FF
|BUTTON_REPEAT
},
55 { ACTION_WPS_STOP
, BUTTON_PLAY
|BUTTON_REPEAT
, BUTTON_PLAY
},
56 { ACTION_WPS_VOLDOWN
, BUTTON_REW
|BUTTON_VOL
, BUTTON_NONE
},
57 { ACTION_WPS_VOLDOWN
, BUTTON_REW
|BUTTON_VOL
|BUTTON_REPEAT
, BUTTON_NONE
},
58 { ACTION_WPS_VOLUP
, BUTTON_FF
|BUTTON_VOL
, BUTTON_NONE
},
59 { ACTION_WPS_VOLUP
, BUTTON_FF
|BUTTON_VOL
|BUTTON_REPEAT
, BUTTON_NONE
},
61 { ACTION_WPS_BROWSE
, BUTTON_VOL
|BUTTON_REL
, BUTTON_VOL
},
62 { ACTION_WPS_MENU
, BUTTON_M
|BUTTON_REL
, BUTTON_M
},
63 { ACTION_WPS_CONTEXT
, BUTTON_M
|BUTTON_REPEAT
, BUTTON_M
},
64 { ACTION_STD_KEYLOCK
, BUTTON_M
|BUTTON_VOL
, BUTTON_NONE
},
67 }; /* button_context_wps */
71 /* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
72 const struct button_mapping
* get_context_mapping(int context
)
77 return button_context_standard
;
79 return button_context_wps
;
83 case CONTEXT_MAINMENU
:
85 case CONTEXT_SETTINGS
:
86 case CONTEXT_SETTINGS
|CONTEXT_REMOTE
:
88 return button_context_standard
;
90 return button_context_standard
;