diff options
Diffstat (limited to 'apps/keymaps')
-rw-r--r-- | apps/keymaps/keymap-mpio-hd200.c | 172 |
1 files changed, 172 insertions, 0 deletions
diff --git a/apps/keymaps/keymap-mpio-hd200.c b/apps/keymaps/keymap-mpio-hd200.c new file mode 100644 index 0000000000..95dec41d85 --- /dev/null +++ b/apps/keymaps/keymap-mpio-hd200.c | |||
@@ -0,0 +1,172 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id:$ | ||
9 | * | ||
10 | * Copyright (C) 2010 Marcin Bukat | ||
11 | * | ||
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. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "config.h" | ||
22 | #include "action.h" | ||
23 | #include "button.h" | ||
24 | #include "settings.h" | ||
25 | |||
26 | /* | ||
27 | * The format of the list is as follows | ||
28 | * { Action Code, Button code, Prereq button code } | ||
29 | * if there's no need to check the previous button's value, use BUTTON_NONE | ||
30 | * Insert LAST_ITEM_IN_LIST at the end of each mapping | ||
31 | */ | ||
32 | |||
33 | /* CONTEXT_CUSTOM's used in this file... | ||
34 | |||
35 | CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) | ||
36 | |||
37 | |||
38 | */ | ||
39 | |||
40 | static const struct button_mapping button_context_standard[] = { | ||
41 | { ACTION_STD_PREV, BUTTON_PREV, BUTTON_NONE }, | ||
42 | { ACTION_STD_PREVREPEAT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, | ||
43 | { ACTION_STD_NEXT, BUTTON_NEXT, BUTTON_NONE }, | ||
44 | { ACTION_STD_NEXTREPEAT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, | ||
45 | { ACTION_STD_CANCEL, BUTTON_REC|BUTTON_REL, BUTTON_REC }, | ||
46 | { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
47 | { ACTION_STD_MENU, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC }, | ||
48 | { ACTION_STD_QUICKSCREEN, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, | ||
49 | { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | ||
50 | |||
51 | LAST_ITEM_IN_LIST | ||
52 | }; /* button_context_standard */ | ||
53 | |||
54 | static const struct button_mapping button_context_tree[] = { | ||
55 | { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, | ||
56 | { ACTION_TREE_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, | ||
57 | |||
58 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
59 | }; /* button_context_tree */ | ||
60 | |||
61 | static const struct button_mapping button_context_tree_scroll_lr[] = { | ||
62 | { ACTION_NONE, BUTTON_PREV, BUTTON_NONE }, | ||
63 | { ACTION_STD_CANCEL, BUTTON_PREV|BUTTON_REL, BUTTON_PREV }, | ||
64 | { ACTION_TREE_ROOT_INIT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_PREV }, | ||
65 | { ACTION_TREE_PGLEFT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, | ||
66 | { ACTION_TREE_PGLEFT, BUTTON_PREV|BUTTON_REL, BUTTON_PREV|BUTTON_REPEAT }, | ||
67 | { ACTION_NONE, BUTTON_NEXT, BUTTON_NONE }, | ||
68 | { ACTION_STD_OK, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT }, | ||
69 | { ACTION_TREE_PGRIGHT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, | ||
70 | { ACTION_TREE_PGRIGHT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT|BUTTON_REPEAT }, | ||
71 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), | ||
72 | }; /* button_context_tree_scroll_lr */ | ||
73 | |||
74 | static const struct button_mapping button_context_wps[] = { | ||
75 | { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, | ||
76 | { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, | ||
77 | { ACTION_WPS_SKIPPREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV }, | ||
78 | { ACTION_WPS_SEEKBACK, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, | ||
79 | { ACTION_WPS_STOPSEEK, BUTTON_PREV|BUTTON_REL, BUTTON_PREV|BUTTON_REPEAT }, | ||
80 | { ACTION_WPS_SKIPNEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT }, | ||
81 | { ACTION_WPS_SEEKFWD, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, | ||
82 | { ACTION_WPS_STOPSEEK, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT|BUTTON_REPEAT }, | ||
83 | { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
84 | { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
85 | { ACTION_WPS_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, | ||
86 | { ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
87 | { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
88 | { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | ||
89 | { ACTION_WPS_MENU, BUTTON_REC|BUTTON_REL, BUTTON_REC }, | ||
90 | { ACTION_WPS_QUICKSCREEN, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | ||
91 | |||
92 | LAST_ITEM_IN_LIST, | ||
93 | }; /* button_context_wps */ | ||
94 | |||
95 | static const struct button_mapping button_context_settings[] = { | ||
96 | { ACTION_SETTINGS_INC, BUTTON_VOL_UP, BUTTON_NONE }, | ||
97 | { ACTION_SETTINGS_INCREPEAT, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
98 | { ACTION_SETTINGS_DEC, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
99 | { ACTION_SETTINGS_DECREPEAT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
100 | { ACTION_STD_PREV, BUTTON_PREV, BUTTON_NONE }, | ||
101 | { ACTION_STD_PREVREPEAT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, | ||
102 | { ACTION_STD_NEXT, BUTTON_NEXT, BUTTON_NONE }, | ||
103 | { ACTION_STD_NEXTREPEAT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, | ||
104 | { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, | ||
105 | { ACTION_STD_CANCEL, BUTTON_REC|BUTTON_REL, BUTTON_REC }, | ||
106 | |||
107 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
108 | }; /* button_context_settings */ | ||
109 | |||
110 | static const struct button_mapping button_context_yesno[] = { | ||
111 | { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE }, | ||
112 | LAST_ITEM_IN_LIST | ||
113 | }; /* button_context_yesno */ | ||
114 | |||
115 | static const struct button_mapping button_context_bmark[] = { | ||
116 | { ACTION_BMS_DELETE, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | ||
117 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), | ||
118 | }; /* button_context_bmark */ | ||
119 | |||
120 | static const struct button_mapping button_context_quickscreen[] = { | ||
121 | { ACTION_QS_TOP, BUTTON_SELECT, BUTTON_NONE }, | ||
122 | { ACTION_QS_TOP, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE }, | ||
123 | { ACTION_QS_DOWN, BUTTON_PLAY, BUTTON_NONE }, | ||
124 | { ACTION_QS_DOWN, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, | ||
125 | { ACTION_QS_LEFT, BUTTON_PREV, BUTTON_NONE }, | ||
126 | { ACTION_QS_LEFT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, | ||
127 | { ACTION_QS_RIGHT, BUTTON_NEXT, BUTTON_NONE }, | ||
128 | { ACTION_QS_RIGHT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, | ||
129 | { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE }, | ||
130 | |||
131 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
132 | }; /* button_context_quickscreen */ | ||
133 | |||
134 | static const struct button_mapping button_context_pitchscreen[] = { | ||
135 | { ACTION_PS_INC_SMALL, BUTTON_VOL_UP, BUTTON_NONE }, | ||
136 | { ACTION_PS_INC_BIG, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
137 | { ACTION_PS_DEC_SMALL, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
138 | { ACTION_PS_DEC_BIG, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
139 | { ACTION_PS_NUDGE_LEFT, BUTTON_PREV, BUTTON_NONE }, | ||
140 | { ACTION_PS_NUDGE_LEFTOFF, BUTTON_PREV|BUTTON_REL, BUTTON_NONE }, | ||
141 | { ACTION_PS_NUDGE_RIGHT, BUTTON_NEXT, BUTTON_NONE }, | ||
142 | { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_NEXT|BUTTON_REL, BUTTON_NONE }, | ||
143 | { ACTION_PS_TOGGLE_MODE, BUTTON_PLAY, BUTTON_NONE }, | ||
144 | { ACTION_PS_RESET, BUTTON_SELECT, BUTTON_NONE }, | ||
145 | { ACTION_PS_EXIT, BUTTON_REC, BUTTON_NONE }, | ||
146 | { ACTION_PS_SLOWER, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, | ||
147 | { ACTION_PS_FASTER, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, | ||
148 | |||
149 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
150 | }; /* button_context_pitchscreen */ | ||
151 | |||
152 | const struct button_mapping* get_context_mapping(int context) | ||
153 | { | ||
154 | switch (context) | ||
155 | { | ||
156 | case CONTEXT_STD: | ||
157 | return button_context_standard; | ||
158 | case CONTEXT_WPS: | ||
159 | return button_context_wps; | ||
160 | |||
161 | case CONTEXT_TREE: | ||
162 | case CONTEXT_LIST: | ||
163 | case CONTEXT_MAINMENU: | ||
164 | |||
165 | case CONTEXT_SETTINGS: | ||
166 | case CONTEXT_SETTINGS|CONTEXT_REMOTE: | ||
167 | default: | ||
168 | return button_context_standard; | ||
169 | } | ||
170 | return button_context_standard; | ||
171 | } | ||
172 | |||