Prepare new maemo release
[maemo-rb.git] / apps / keymaps / keymap-h1x0_h3x0.c
blobd4f098ce1e3e8e4ed23d3728decb3d9bc1d0047b
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006 Jonathan Gordon
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 iriver h100/h300 target */
23 #include <stdio.h>
24 #include <string.h>
25 #include <stdlib.h>
27 #include "config.h"
28 #include "action.h"
29 #include "button.h"
30 #include "lcd-remote.h" /* for remote_type() */
31 #include "settings.h"
33 /*
34 * The format of the list is as follows
35 * { Action Code, Button code, Prereq button code }
36 * if there's no need to check the previous button's value, use BUTTON_NONE
37 * Insert LAST_ITEM_IN_LIST at the end of each mapping
40 /* CONTEXT_CUSTOM's used in this file...
42 CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions)
43 CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker screens
44 i.e where up/down is inc/dec
45 CONTEXT_SETTINGS = up/down is prev/next, l/r is inc/dec
50 static const struct button_mapping button_context_standard[] = {
51 { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
52 { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
53 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
54 { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
56 { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
57 { ACTION_STD_CANCEL, BUTTON_OFF, BUTTON_NONE },
59 { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT },
61 { ACTION_STD_QUICKSCREEN, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE },
62 { ACTION_STD_MENU, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
63 { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
64 { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
65 { ACTION_STD_OK, BUTTON_ON|BUTTON_REL, BUTTON_NONE },
66 { ACTION_STD_REC, BUTTON_REC|BUTTON_REPEAT, BUTTON_NONE },
68 LAST_ITEM_IN_LIST
69 }; /* button_context_standard */
71 static const struct button_mapping button_context_wps[] = {
72 { ACTION_WPS_PLAY, BUTTON_ON|BUTTON_REL, BUTTON_ON },
73 { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
74 { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
75 { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
76 { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
77 { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
78 { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
79 { ACTION_WPS_ABSETB_NEXTDIR, BUTTON_ON|BUTTON_RIGHT, BUTTON_NONE },
80 { ACTION_WPS_ABSETA_PREVDIR, BUTTON_ON|BUTTON_LEFT, BUTTON_NONE },
81 { ACTION_WPS_STOP, BUTTON_OFF|BUTTON_REL, BUTTON_OFF },
82 { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
83 { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
84 { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
85 { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
86 { ACTION_WPS_PITCHSCREEN, BUTTON_ON|BUTTON_UP, BUTTON_ON },
87 { ACTION_WPS_PITCHSCREEN, BUTTON_ON|BUTTON_DOWN, BUTTON_ON },
88 { ACTION_WPS_QUICKSCREEN, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE },
89 { ACTION_WPS_MENU, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
90 { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
91 { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
92 { ACTION_WPS_ABRESET, BUTTON_ON|BUTTON_SELECT, BUTTON_ON },
93 { ACTION_WPS_ID3SCREEN, BUTTON_ON|BUTTON_MODE, BUTTON_NONE },
94 { ACTION_WPS_REC, BUTTON_REC|BUTTON_REPEAT, BUTTON_NONE },
95 { ACTION_WPS_HOTKEY, BUTTON_REC|BUTTON_REL, BUTTON_REC },
97 LAST_ITEM_IN_LIST
98 }; /* button_context_wps */
100 static const struct button_mapping button_context_list[] = {
101 { ACTION_LISTTREE_PGUP, BUTTON_ON|BUTTON_UP, BUTTON_NONE },
102 { ACTION_LISTTREE_PGUP, BUTTON_ON|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
103 { ACTION_LISTTREE_PGDOWN, BUTTON_ON|BUTTON_DOWN, BUTTON_NONE },
104 { ACTION_LISTTREE_PGDOWN, BUTTON_ON|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
105 { ACTION_NONE, BUTTON_ON|BUTTON_REL, BUTTON_NONE },
106 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
107 }; /* button_context_list */
109 static const struct button_mapping button_context_tree[] = {
110 { ACTION_TREE_WPS, BUTTON_ON|BUTTON_REL, BUTTON_ON },
111 { ACTION_TREE_STOP, BUTTON_OFF, BUTTON_NONE },
112 { ACTION_TREE_STOP, BUTTON_OFF|BUTTON_REPEAT, BUTTON_NONE },
113 { ACTION_TREE_HOTKEY, BUTTON_REC|BUTTON_REL, BUTTON_REC },
115 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST)
116 }; /* button_context_tree */
118 static const struct button_mapping button_context_listtree_scroll_with_combo[] = {
119 { ACTION_NONE, BUTTON_ON, BUTTON_NONE },
120 { ACTION_TREE_PGLEFT, BUTTON_ON|BUTTON_LEFT, BUTTON_NONE },
121 { ACTION_TREE_ROOT_INIT, BUTTON_ON|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_ON|BUTTON_LEFT },
122 { ACTION_TREE_PGLEFT, BUTTON_ON|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
123 { ACTION_TREE_PGRIGHT, BUTTON_ON|BUTTON_RIGHT, BUTTON_NONE },
124 { ACTION_TREE_PGRIGHT, BUTTON_ON|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
125 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
128 static const struct button_mapping button_context_listtree_scroll_without_combo[] = {
129 { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
130 { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
131 { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
132 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
133 { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
134 { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
135 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
136 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
139 static const struct button_mapping button_context_settings[] = {
140 { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
141 { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
142 { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
143 { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
144 { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
145 { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
146 { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
147 { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
148 { ACTION_SETTINGS_RESET, BUTTON_ON, BUTTON_NONE },
150 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
151 }; /* button_context_settings */
153 static const struct button_mapping button_context_settings_right_is_inc[] = {
154 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
155 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
156 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
157 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
158 { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
159 { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
160 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
161 { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
162 { ACTION_SETTINGS_RESET, BUTTON_ON, BUTTON_NONE },
164 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
165 }; /* button_context_settingsgraphical */
167 static const struct button_mapping button_context_yesno[] = {
168 { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE },
169 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
170 }; /* button_context_settings_yesno */
172 static const struct button_mapping button_context_colorchooser[] = {
173 { ACTION_STD_OK, BUTTON_ON|BUTTON_REL, BUTTON_NONE },
174 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
175 }; /* button_context_settings_colorchooser */
177 static const struct button_mapping button_context_eq[] = {
178 { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
179 { ACTION_NONE, BUTTON_ON|BUTTON_REL, BUTTON_NONE },
180 { ACTION_SETTINGS_INCBIGSTEP, BUTTON_ON|BUTTON_RIGHT, BUTTON_ON },
181 { ACTION_SETTINGS_INCBIGSTEP, BUTTON_RIGHT|BUTTON_REL, BUTTON_ON|BUTTON_RIGHT },
182 { ACTION_SETTINGS_INCBIGSTEP, BUTTON_ON|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
183 { ACTION_SETTINGS_DECBIGSTEP, BUTTON_ON|BUTTON_LEFT, BUTTON_ON },
184 { ACTION_SETTINGS_DECBIGSTEP, BUTTON_LEFT|BUTTON_REL, BUTTON_ON|BUTTON_LEFT },
185 { ACTION_SETTINGS_DECBIGSTEP, BUTTON_ON|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
186 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
187 }; /* button_context_settings_context_eq */
189 static const struct button_mapping button_context_bmark[] = {
190 { ACTION_BMS_DELETE, BUTTON_REC, BUTTON_NONE },
191 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
192 }; /* button_context_settings_bmark */
194 static const struct button_mapping button_context_time[] = {
195 { ACTION_STD_CANCEL, BUTTON_OFF, BUTTON_NONE },
196 { ACTION_STD_OK, BUTTON_ON, BUTTON_NONE },
197 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS),
198 }; /* button_context_settings_bmark */
200 static const struct button_mapping button_context_quickscreen[] = {
201 { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE },
202 { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
203 { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE },
204 { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
205 { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE },
206 { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
207 { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
208 { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
209 { ACTION_STD_CANCEL, BUTTON_MODE, BUTTON_NONE },
211 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
212 }; /* button_context_quickscreen */
214 static const struct button_mapping button_context_pitchscreen[] = {
215 { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
216 { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
217 { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
218 { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
219 { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
220 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
221 { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
222 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
223 { ACTION_PS_TOGGLE_MODE, BUTTON_MODE, BUTTON_NONE },
224 { ACTION_PS_RESET, BUTTON_SELECT, BUTTON_NONE },
225 { ACTION_PS_EXIT, BUTTON_ON, BUTTON_NONE },
226 { ACTION_PS_EXIT, BUTTON_OFF, BUTTON_NONE },
227 { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
228 { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
230 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
231 }; /* button_context_pitchcreen */
233 static const struct button_mapping button_context_recscreen[] = {
234 { ACTION_REC_PAUSE, BUTTON_ON, BUTTON_NONE },
235 { ACTION_REC_NEWFILE, BUTTON_REC, BUTTON_NONE },
236 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
237 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
238 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
239 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
241 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
242 }; /* button_context_recscreen */
244 static const struct button_mapping button_context_keyboard[] = {
245 { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
246 { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
247 { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
248 { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
249 { ACTION_KBD_CURSOR_LEFT, BUTTON_ON|BUTTON_LEFT, BUTTON_NONE },
250 { ACTION_KBD_CURSOR_LEFT, BUTTON_ON|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
251 { ACTION_KBD_CURSOR_RIGHT, BUTTON_ON|BUTTON_RIGHT, BUTTON_NONE },
252 { ACTION_KBD_CURSOR_RIGHT, BUTTON_ON|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
253 { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE },
254 { ACTION_KBD_PAGE_FLIP, BUTTON_MODE, BUTTON_NONE },
255 { ACTION_KBD_DONE, BUTTON_ON|BUTTON_REL, BUTTON_ON },
256 { ACTION_KBD_ABORT, BUTTON_OFF, BUTTON_NONE },
257 { ACTION_KBD_BACKSPACE, BUTTON_REC, BUTTON_NONE },
258 { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_REPEAT, BUTTON_NONE },
259 { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE },
260 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
261 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
262 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
263 { ACTION_KBD_MORSE_INPUT, BUTTON_ON|BUTTON_MODE, BUTTON_NONE },
264 { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
266 LAST_ITEM_IN_LIST
267 }; /* button_context_keyboard */
269 static const struct button_mapping button_context_radio[] = {
270 { ACTION_FM_MENU, BUTTON_SELECT | BUTTON_REPEAT, BUTTON_NONE },
271 { ACTION_FM_PRESET, BUTTON_SELECT | BUTTON_REL, BUTTON_SELECT },
272 { ACTION_FM_STOP, BUTTON_OFF, BUTTON_NONE },
273 { ACTION_FM_MODE, BUTTON_ON | BUTTON_REPEAT, BUTTON_ON },
274 { ACTION_FM_EXIT, BUTTON_MODE | BUTTON_REL, BUTTON_MODE },
275 { ACTION_FM_PLAY, BUTTON_ON | BUTTON_REL, BUTTON_ON },
277 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
281 /*****************************************************************************
282 * Remote control mappings
283 *****************************************************************************/
286 static const struct button_mapping button_context_standard_h100remote[] = {
287 { ACTION_STD_PREV, BUTTON_RC_REW, BUTTON_NONE },
288 { ACTION_STD_PREVREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
289 { ACTION_STD_NEXT, BUTTON_RC_FF, BUTTON_NONE },
290 { ACTION_STD_NEXTREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
292 { ACTION_STD_CANCEL, BUTTON_RC_STOP, BUTTON_NONE },
293 { ACTION_STD_CONTEXT, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_RC_MENU },
295 { ACTION_STD_QUICKSCREEN, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
296 { ACTION_STD_MENU, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE },
297 { ACTION_STD_OK, BUTTON_RC_ON, BUTTON_NONE },
298 { ACTION_STD_OK, BUTTON_RC_MENU|BUTTON_REL, BUTTON_RC_MENU },
300 LAST_ITEM_IN_LIST
301 }; /* button_context_standard_h100lcdremote */
303 static const struct button_mapping button_context_standard_h300lcdremote[] = {
304 { ACTION_STD_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE },
305 { ACTION_STD_PREVREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
306 { ACTION_STD_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
307 { ACTION_STD_NEXTREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
309 { ACTION_STD_CANCEL, BUTTON_RC_REW, BUTTON_NONE },
310 { ACTION_STD_CANCEL, BUTTON_RC_STOP, BUTTON_NONE },
311 { ACTION_STD_CONTEXT, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_RC_MENU },
312 { ACTION_STD_QUICKSCREEN, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
313 { ACTION_STD_MENU, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE },
314 { ACTION_STD_OK, BUTTON_RC_MENU|BUTTON_REL, BUTTON_RC_MENU },
315 { ACTION_STD_OK, BUTTON_RC_FF, BUTTON_NONE },
317 LAST_ITEM_IN_LIST
321 static const struct button_mapping button_context_wps_remotescommon[] = {
322 { ACTION_WPS_PLAY, BUTTON_RC_ON|BUTTON_REL, BUTTON_RC_ON },
323 { ACTION_WPS_SKIPNEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
324 { ACTION_WPS_SKIPPREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
325 { ACTION_WPS_SEEKBACK, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
326 { ACTION_WPS_SEEKFWD, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
327 { ACTION_WPS_STOPSEEK, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT },
328 { ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT },
329 { ACTION_WPS_ABSETB_NEXTDIR, BUTTON_RC_BITRATE, BUTTON_NONE },
330 { ACTION_WPS_ABSETA_PREVDIR, BUTTON_RC_SOURCE, BUTTON_NONE },
331 { ACTION_WPS_STOP, BUTTON_RC_STOP|BUTTON_REL, BUTTON_RC_STOP },
332 { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
333 { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
334 { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
335 { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
336 { ACTION_WPS_PITCHSCREEN, BUTTON_RC_ON|BUTTON_REPEAT, BUTTON_NONE },
337 { ACTION_WPS_QUICKSCREEN, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
338 { ACTION_WPS_MENU, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE },
339 { ACTION_WPS_CONTEXT, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_NONE },
340 { ACTION_WPS_BROWSE, BUTTON_RC_MENU|BUTTON_REL, BUTTON_RC_MENU },
341 /* Now the specific combos, because H100 & H300 LCD remotes have different
342 * keys, capable of acting as "modifier" - H100 : RC_ON; H300: RC_MENU
344 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_REMOTE|CONTEXT_WPS)
348 static const struct button_mapping button_context_wps_h100remote[] = {
349 { ACTION_WPS_ABRESET, BUTTON_RC_ON|BUTTON_RC_MENU, BUTTON_RC_ON },
350 { ACTION_WPS_ID3SCREEN, BUTTON_RC_ON|BUTTON_RC_MODE, BUTTON_NONE },
351 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
353 static const struct button_mapping button_context_wps_h300lcdremote[] = {
354 { ACTION_WPS_ABRESET, BUTTON_RC_MENU|BUTTON_RC_ON, BUTTON_RC_MENU },
355 { ACTION_WPS_ID3SCREEN, BUTTON_RC_MENU|BUTTON_RC_MODE, BUTTON_NONE },
356 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
359 static const struct button_mapping button_context_list_h100remote[] = {
360 { ACTION_LISTTREE_PGUP, BUTTON_RC_SOURCE, BUTTON_NONE },
361 { ACTION_LISTTREE_PGUP, BUTTON_RC_SOURCE|BUTTON_REPEAT, BUTTON_NONE },
362 { ACTION_LISTTREE_PGDOWN, BUTTON_RC_BITRATE, BUTTON_NONE },
363 { ACTION_LISTTREE_PGDOWN, BUTTON_RC_BITRATE|BUTTON_REPEAT, BUTTON_NONE },
364 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
367 static const struct button_mapping *button_context_list_h300lcdremote =
368 button_context_list_h100remote;
371 static const struct button_mapping button_context_tree_h100remote[] = {
372 { ACTION_TREE_WPS, BUTTON_RC_ON, BUTTON_NONE },
374 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST|CONTEXT_REMOTE)
375 }; /* button_context_tree_h100remote */
377 static const struct button_mapping button_context_tree_h300lcdremote[] = {
378 { ACTION_TREE_STOP, BUTTON_RC_STOP, BUTTON_NONE },
379 { ACTION_TREE_WPS, BUTTON_RC_ON, BUTTON_NONE },
380 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST|CONTEXT_REMOTE)
381 }; /* button_context_tree_h300lcdremote */
384 static const struct button_mapping button_context_listtree_scroll_w_cmb_h100remote[] = {
385 { ACTION_TREE_PGLEFT, BUTTON_RC_ON|BUTTON_RC_REW, BUTTON_NONE },
386 { ACTION_TREE_PGLEFT, BUTTON_RC_ON|BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
387 { ACTION_TREE_PGLEFT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
388 { ACTION_TREE_PGLEFT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
389 { ACTION_TREE_PGRIGHT, BUTTON_RC_ON|BUTTON_RC_FF, BUTTON_NONE },
390 { ACTION_TREE_PGRIGHT, BUTTON_RC_ON|BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
391 { ACTION_TREE_PGRIGHT, BUTTON_RC_VOL_UP, BUTTON_NONE },
392 { ACTION_TREE_PGRIGHT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
393 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE|CONTEXT_REMOTE),
396 static const struct button_mapping button_context_listtree_scroll_w_cmb_h300lcdremote[] = {
397 { ACTION_TREE_PGLEFT, BUTTON_RC_MENU|BUTTON_RC_SOURCE, BUTTON_NONE },
398 { ACTION_TREE_ROOT_INIT, BUTTON_RC_MENU|BUTTON_RC_SOURCE|BUTTON_REPEAT, BUTTON_RC_MENU|BUTTON_RC_SOURCE },
399 { ACTION_TREE_PGLEFT, BUTTON_RC_MENU|BUTTON_RC_SOURCE|BUTTON_REPEAT, BUTTON_NONE },
400 { ACTION_TREE_PGRIGHT, BUTTON_RC_MENU|BUTTON_RC_BITRATE, BUTTON_NONE },
401 { ACTION_TREE_PGRIGHT, BUTTON_RC_MENU|BUTTON_RC_BITRATE|BUTTON_REPEAT, BUTTON_NONE },
402 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE|CONTEXT_REMOTE),
405 static const struct button_mapping button_context_listtree_scroll_wo_cmb_h100remote[] = {
406 { ACTION_TREE_PGLEFT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
407 { ACTION_TREE_ROOT_INIT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_RC_VOL_DOWN },
408 { ACTION_TREE_PGLEFT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
409 { ACTION_TREE_PGRIGHT, BUTTON_RC_VOL_UP, BUTTON_NONE },
410 { ACTION_TREE_PGRIGHT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
411 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE|CONTEXT_REMOTE),
414 static const struct button_mapping button_context_listtree_scroll_wo_cmb_h300lcdremote[] = {
415 { ACTION_NONE, BUTTON_RC_REW, BUTTON_NONE },
416 { ACTION_STD_CANCEL, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
417 { ACTION_TREE_ROOT_INIT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
418 { ACTION_TREE_PGLEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
419 { ACTION_NONE, BUTTON_RC_FF, BUTTON_NONE },
420 { ACTION_STD_OK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
421 { ACTION_TREE_PGRIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
422 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE|CONTEXT_REMOTE),
425 static const struct button_mapping button_context_settings_h100remote[] = {
426 { ACTION_SETTINGS_INC, BUTTON_RC_REW, BUTTON_NONE },
427 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
428 { ACTION_SETTINGS_DEC, BUTTON_RC_FF, BUTTON_NONE },
429 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
430 /* { ACTION_NONE, BUTTON_RC_ON, BUTTON_NONE },
431 { ACTION_NONE, BUTTON_RC_STOP, BUTTON_NONE },
432 { ACTION_NONE, BUTTON_RC_MENU|BUTTON_REL, BUTTON_NONE },
434 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
435 }; /* button_context_settings */
437 static const struct button_mapping button_context_settings_h300lcdremote[] = {
438 { ACTION_SETTINGS_INC, BUTTON_RC_VOL_UP, BUTTON_NONE },
439 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
440 { ACTION_SETTINGS_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
441 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
442 { ACTION_NONE, BUTTON_RC_REW, BUTTON_NONE },
443 { ACTION_NONE, BUTTON_RC_FF, BUTTON_NONE },
445 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
446 }; /* button_context_settings */
450 static const struct button_mapping button_context_settingsgraphical_h100remote[] = {
451 { ACTION_SETTINGS_INC, BUTTON_RC_FF, BUTTON_NONE },
452 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
453 { ACTION_SETTINGS_DEC, BUTTON_RC_REW, BUTTON_NONE },
454 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
455 { ACTION_STD_PREV, BUTTON_RC_SOURCE, BUTTON_NONE },
456 { ACTION_STD_PREVREPEAT, BUTTON_RC_SOURCE|BUTTON_REPEAT, BUTTON_NONE },
457 { ACTION_STD_NEXT, BUTTON_RC_BITRATE, BUTTON_NONE },
458 { ACTION_STD_NEXTREPEAT, BUTTON_RC_BITRATE|BUTTON_REPEAT, BUTTON_NONE },
460 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
461 }; /* button_context_settingsgraphical_h100remote */
463 static const struct button_mapping button_context_settingsgraphical_h300lcdremote[] = {
464 { ACTION_SETTINGS_INC, BUTTON_RC_FF, BUTTON_NONE },
465 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
466 { ACTION_SETTINGS_DEC, BUTTON_RC_REW, BUTTON_NONE },
467 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_REW|BUTTON_REPEAT,BUTTON_NONE },
468 { ACTION_STD_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE },
469 { ACTION_STD_PREVREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
470 { ACTION_STD_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
471 { ACTION_STD_NEXTREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
473 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
474 }; /* button_context_settingsgraphical_h300remote */
476 static const struct button_mapping button_context_yesno_h100remote[] = {
477 { ACTION_YESNO_ACCEPT, BUTTON_RC_MENU, BUTTON_NONE },
478 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
479 }; /* button_context_settings_yesno */
481 static const struct button_mapping *button_context_yesno_h300lcdremote =
482 button_context_yesno_h100remote;
484 static const struct button_mapping button_context_bmark_h100remote[] = {
485 { ACTION_BMS_DELETE, BUTTON_RC_REC, BUTTON_NONE },
486 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST)
487 }; /* button_context_settings_bmark */
489 static const struct button_mapping *button_context_bmark_h300lcdremote =
490 button_context_bmark_h100remote;
492 static const struct button_mapping button_context_quickscreen_nonlcdremote[] = {
493 { ACTION_QS_TOP, BUTTON_RC_VOL_UP, BUTTON_NONE },
494 { ACTION_QS_TOP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
495 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
496 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
497 { ACTION_QS_LEFT, BUTTON_RC_REW, BUTTON_NONE },
498 { ACTION_QS_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
499 { ACTION_QS_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
500 { ACTION_QS_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
501 { ACTION_STD_CANCEL, BUTTON_RC_ON, BUTTON_NONE },
503 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
504 }; /* button_context_quickscreen */
506 static const struct button_mapping button_context_quickscreen_h100lcdremote[] = {
507 { ACTION_QS_TOP, BUTTON_RC_VOL_UP, BUTTON_NONE },
508 { ACTION_QS_TOP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
509 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
510 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
511 { ACTION_QS_LEFT, BUTTON_RC_REW, BUTTON_NONE },
512 { ACTION_QS_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
513 { ACTION_QS_LEFT, BUTTON_RC_FF, BUTTON_NONE },
514 { ACTION_QS_LEFT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
515 { ACTION_QS_RIGHT, BUTTON_RC_SOURCE, BUTTON_NONE },
516 { ACTION_QS_RIGHT, BUTTON_RC_SOURCE|BUTTON_REPEAT, BUTTON_NONE },
517 { ACTION_QS_RIGHT, BUTTON_RC_BITRATE, BUTTON_NONE },
518 { ACTION_QS_RIGHT, BUTTON_RC_BITRATE|BUTTON_REPEAT, BUTTON_NONE },
519 { ACTION_STD_CANCEL, BUTTON_RC_MODE, BUTTON_NONE },
521 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
522 }; /* button_context_quickscreen */
524 static const struct button_mapping button_context_quickscreen_h300lcdremote[] = {
525 { ACTION_QS_TOP, BUTTON_RC_VOL_UP, BUTTON_NONE },
526 { ACTION_QS_TOP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
527 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
528 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
529 { ACTION_QS_LEFT, BUTTON_RC_REW, BUTTON_NONE },
530 { ACTION_QS_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
531 { ACTION_QS_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
532 { ACTION_QS_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
533 { ACTION_STD_CANCEL, BUTTON_RC_MODE, BUTTON_NONE },
535 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
536 }; /* button_context_quickscreen */
538 static const struct button_mapping button_context_pitchscreen_nonlcdremote[] = {
539 { ACTION_PS_INC_SMALL, BUTTON_RC_VOL_UP, BUTTON_NONE },
540 { ACTION_PS_INC_BIG, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
541 { ACTION_PS_DEC_SMALL, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
542 { ACTION_PS_DEC_BIG, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
543 { ACTION_PS_NUDGE_LEFT, BUTTON_RC_REW, BUTTON_NONE },
544 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_RC_REW|BUTTON_REL, BUTTON_NONE },
545 { ACTION_PS_NUDGE_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
546 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RC_FF|BUTTON_REL, BUTTON_NONE },
547 { ACTION_PS_RESET, BUTTON_RC_MENU, BUTTON_NONE },
548 { ACTION_PS_EXIT, BUTTON_RC_ON, BUTTON_NONE },
549 { ACTION_PS_EXIT, BUTTON_RC_STOP, BUTTON_NONE },
550 { ACTION_PS_SLOWER, BUTTON_RC_REW|BUTTON_REPEAT,BUTTON_NONE },
551 { ACTION_PS_FASTER, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
553 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
554 }; /* button_context_pitchcreen */
556 static const struct button_mapping button_context_pitchscreen_h100lcdremote[] = {
557 { ACTION_PS_INC_SMALL, BUTTON_RC_FF, BUTTON_NONE },
558 { ACTION_PS_INC_BIG, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
559 { ACTION_PS_DEC_SMALL, BUTTON_RC_REW, BUTTON_NONE },
560 { ACTION_PS_DEC_BIG, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
561 { ACTION_PS_NUDGE_LEFT, BUTTON_RC_SOURCE, BUTTON_NONE },
562 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_RC_SOURCE|BUTTON_REL, BUTTON_NONE },
563 { ACTION_PS_NUDGE_RIGHT, BUTTON_RC_BITRATE, BUTTON_NONE },
564 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RC_BITRATE|BUTTON_REL, BUTTON_NONE },
565 { ACTION_PS_RESET, BUTTON_RC_MENU, BUTTON_NONE },
566 { ACTION_PS_EXIT, BUTTON_RC_ON, BUTTON_NONE },
567 { ACTION_PS_EXIT, BUTTON_RC_STOP, BUTTON_NONE },
568 { ACTION_PS_SLOWER, BUTTON_RC_SOURCE|BUTTON_REPEAT, BUTTON_NONE },
569 { ACTION_PS_FASTER, BUTTON_RC_BITRATE|BUTTON_REPEAT, BUTTON_NONE },
571 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
574 static const struct button_mapping button_context_pitchscreen_h300lcdremote[] = {
575 { ACTION_PS_INC_SMALL, BUTTON_RC_VOL_UP, BUTTON_NONE },
576 { ACTION_PS_INC_BIG, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
577 { ACTION_PS_DEC_SMALL, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
578 { ACTION_PS_DEC_BIG, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
579 { ACTION_PS_NUDGE_LEFT, BUTTON_RC_REW, BUTTON_NONE },
580 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_RC_REW|BUTTON_REL, BUTTON_NONE },
581 { ACTION_PS_NUDGE_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
582 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RC_FF|BUTTON_REL, BUTTON_NONE },
583 { ACTION_PS_RESET, BUTTON_RC_MENU, BUTTON_NONE },
584 { ACTION_PS_EXIT, BUTTON_RC_ON, BUTTON_NONE },
585 { ACTION_PS_EXIT, BUTTON_RC_STOP, BUTTON_NONE },
586 { ACTION_PS_SLOWER, BUTTON_RC_REW|BUTTON_REPEAT,BUTTON_NONE },
587 { ACTION_PS_FASTER, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
589 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
592 static const struct button_mapping button_context_recscreen_h100remote[] = {
593 { ACTION_REC_LCD, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
594 { ACTION_REC_PAUSE, BUTTON_RC_ON, BUTTON_NONE },
595 { ACTION_REC_NEWFILE, BUTTON_RC_REC, BUTTON_NONE },
596 { ACTION_SETTINGS_INC, BUTTON_RC_BITRATE, BUTTON_NONE },
597 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_BITRATE|BUTTON_REPEAT, BUTTON_NONE },
598 { ACTION_SETTINGS_DEC, BUTTON_RC_SOURCE, BUTTON_NONE },
599 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_SOURCE|BUTTON_REPEAT, BUTTON_NONE },
601 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
602 }; /* button_context_recscreen_h100remote */
604 static const struct button_mapping button_context_recscreen_h300lcdremote[] = {
605 { ACTION_REC_LCD, BUTTON_RC_SOURCE, BUTTON_NONE },
606 { ACTION_REC_PAUSE, BUTTON_RC_ON, BUTTON_NONE },
607 { ACTION_REC_NEWFILE, BUTTON_RC_REC, BUTTON_NONE },
608 { ACTION_SETTINGS_INC, BUTTON_RC_FF, BUTTON_NONE },
609 { ACTION_SETTINGS_INC, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
610 { ACTION_SETTINGS_DEC, BUTTON_RC_REW, BUTTON_NONE },
611 { ACTION_SETTINGS_DEC, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
613 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
614 }; /* button_context_recscreen_h300lcdremote */
616 static const struct button_mapping button_context_keyboard_h100remote[] = {
617 { ACTION_KBD_LEFT, BUTTON_RC_REW, BUTTON_NONE },
618 { ACTION_KBD_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
619 { ACTION_KBD_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
620 { ACTION_KBD_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
621 { ACTION_KBD_CURSOR_LEFT, BUTTON_RC_ON|BUTTON_RC_REW, BUTTON_NONE },
622 { ACTION_KBD_CURSOR_LEFT, BUTTON_RC_ON|BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
623 { ACTION_KBD_CURSOR_RIGHT, BUTTON_RC_ON|BUTTON_RC_FF, BUTTON_NONE },
624 { ACTION_KBD_CURSOR_RIGHT, BUTTON_RC_ON|BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
625 { ACTION_KBD_CURSOR_LEFT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
626 { ACTION_KBD_CURSOR_LEFT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
627 { ACTION_KBD_CURSOR_RIGHT, BUTTON_RC_VOL_UP, BUTTON_NONE },
628 { ACTION_KBD_CURSOR_RIGHT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
629 { ACTION_KBD_SELECT, BUTTON_RC_MENU, BUTTON_NONE },
630 { ACTION_KBD_PAGE_FLIP, BUTTON_RC_MODE, BUTTON_NONE },
631 { ACTION_KBD_DONE, BUTTON_RC_ON|BUTTON_REL, BUTTON_RC_ON },
632 { ACTION_KBD_ABORT, BUTTON_RC_STOP, BUTTON_NONE },
633 { ACTION_KBD_BACKSPACE, BUTTON_RC_REC, BUTTON_NONE },
634 { ACTION_KBD_BACKSPACE, BUTTON_RC_REC|BUTTON_REPEAT, BUTTON_NONE },
635 { ACTION_KBD_UP, BUTTON_RC_SOURCE, BUTTON_NONE },
636 { ACTION_KBD_UP, BUTTON_RC_SOURCE|BUTTON_REPEAT, BUTTON_NONE },
637 { ACTION_KBD_DOWN, BUTTON_RC_BITRATE, BUTTON_NONE },
638 { ACTION_KBD_DOWN, BUTTON_RC_BITRATE|BUTTON_REPEAT, BUTTON_NONE },
639 { ACTION_KBD_MORSE_INPUT, BUTTON_RC_ON|BUTTON_RC_MODE, BUTTON_NONE },
640 { ACTION_KBD_MORSE_SELECT, BUTTON_RC_MENU|BUTTON_REL, BUTTON_NONE },
642 LAST_ITEM_IN_LIST
643 }; /* button_context_keyboard_h100remote */
645 static const struct button_mapping button_context_keyboard_h300lcdremote[] = {
646 { ACTION_KBD_LEFT, BUTTON_RC_REW, BUTTON_NONE },
647 { ACTION_KBD_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
648 { ACTION_KBD_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
649 { ACTION_KBD_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
650 { ACTION_KBD_CURSOR_LEFT, BUTTON_RC_SOURCE, BUTTON_NONE },
651 { ACTION_KBD_CURSOR_LEFT, BUTTON_RC_SOURCE|BUTTON_REPEAT, BUTTON_NONE },
652 { ACTION_KBD_CURSOR_RIGHT, BUTTON_RC_BITRATE, BUTTON_NONE },
653 { ACTION_KBD_CURSOR_RIGHT, BUTTON_RC_BITRATE|BUTTON_REPEAT, BUTTON_NONE },
654 { ACTION_KBD_SELECT, BUTTON_RC_MENU, BUTTON_NONE },
655 { ACTION_KBD_PAGE_FLIP, BUTTON_RC_MODE, BUTTON_NONE },
656 { ACTION_KBD_DONE, BUTTON_RC_ON, BUTTON_NONE },
657 { ACTION_KBD_ABORT, BUTTON_RC_STOP, BUTTON_NONE },
658 { ACTION_KBD_BACKSPACE, BUTTON_RC_REC, BUTTON_NONE },
659 { ACTION_KBD_BACKSPACE, BUTTON_RC_REC|BUTTON_REPEAT, BUTTON_NONE },
660 { ACTION_KBD_UP, BUTTON_RC_VOL_UP, BUTTON_NONE },
661 { ACTION_KBD_UP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
662 { ACTION_KBD_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
663 { ACTION_KBD_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
664 { ACTION_KBD_MORSE_INPUT, BUTTON_RC_MENU|BUTTON_RC_MODE, BUTTON_NONE },
665 { ACTION_KBD_MORSE_SELECT, BUTTON_RC_MENU|BUTTON_REL, BUTTON_NONE },
667 LAST_ITEM_IN_LIST
668 }; /* button_context_keyboard_h300lcdremote */
670 static const struct button_mapping button_context_radio_h100remote[] = {
671 { ACTION_FM_MENU, BUTTON_RC_MENU | BUTTON_REPEAT, BUTTON_NONE },
672 { ACTION_FM_PRESET, BUTTON_RC_MENU | BUTTON_REL, BUTTON_RC_MENU },
673 { ACTION_FM_STOP, BUTTON_RC_STOP, BUTTON_NONE },
674 { ACTION_FM_MODE, BUTTON_RC_ON | BUTTON_REPEAT, BUTTON_RC_ON },
675 { ACTION_FM_EXIT, BUTTON_RC_MODE | BUTTON_REL, BUTTON_RC_MODE },
676 { ACTION_FM_PLAY, BUTTON_RC_ON | BUTTON_REL, BUTTON_RC_ON },
677 { ACTION_FM_NEXT_PRESET, BUTTON_RC_BITRATE, BUTTON_NONE },
678 { ACTION_FM_PREV_PRESET, BUTTON_RC_SOURCE, BUTTON_NONE },
679 { ACTION_SETTINGS_INC, BUTTON_RC_VOL_UP, BUTTON_NONE },
680 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
681 { ACTION_SETTINGS_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
682 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
683 { ACTION_STD_PREV, BUTTON_RC_REW, BUTTON_NONE },
684 { ACTION_STD_PREVREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
685 { ACTION_STD_NEXT, BUTTON_RC_FF, BUTTON_NONE },
686 { ACTION_STD_NEXTREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
688 LAST_ITEM_IN_LIST
691 static const struct button_mapping button_context_radio_h300lcdremote[] = {
692 { ACTION_FM_MENU, BUTTON_RC_MENU | BUTTON_REPEAT, BUTTON_NONE },
693 { ACTION_FM_PRESET, BUTTON_RC_MENU | BUTTON_REL, BUTTON_RC_MENU },
694 { ACTION_FM_STOP, BUTTON_RC_STOP, BUTTON_NONE },
695 { ACTION_FM_MODE, BUTTON_RC_ON | BUTTON_REPEAT, BUTTON_RC_ON },
696 { ACTION_FM_EXIT, BUTTON_RC_MODE | BUTTON_REL, BUTTON_RC_MODE },
697 { ACTION_FM_PLAY, BUTTON_RC_ON | BUTTON_REL, BUTTON_RC_ON },
698 { ACTION_FM_NEXT_PRESET, BUTTON_RC_BITRATE, BUTTON_NONE },
699 { ACTION_FM_PREV_PRESET, BUTTON_RC_SOURCE, BUTTON_NONE },
700 { ACTION_STD_PREV, BUTTON_RC_REW, BUTTON_NONE },
701 { ACTION_STD_PREVREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
702 { ACTION_STD_NEXT, BUTTON_RC_FF, BUTTON_NONE },
703 { ACTION_STD_NEXTREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
705 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
709 static const struct button_mapping button_context_time_remote[] = {
710 { ACTION_STD_CANCEL, BUTTON_OFF, BUTTON_NONE },
711 { ACTION_STD_OK, BUTTON_ON, BUTTON_NONE },
712 { ACTION_SETTINGS_INC, BUTTON_RC_BITRATE, BUTTON_NONE },
713 { ACTION_SETTINGS_DEC, BUTTON_RC_SOURCE, BUTTON_NONE },
714 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS),
715 }; /* button_context_settings_bmark */
717 /* the actual used tables */
718 static const struct button_mapping
719 *remote_btn_ctxt_std = 0,
720 *remote_btn_ctxt_wps = 0,
721 *remote_btn_ctxt_list = 0,
722 *remote_btn_ctxt_tree = 0,
723 *remote_btn_ctxt_listtree_scroll_w_cmb = 0,
724 *remote_btn_ctxt_listtree_scroll_wo_cmb = 0,
725 *remote_btn_ctxt_settings = 0,
726 *remote_btn_ctxt_settingsgrph = 0,
727 *remote_btn_ctxt_yesno = 0,
728 *remote_btn_ctxt_bmark = 0,
729 *remote_btn_ctxt_quickscreen = 0,
730 *remote_btn_ctxt_pitchscreen = 0,
731 *remote_btn_ctxt_recscreen = 0,
732 *remote_btn_ctxt_keyboard = 0,
733 *remote_btn_ctxt_radio = 0;
735 static int _remote_type = -1; /*safe value, forces the first press to init the mappings */
737 static void remap_remote(void)
739 _remote_type = remote_type();
740 switch(_remote_type)
742 case REMOTETYPE_UNPLUGGED:
743 remote_btn_ctxt_std = NULL;
744 remote_btn_ctxt_wps = NULL;
745 remote_btn_ctxt_list = NULL;
746 remote_btn_ctxt_tree = NULL;
747 remote_btn_ctxt_listtree_scroll_w_cmb = NULL;
748 remote_btn_ctxt_listtree_scroll_wo_cmb = NULL;
749 remote_btn_ctxt_settings = NULL;
750 remote_btn_ctxt_settingsgrph = NULL;
751 remote_btn_ctxt_yesno = NULL;
752 remote_btn_ctxt_bmark = NULL;
753 remote_btn_ctxt_quickscreen = NULL;
754 remote_btn_ctxt_pitchscreen = NULL;
755 remote_btn_ctxt_recscreen = NULL;
756 remote_btn_ctxt_keyboard = NULL;
757 remote_btn_ctxt_radio = NULL;
758 break;
760 case REMOTETYPE_H100_LCD:
761 remote_btn_ctxt_std = button_context_standard_h100remote,
762 remote_btn_ctxt_wps = button_context_wps_h100remote,
763 remote_btn_ctxt_list = button_context_list_h100remote,
764 remote_btn_ctxt_tree = button_context_tree_h100remote,
765 remote_btn_ctxt_listtree_scroll_w_cmb
766 = button_context_listtree_scroll_w_cmb_h100remote,
767 remote_btn_ctxt_listtree_scroll_wo_cmb
768 = button_context_listtree_scroll_wo_cmb_h100remote,
769 remote_btn_ctxt_settings = button_context_settings_h100remote,
770 remote_btn_ctxt_settingsgrph
771 = button_context_settingsgraphical_h100remote,
772 remote_btn_ctxt_yesno = button_context_yesno_h100remote,
773 remote_btn_ctxt_bmark = button_context_bmark_h100remote,
774 remote_btn_ctxt_quickscreen
775 = button_context_quickscreen_h100lcdremote,
776 remote_btn_ctxt_pitchscreen
777 = button_context_pitchscreen_h100lcdremote,
778 remote_btn_ctxt_recscreen
779 = button_context_recscreen_h100remote,
780 remote_btn_ctxt_keyboard
781 = button_context_keyboard_h100remote,
782 remote_btn_ctxt_radio
783 = button_context_radio_h100remote;
784 break;
786 case REMOTETYPE_H300_LCD:
787 remote_btn_ctxt_std = button_context_standard_h300lcdremote,
788 remote_btn_ctxt_wps = button_context_wps_h300lcdremote,
789 remote_btn_ctxt_list = button_context_list_h300lcdremote,
790 remote_btn_ctxt_tree = button_context_tree_h300lcdremote,
791 remote_btn_ctxt_listtree_scroll_w_cmb
792 = button_context_listtree_scroll_w_cmb_h300lcdremote,
793 remote_btn_ctxt_listtree_scroll_wo_cmb
794 = button_context_listtree_scroll_wo_cmb_h300lcdremote,
795 remote_btn_ctxt_settings = button_context_settings_h300lcdremote,
796 remote_btn_ctxt_settingsgrph
797 = button_context_settingsgraphical_h300lcdremote,
798 remote_btn_ctxt_yesno = button_context_yesno_h300lcdremote,
799 remote_btn_ctxt_bmark = button_context_bmark_h300lcdremote,
800 remote_btn_ctxt_quickscreen
801 = button_context_quickscreen_h300lcdremote,
802 remote_btn_ctxt_pitchscreen
803 = button_context_pitchscreen_h300lcdremote,
804 remote_btn_ctxt_recscreen
805 = button_context_recscreen_h300lcdremote,
806 remote_btn_ctxt_keyboard
807 = button_context_keyboard_h300lcdremote,
808 remote_btn_ctxt_radio
809 = button_context_radio_h300lcdremote;
810 break;
812 case REMOTETYPE_H300_NONLCD: /* FIXME: add its tables */
813 remote_btn_ctxt_std = button_context_standard_h300lcdremote,
814 remote_btn_ctxt_wps = button_context_wps_h300lcdremote,
815 remote_btn_ctxt_list = button_context_list_h300lcdremote,
816 remote_btn_ctxt_tree = button_context_tree_h300lcdremote,
817 remote_btn_ctxt_listtree_scroll_w_cmb
818 = button_context_listtree_scroll_w_cmb_h300lcdremote,
819 remote_btn_ctxt_listtree_scroll_wo_cmb
820 = button_context_listtree_scroll_wo_cmb_h300lcdremote,
821 remote_btn_ctxt_settings = button_context_settings_h300lcdremote,
822 remote_btn_ctxt_settingsgrph
823 = button_context_settingsgraphical_h300lcdremote,
824 remote_btn_ctxt_yesno = button_context_yesno_h300lcdremote,
825 remote_btn_ctxt_bmark = button_context_bmark_h300lcdremote,
826 remote_btn_ctxt_quickscreen
827 = button_context_quickscreen_nonlcdremote,
828 remote_btn_ctxt_pitchscreen
829 = button_context_pitchscreen_nonlcdremote,
830 remote_btn_ctxt_recscreen
831 = button_context_recscreen_h300lcdremote,
832 remote_btn_ctxt_keyboard
833 = button_context_keyboard_h300lcdremote,
834 remote_btn_ctxt_radio
835 = button_context_radio_h300lcdremote;
836 #if 0
837 remote_btn_ctxt_std =
838 remote_btn_ctxt_wps =
839 remote_btn_ctxt_list =
840 remote_btn_ctxt_tree =
841 remote_btn_ctxt_listtree_scroll_w_cmb =
842 remote_btn_ctxt_listtree_scroll_wo_cmb =
843 remote_btn_ctxt_settings =
844 remote_btn_ctxt_settingsgrph =
845 remote_btn_ctxt_yesno =
846 remote_btn_ctxt_bmark =
847 remote_btn_ctxt_quickscreen =
848 remote_btn_ctxt_pitchscreen =
849 remote_btn_ctxt_recscreen =
850 remote_btn_ctxt_keyboard =
851 remote_btn_ctxt_radio =
852 #endif
853 break;
859 static const struct button_mapping* get_context_mapping_remote(int context)
861 if(remote_type() != _remote_type)
862 remap_remote();
863 context ^= CONTEXT_REMOTE;
865 switch (context)
867 case CONTEXT_STD:
868 return remote_btn_ctxt_std;
869 case CONTEXT_WPS: /* common for all remotes */
870 return button_context_wps_remotescommon;
872 case CONTEXT_CUSTOM|CONTEXT_WPS:
873 return remote_btn_ctxt_wps;
875 case CONTEXT_LIST:
876 return remote_btn_ctxt_list;
877 case CONTEXT_TREE:
878 case CONTEXT_MAINMENU:
879 if (global_settings.hold_lr_for_scroll_in_list)
880 return remote_btn_ctxt_listtree_scroll_wo_cmb;
881 else
882 return remote_btn_ctxt_listtree_scroll_w_cmb;
883 case CONTEXT_CUSTOM|CONTEXT_TREE:
884 return remote_btn_ctxt_tree;
885 case CONTEXT_SETTINGS_TIME:
886 case CONTEXT_SETTINGS_RECTRIGGER:
887 return remote_btn_ctxt_settingsgrph;
889 case CONTEXT_SETTINGS:
890 return remote_btn_ctxt_settings;
892 case CONTEXT_YESNOSCREEN:
893 return remote_btn_ctxt_yesno;
895 case CONTEXT_BOOKMARKSCREEN:
896 return remote_btn_ctxt_bmark;
897 case CONTEXT_QUICKSCREEN:
898 return remote_btn_ctxt_quickscreen;
899 case CONTEXT_PITCHSCREEN:
900 return remote_btn_ctxt_pitchscreen;
901 case CONTEXT_RECSCREEN:
902 return remote_btn_ctxt_recscreen;
903 case CONTEXT_KEYBOARD:
904 case CONTEXT_MORSE_INPUT:
905 return remote_btn_ctxt_keyboard;
906 case CONTEXT_FM:
907 return remote_btn_ctxt_radio;
909 return remote_btn_ctxt_std;
912 const struct button_mapping* get_context_mapping(int context)
914 if (context&CONTEXT_REMOTE)
915 return get_context_mapping_remote(context);
917 switch (context)
919 case CONTEXT_STD:
920 return button_context_standard;
921 case CONTEXT_WPS:
922 return button_context_wps;
924 case CONTEXT_LIST:
925 return button_context_list;
926 case CONTEXT_TREE:
927 case CONTEXT_MAINMENU:
928 if (global_settings.hold_lr_for_scroll_in_list)
929 return button_context_listtree_scroll_without_combo;
930 else
931 return button_context_listtree_scroll_with_combo;
932 case CONTEXT_CUSTOM|CONTEXT_TREE:
933 return button_context_tree;
935 case CONTEXT_SETTINGS:
936 return button_context_settings;
937 case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
938 case CONTEXT_SETTINGS_RECTRIGGER:
939 return button_context_settings_right_is_inc;
941 case CONTEXT_SETTINGS_COLOURCHOOSER:
942 return button_context_colorchooser;
943 case CONTEXT_SETTINGS_EQ:
944 return button_context_eq;
946 case CONTEXT_SETTINGS_TIME:
947 return button_context_time;
949 case CONTEXT_YESNOSCREEN:
950 return button_context_yesno;
951 case CONTEXT_BOOKMARKSCREEN:
952 return button_context_bmark;
953 case CONTEXT_QUICKSCREEN:
954 return button_context_quickscreen;
955 case CONTEXT_PITCHSCREEN:
956 return button_context_pitchscreen;
957 case CONTEXT_RECSCREEN:
958 return button_context_recscreen;
959 case CONTEXT_KEYBOARD:
960 case CONTEXT_MORSE_INPUT:
961 return button_context_keyboard;
962 case CONTEXT_FM:
963 return button_context_radio;
965 return button_context_standard;