as3525v1 use an as3515 audio codec/PMU, not an as3517 as previously thought
[kugel-rb.git] / apps / keymaps / keymap-m3.c
blobb6968e6ff0eab500a8f95aabe99cc86e982a8e8e
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2008 Jens Arnold
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 /* *
23 * Button Code Definitions for iaudio M3 targets
26 #include "config.h"
27 #include "action.h"
28 #include "button.h"
29 #include "settings.h"
31 /* CONTEXT_CUSTOM's used in this file...
33 CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions)
38 /** Keep things alphabetized for easy reference but standard contexts can
39 ** be first and sub-alphebetized.
40 **/
42 /** Standard Button Contexts **/
43 static const struct button_mapping button_context_standard[] = {
44 { ACTION_STD_PREV, BUTTON_VOL_UP, BUTTON_NONE },
45 { ACTION_STD_PREVREPEAT, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
46 { ACTION_STD_NEXT, BUTTON_VOL_DOWN, BUTTON_NONE },
47 { ACTION_STD_NEXTREPEAT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
49 { ACTION_STD_CONTEXT, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE },
50 { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
51 { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
52 { ACTION_STD_OK, BUTTON_PLAY, BUTTON_NONE },
53 { ACTION_STD_MENU, BUTTON_REC|BUTTON_REL, BUTTON_REC },
54 { ACTION_STD_QUICKSCREEN, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
56 LAST_ITEM_IN_LIST
57 }; /* button_context_standard */
59 static const struct button_mapping remote_button_context_standard[] = {
60 { ACTION_STD_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE },
61 { ACTION_STD_PREVREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
62 { ACTION_STD_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
63 { ACTION_STD_NEXTREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
65 { ACTION_STD_CONTEXT, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
66 { ACTION_STD_CANCEL, BUTTON_RC_REW, BUTTON_NONE },
67 { ACTION_STD_OK, BUTTON_RC_FF, BUTTON_NONE },
68 { ACTION_STD_OK, BUTTON_RC_PLAY, BUTTON_NONE },
69 { ACTION_STD_MENU, BUTTON_RC_MENU|BUTTON_REL, BUTTON_RC_MENU },
70 { ACTION_STD_QUICKSCREEN, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_RC_MENU },
72 LAST_ITEM_IN_LIST
73 }; /* remote_button_context_standard */
75 /** Bookmark Screen **/
76 static const struct button_mapping button_context_bmark[] = {
77 { ACTION_BMS_DELETE, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
79 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
80 }; /* button_context_settings_bmark */
82 static const struct button_mapping remote_button_context_bmark[] = {
83 { ACTION_BMS_DELETE, BUTTON_RC_REC|BUTTON_REPEAT, BUTTON_RC_REC },
85 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
86 }; /* button_context_settings_bmark */
88 /** FM Radio Screen **/
89 static const struct button_mapping button_context_radio[] = {
90 { ACTION_FM_MENU, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE },
91 { ACTION_FM_PRESET, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
92 { ACTION_FM_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
93 { ACTION_FM_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
94 { ACTION_FM_MODE, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
95 { ACTION_FM_EXIT, BUTTON_REC|BUTTON_REL, BUTTON_REC },
96 { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
97 { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
98 { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
99 //{ ACTION_FM_QUICKSCREEN, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
101 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
102 }; /* button_context_radio */
104 static const struct button_mapping remote_button_context_radio[] = {
105 { ACTION_FM_MENU, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
106 { ACTION_FM_PRESET, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE },
107 { ACTION_FM_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
108 { ACTION_FM_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
109 { ACTION_FM_MODE, BUTTON_RC_REC|BUTTON_REPEAT, BUTTON_RC_REC },
110 { ACTION_FM_EXIT, BUTTON_RC_MENU, BUTTON_NONE },
111 { ACTION_STD_PREVREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
112 { ACTION_STD_NEXT, BUTTON_RC_FF, BUTTON_NONE },
113 { ACTION_STD_NEXTREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
115 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
116 }; /* remote_button_context_radio */
118 /** Keyboard **/
119 static const struct button_mapping button_context_keyboard[] = {
120 { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
121 { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
122 { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
123 { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
124 { ACTION_KBD_UP, BUTTON_VOL_UP, BUTTON_NONE },
125 { ACTION_KBD_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
126 { ACTION_KBD_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
127 { ACTION_KBD_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
128 { ACTION_KBD_PAGE_FLIP, BUTTON_MODE, BUTTON_NONE },
129 { ACTION_KBD_SELECT, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
130 { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
131 { ACTION_KBD_ABORT, BUTTON_REC, BUTTON_NONE },
133 LAST_ITEM_IN_LIST
134 }; /* button_context_keyboard */
136 static const struct button_mapping remote_button_context_keyboard[] = {
137 { ACTION_KBD_LEFT, BUTTON_RC_REW, BUTTON_NONE },
138 { ACTION_KBD_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
139 { ACTION_KBD_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
140 { ACTION_KBD_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
141 { ACTION_KBD_UP, BUTTON_RC_VOL_UP, BUTTON_NONE },
142 { ACTION_KBD_UP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
143 { ACTION_KBD_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
144 { ACTION_KBD_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
145 { ACTION_KBD_PAGE_FLIP, BUTTON_RC_MODE, BUTTON_NONE },
146 { ACTION_KBD_SELECT, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
147 { ACTION_KBD_DONE, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
148 { ACTION_KBD_ABORT, BUTTON_RC_REC, BUTTON_NONE },
150 LAST_ITEM_IN_LIST
151 }; /* remote_button_context_keyboard */
153 /** Pitchscreen **/
154 static const struct button_mapping button_context_pitchscreen[] = {
155 { ACTION_PS_INC_SMALL, BUTTON_VOL_UP, BUTTON_NONE },
156 { ACTION_PS_INC_BIG, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
157 { ACTION_PS_DEC_SMALL, BUTTON_VOL_DOWN, BUTTON_NONE },
158 { ACTION_PS_DEC_BIG, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
159 { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
160 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
161 { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
162 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
163 { ACTION_PS_TOGGLE_MODE, BUTTON_MODE, BUTTON_NONE },
164 { ACTION_PS_RESET, BUTTON_REC, BUTTON_NONE },
165 { ACTION_PS_EXIT, BUTTON_PLAY, BUTTON_NONE },
166 { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
167 { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
169 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
170 }; /* button_context_pitchscreen */
172 static const struct button_mapping remote_button_context_pitchscreen[] = {
173 { ACTION_PS_INC_SMALL, BUTTON_RC_VOL_UP, BUTTON_NONE },
174 { ACTION_PS_INC_BIG, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
175 { ACTION_PS_DEC_SMALL, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
176 { ACTION_PS_DEC_BIG, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
177 { ACTION_PS_NUDGE_LEFT, BUTTON_RC_REW, BUTTON_NONE },
178 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_RC_REW|BUTTON_REL, BUTTON_NONE },
179 { ACTION_PS_NUDGE_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
180 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RC_FF|BUTTON_REL, BUTTON_NONE },
181 { ACTION_PS_TOGGLE_MODE, BUTTON_RC_MODE, BUTTON_NONE },
182 { ACTION_PS_RESET, BUTTON_RC_REC, BUTTON_NONE },
183 { ACTION_PS_EXIT, BUTTON_RC_PLAY, BUTTON_NONE },
184 { ACTION_PS_SLOWER, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
185 { ACTION_PS_FASTER, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
187 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
188 }; /* remote_button_context_pitchscreen */
190 /** Quickscreen **/
191 static const struct button_mapping button_context_quickscreen[] = {
192 { ACTION_QS_TOP, BUTTON_VOL_UP, BUTTON_NONE },
193 { ACTION_QS_TOP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
194 { ACTION_QS_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
195 { ACTION_QS_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
196 { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE },
197 { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
198 { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
199 { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
200 { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE },
202 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
203 }; /* button_context_quickscreen */
205 static const struct button_mapping remote_button_context_quickscreen[] = {
206 { ACTION_QS_TOP, BUTTON_RC_VOL_UP, BUTTON_NONE },
207 { ACTION_QS_TOP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
208 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
209 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
210 { ACTION_QS_LEFT, BUTTON_RC_REW, BUTTON_NONE },
211 { ACTION_QS_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
212 { ACTION_QS_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
213 { ACTION_QS_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
214 { ACTION_STD_CANCEL, BUTTON_RC_REC, BUTTON_NONE },
216 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
217 }; /* remote_button_context_quickscreen */
219 /** Recording Screen **/
220 static const struct button_mapping button_context_recscreen[] = {
221 { ACTION_REC_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
222 { ACTION_STD_CANCEL, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
223 { ACTION_REC_NEWFILE, BUTTON_REC|BUTTON_REL, BUTTON_REC },
224 { ACTION_STD_MENU, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
225 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
226 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
227 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
228 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
230 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
231 }; /* button_context_recscreen */
233 static const struct button_mapping remote_button_context_recscreen[] = {
234 { ACTION_REC_PAUSE, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
235 { ACTION_STD_CANCEL, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
236 { ACTION_REC_NEWFILE, BUTTON_RC_REC, BUTTON_NONE },
237 { ACTION_STD_MENU, BUTTON_RC_MENU, BUTTON_NONE },
238 { ACTION_SETTINGS_INC, BUTTON_RC_FF, BUTTON_NONE },
239 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
240 { ACTION_SETTINGS_DEC, BUTTON_RC_REW, BUTTON_NONE },
241 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
243 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
244 }; /* remote_button_context_recscreen */
246 /** Settings - General Mappings **/
247 static const struct button_mapping button_context_settings[] = {
248 { ACTION_SETTINGS_INC, BUTTON_VOL_UP, BUTTON_NONE },
249 { ACTION_SETTINGS_INCREPEAT, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
250 { ACTION_SETTINGS_DEC, BUTTON_VOL_DOWN, BUTTON_NONE },
251 { ACTION_SETTINGS_DECREPEAT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
252 { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
253 { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE },
255 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
256 }; /* button_context_settings */
258 static const struct button_mapping remote_button_context_settings[] = {
259 { ACTION_SETTINGS_INC, BUTTON_RC_VOL_UP, BUTTON_NONE },
260 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
261 { ACTION_SETTINGS_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
262 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
263 { ACTION_STD_PREV, BUTTON_RC_REW, BUTTON_NONE },
264 { ACTION_STD_CANCEL, BUTTON_RC_REC, BUTTON_NONE },
266 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
267 }; /* remote_button_context_settings */
269 /** Settings - Using Sliders **/
270 static const struct button_mapping button_context_settings_r_is_inc[] = {
271 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
272 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
273 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
274 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
275 { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE },
277 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
278 }; /* button_context_settings_r_is_inc */
280 static const struct button_mapping remote_button_context_settings_r_is_inc[] = {
281 { ACTION_SETTINGS_INC, BUTTON_RC_FF, BUTTON_NONE },
282 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
283 { ACTION_SETTINGS_DEC, BUTTON_RC_REW, BUTTON_NONE },
284 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_REW|BUTTON_REPEAT,BUTTON_NONE },
285 { ACTION_STD_CANCEL, BUTTON_RC_REC, BUTTON_NONE },
287 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
288 }; /* remote_button_context_settings_r_is_inc */
290 /** Tree **/
291 static const struct button_mapping button_context_tree[] = {
292 { ACTION_NONE, BUTTON_PLAY, BUTTON_NONE },
293 { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
294 { ACTION_TREE_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
295 { ACTION_TREE_HOTKEY, BUTTON_REC|BUTTON_MODE, BUTTON_REC },
297 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
298 }; /* button_context_tree */
300 static const struct button_mapping remote_button_context_tree[] = {
301 { ACTION_NONE, BUTTON_RC_PLAY, BUTTON_NONE },
302 { ACTION_TREE_WPS, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
303 { ACTION_TREE_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
305 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
306 }; /* remote_button_context_tree */
308 static const struct button_mapping button_context_tree_scroll_lr[] = {
309 { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
310 { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
311 { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
312 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
313 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
314 { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
315 { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
316 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
317 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
319 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
320 }; /* button_context_tree_scroll_lr */
322 static const struct button_mapping remote_button_context_tree_scroll_lr[] = {
323 { ACTION_NONE, BUTTON_RC_REW, BUTTON_NONE },
324 { ACTION_STD_CANCEL, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
325 { ACTION_TREE_ROOT_INIT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
326 { ACTION_TREE_PGLEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
327 { ACTION_TREE_PGLEFT, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT },
328 { ACTION_NONE, BUTTON_RC_FF, BUTTON_NONE },
329 { ACTION_STD_OK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
330 { ACTION_TREE_PGRIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
331 { ACTION_TREE_PGRIGHT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT },
333 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
334 }; /* remote_button_context_tree_scroll_lr */
336 /** While-Playing Screen (WPS) **/
337 static const struct button_mapping button_context_wps[] = {
338 { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
339 { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
340 { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
341 { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
342 { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
343 { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
344 { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
345 { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
347 { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
348 { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
349 { ACTION_WPS_VOLUP, BUTTON_VOL_UP, BUTTON_NONE },
350 { ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
352 { ACTION_WPS_BROWSE, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
353 { ACTION_WPS_CONTEXT, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE },
354 { ACTION_WPS_MENU, BUTTON_REC|BUTTON_REL, BUTTON_REC },
355 { ACTION_WPS_QUICKSCREEN, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
356 { ACTION_WPS_HOTKEY, BUTTON_REC|BUTTON_MODE, BUTTON_REC },
358 LAST_ITEM_IN_LIST
359 }; /* button_context_wps */
361 static const struct button_mapping remote_button_context_wps[] = {
362 { ACTION_WPS_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
363 { ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
364 { ACTION_WPS_SKIPPREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
365 { ACTION_WPS_SEEKBACK, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
366 { ACTION_WPS_STOPSEEK, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT },
367 { ACTION_WPS_SKIPNEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
368 { ACTION_WPS_SEEKFWD, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
369 { ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT },
371 { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
372 { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
373 { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
374 { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
376 { ACTION_WPS_BROWSE, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE },
377 { ACTION_WPS_CONTEXT, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
378 { ACTION_WPS_MENU, BUTTON_RC_MENU|BUTTON_REL, BUTTON_RC_MENU },
379 { ACTION_WPS_QUICKSCREEN, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_RC_MENU },
381 LAST_ITEM_IN_LIST
382 }; /* remote_button_context_wps */
384 /** Yes/No Screen **/
385 static const struct button_mapping button_context_yesnoscreen[] = {
386 { ACTION_YESNO_ACCEPT, BUTTON_PLAY, BUTTON_NONE },
387 LAST_ITEM_IN_LIST
388 }; /* button_context_yesnoscreen */
390 static const struct button_mapping remote_button_context_yesnoscreen[] = {
391 { ACTION_YESNO_ACCEPT, BUTTON_RC_PLAY, BUTTON_NONE },
392 LAST_ITEM_IN_LIST
393 }; /* remote_button_context_yesnoscreen */
396 static const struct button_mapping* get_context_mapping_remote( int context )
398 context ^= CONTEXT_REMOTE;
400 switch (context)
402 /* anything that uses remote_button_context_standard */
403 default:
404 return remote_button_context_standard;
406 /* remote contexts with special mapping */
407 case CONTEXT_BOOKMARKSCREEN:
408 return remote_button_context_bmark;
410 case CONTEXT_FM:
411 return remote_button_context_radio;
413 case CONTEXT_KEYBOARD:
414 return remote_button_context_keyboard;
416 case CONTEXT_PITCHSCREEN:
417 return remote_button_context_pitchscreen;
419 case CONTEXT_QUICKSCREEN:
420 return remote_button_context_quickscreen;
422 case CONTEXT_RECSCREEN:
423 return remote_button_context_recscreen;
425 case CONTEXT_SETTINGS:
426 return remote_button_context_settings;
428 case CONTEXT_SETTINGS_EQ:
429 case CONTEXT_SETTINGS_TIME:
430 return remote_button_context_settings_r_is_inc;
432 case CONTEXT_TREE:
433 case CONTEXT_MAINMENU:
434 if (global_settings.hold_lr_for_scroll_in_list)
435 return remote_button_context_tree_scroll_lr;
436 /* else fall through to CONTEXT_TREE|CONTEXT_CUSTOM */
437 case CONTEXT_TREE|CONTEXT_CUSTOM:
438 return remote_button_context_tree;
440 case CONTEXT_WPS:
441 return remote_button_context_wps;
443 case CONTEXT_YESNOSCREEN:
444 return remote_button_context_yesnoscreen;
448 const struct button_mapping* get_context_mapping(int context)
450 if (context & CONTEXT_REMOTE)
451 return get_context_mapping_remote(context);
453 switch (context)
455 /* anything that uses button_context_standard */
456 default:
457 return button_context_standard;
459 /* contexts with special mapping */
460 case CONTEXT_BOOKMARKSCREEN:
461 return button_context_bmark;
463 case CONTEXT_FM:
464 return button_context_radio;
466 case CONTEXT_KEYBOARD:
467 return button_context_keyboard;
469 case CONTEXT_PITCHSCREEN:
470 return button_context_pitchscreen;
472 case CONTEXT_QUICKSCREEN:
473 return button_context_quickscreen;
475 case CONTEXT_RECSCREEN:
476 return button_context_recscreen;
478 case CONTEXT_SETTINGS:
479 return button_context_settings;
481 case CONTEXT_SETTINGS_EQ:
482 case CONTEXT_SETTINGS_RECTRIGGER:
483 return button_context_settings_r_is_inc;
485 case CONTEXT_TREE:
486 case CONTEXT_MAINMENU:
487 if (global_settings.hold_lr_for_scroll_in_list)
488 return button_context_tree_scroll_lr;
489 /* else fall through to CONTEXT_TREE|CONTEXT_CUSTOM */
490 case CONTEXT_TREE|CONTEXT_CUSTOM:
491 return button_context_tree;
493 case CONTEXT_WPS:
494 return button_context_wps;
496 case CONTEXT_YESNOSCREEN:
497 return button_context_yesnoscreen;