Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
Michael Sevakis | 55e899c | 2006-10-12 18:13:23 +0000 | [diff] [blame] | 8 | * $Id$ |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 9 | * |
| 10 | * Copyright (C) 2006 Jonathan Gordon |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 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. |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | |
| 22 | /* * |
| 23 | * Button Code Definitions for iaudio x5 targets |
| 24 | * |
| 25 | * \TODO test! |
| 26 | */ |
| 27 | |
| 28 | #include "config.h" |
| 29 | #include "action.h" |
| 30 | #include "button.h" |
| 31 | #include "settings.h" |
| 32 | |
| 33 | /* CONTEXT_CUSTOM's used in this file... |
| 34 | |
Jonathan Gordon | d12f81d | 2006-08-21 07:03:15 +0000 | [diff] [blame] | 35 | CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 36 | |
| 37 | |
| 38 | */ |
| 39 | |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 40 | /** Keep things alphabetized for easy reference but standard contexts can |
| 41 | ** be first and sub-alphebetized. |
| 42 | **/ |
| 43 | |
| 44 | /** Standard Button Contexts **/ |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 45 | static const struct button_mapping button_context_standard[] = { |
Jens Arnold | 1fdb5bf | 2006-08-16 00:32:45 +0000 | [diff] [blame] | 46 | { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, |
| 47 | { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 48 | { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, |
| 49 | { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 50 | |
| 51 | { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 52 | { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, |
| 53 | { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, |
| 54 | { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, |
| 55 | { ACTION_STD_OK, BUTTON_PLAY, BUTTON_NONE }, |
| 56 | { ACTION_STD_MENU, BUTTON_REC|BUTTON_REL, BUTTON_REC }, |
| 57 | { ACTION_STD_QUICKSCREEN,BUTTON_REC|BUTTON_REPEAT, BUTTON_REC }, |
| 58 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, |
| 59 | |
| 60 | LAST_ITEM_IN_LIST |
Rani Hod | cbe4427 | 2006-09-23 02:10:00 +0000 | [diff] [blame] | 61 | }; /* button_context_standard */ |
| 62 | |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 63 | static const struct button_mapping remote_button_context_standard[] = { |
Rani Hod | cbe4427 | 2006-09-23 02:10:00 +0000 | [diff] [blame] | 64 | { ACTION_STD_PREV, BUTTON_RC_REW, BUTTON_NONE }, |
| 65 | { ACTION_STD_PREVREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE }, |
| 66 | { ACTION_STD_NEXT, BUTTON_RC_FF, BUTTON_NONE }, |
| 67 | { ACTION_STD_NEXTREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE }, |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 68 | |
Rani Hod | cbe4427 | 2006-09-23 02:10:00 +0000 | [diff] [blame] | 69 | { ACTION_STD_CONTEXT, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY }, |
| 70 | { ACTION_STD_CANCEL, BUTTON_RC_MODE, BUTTON_NONE }, |
| 71 | { ACTION_STD_OK, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY }, |
| 72 | { ACTION_STD_MENU, BUTTON_RC_MENU|BUTTON_REL, BUTTON_RC_MENU }, |
| 73 | { ACTION_STD_QUICKSCREEN, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_RC_MENU }, |
| 74 | |
| 75 | LAST_ITEM_IN_LIST |
| 76 | }; /* remote_button_context_standard */ |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 77 | |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 78 | /** Bookmark Screen **/ |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 79 | static const struct button_mapping button_context_bmark[] = { |
Jonathan Gordon | 53a93be | 2006-12-03 01:22:13 +0000 | [diff] [blame] | 80 | { ACTION_BMS_DELETE, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC }, |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 81 | |
Magnus Holmgren | e676b81 | 2007-05-26 10:44:38 +0000 | [diff] [blame] | 82 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 83 | }; /* button_context_settings_bmark */ |
| 84 | |
| 85 | /** FM Radio Screen **/ |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 86 | static const struct button_mapping button_context_radio[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 87 | { ACTION_FM_MENU, BUTTON_SELECT | BUTTON_REPEAT, BUTTON_NONE }, |
| 88 | { ACTION_FM_PRESET, BUTTON_SELECT | BUTTON_REL, BUTTON_SELECT }, |
| 89 | { ACTION_FM_STOP, BUTTON_POWER, BUTTON_NONE }, |
| 90 | { ACTION_FM_MODE, BUTTON_PLAY | BUTTON_REPEAT, BUTTON_PLAY }, |
| 91 | { ACTION_FM_EXIT, BUTTON_REC | BUTTON_REL, BUTTON_REC }, |
| 92 | { ACTION_FM_PLAY, BUTTON_PLAY | BUTTON_REL, BUTTON_PLAY }, |
| 93 | { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
| 94 | { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, |
| 95 | { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
| 96 | |
| 97 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) |
| 98 | }; /* button_context_radio */ |
| 99 | |
| 100 | /** Keyboard **/ |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 101 | static const struct button_mapping button_context_keyboard[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 102 | { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE }, |
| 103 | { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
| 104 | { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, |
| 105 | { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
| 106 | { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE }, |
| 107 | { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 108 | { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, |
| 109 | { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 110 | { ACTION_KBD_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, |
| 111 | { ACTION_KBD_DONE, BUTTON_PLAY, BUTTON_NONE }, |
| 112 | { ACTION_KBD_ABORT, BUTTON_REC, BUTTON_NONE }, |
| 113 | |
| 114 | LAST_ITEM_IN_LIST |
| 115 | }; /* button_context_keyboard */ |
| 116 | |
Michael Sevakis | d17a383 | 2007-03-07 07:41:47 +0000 | [diff] [blame] | 117 | static const struct button_mapping remote_button_context_keyboard[] = { |
| 118 | { ACTION_KBD_LEFT, BUTTON_RC_REW, BUTTON_NONE }, |
| 119 | { ACTION_KBD_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE }, |
| 120 | { ACTION_KBD_RIGHT, BUTTON_RC_FF, BUTTON_NONE }, |
| 121 | { ACTION_KBD_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE }, |
| 122 | { ACTION_KBD_SELECT_REM, BUTTON_RC_REC|BUTTON_REL, BUTTON_NONE }, |
Michael Sevakis | 6915ae5 | 2007-03-07 08:14:18 +0000 | [diff] [blame] | 123 | { ACTION_KBD_SELECT_REM, BUTTON_RC_MENU|BUTTON_REL, BUTTON_NONE }, |
Michael Sevakis | d17a383 | 2007-03-07 07:41:47 +0000 | [diff] [blame] | 124 | { ACTION_KBD_DONE, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE }, |
| 125 | { ACTION_KBD_ABORT, BUTTON_RC_MODE, BUTTON_NONE }, |
| 126 | { ACTION_KBD_UP, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, |
| 127 | { ACTION_KBD_UP, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 128 | { ACTION_KBD_DOWN, BUTTON_RC_VOL_UP, BUTTON_NONE }, |
| 129 | { ACTION_KBD_DOWN, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 130 | |
| 131 | LAST_ITEM_IN_LIST |
| 132 | }; /* button_context_keyboard_h100remote */ |
| 133 | |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 134 | static const struct button_mapping remote_button_context_mainmenu[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 135 | { ACTION_STD_CANCEL, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, |
| 136 | { ACTION_STD_OK, BUTTON_RC_VOL_UP, BUTTON_NONE }, |
| 137 | |
| 138 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) |
| 139 | }; /* remote_button_context_mainmenu */ |
| 140 | |
| 141 | /** Pitchscreen **/ |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 142 | static const struct button_mapping button_context_pitchscreen[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 143 | { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE }, |
| 144 | { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 145 | { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE }, |
| 146 | { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 147 | { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE }, |
| 148 | { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE }, |
| 149 | { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, |
| 150 | { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE }, |
Linus Nielsen Feltzing | 3b99840 | 2006-11-06 09:19:40 +0000 | [diff] [blame] | 151 | { ACTION_PS_TOGGLE_MODE, BUTTON_SELECT, BUTTON_NONE }, |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 152 | { ACTION_PS_RESET, BUTTON_POWER, BUTTON_NONE }, |
| 153 | { ACTION_PS_EXIT, BUTTON_PLAY, BUTTON_NONE }, |
| 154 | |
| 155 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) |
| 156 | }; /* button_context_pitchscreen */ |
| 157 | |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 158 | static const struct button_mapping remote_button_context_pitchscreen[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 159 | { ACTION_PS_INC_SMALL, BUTTON_RC_VOL_UP, BUTTON_NONE }, |
| 160 | { ACTION_PS_INC_BIG, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 161 | { ACTION_PS_DEC_SMALL, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, |
| 162 | { ACTION_PS_DEC_BIG, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 163 | { ACTION_PS_NUDGE_LEFT, BUTTON_RC_REW, BUTTON_NONE }, |
| 164 | { ACTION_PS_NUDGE_LEFTOFF, BUTTON_RC_REW|BUTTON_REL, BUTTON_NONE }, |
| 165 | { ACTION_PS_NUDGE_RIGHT, BUTTON_RC_FF, BUTTON_NONE }, |
| 166 | { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RC_FF|BUTTON_REL, BUTTON_NONE }, |
| 167 | { ACTION_PS_RESET, BUTTON_RC_MODE, BUTTON_NONE }, |
| 168 | { ACTION_PS_EXIT, BUTTON_RC_PLAY, BUTTON_NONE }, |
| 169 | |
| 170 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) |
| 171 | }; /* remote_button_context_pitchscreen */ |
| 172 | |
| 173 | /** Quickscreen **/ |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 174 | static const struct button_mapping button_context_quickscreen[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 175 | { ACTION_QS_DOWNINV, BUTTON_UP, BUTTON_NONE }, |
| 176 | { ACTION_QS_DOWNINV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 177 | { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE }, |
| 178 | { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 179 | { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE }, |
| 180 | { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
| 181 | { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, |
| 182 | { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
| 183 | { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE }, |
| 184 | |
| 185 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) |
| 186 | }; /* button_context_quickscreen */ |
| 187 | |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 188 | static const struct button_mapping remote_button_context_quickscreen[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 189 | { ACTION_QS_DOWNINV, BUTTON_RC_VOL_UP, BUTTON_NONE }, |
| 190 | { ACTION_QS_DOWNINV, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 191 | { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, |
| 192 | { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 193 | { ACTION_QS_LEFT, BUTTON_RC_REW, BUTTON_NONE }, |
| 194 | { ACTION_QS_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE }, |
| 195 | { ACTION_QS_RIGHT, BUTTON_RC_FF, BUTTON_NONE }, |
| 196 | { ACTION_QS_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE }, |
| 197 | |
| 198 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) |
| 199 | }; /* remote_button_context_quickscreen */ |
| 200 | |
| 201 | /** Recording Screen **/ |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 202 | static const struct button_mapping button_context_recscreen[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 203 | { ACTION_REC_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, |
| 204 | { ACTION_STD_CANCEL, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, |
| 205 | { ACTION_REC_NEWFILE, BUTTON_REC|BUTTON_REL, BUTTON_REC }, |
| 206 | { ACTION_STD_MENU, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC }, |
| 207 | { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, |
Linus Nielsen Feltzing | 236cdae | 2007-11-26 11:51:39 +0000 | [diff] [blame] | 208 | { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 209 | { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, |
Linus Nielsen Feltzing | 236cdae | 2007-11-26 11:51:39 +0000 | [diff] [blame] | 210 | { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 211 | |
| 212 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) |
| 213 | }; /* button_context_recscreen */ |
| 214 | |
| 215 | /** Settings - General Mappings **/ |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 216 | static const struct button_mapping button_context_settings[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 217 | { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, |
| 218 | { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 219 | { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, |
| 220 | { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 221 | { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, |
| 222 | { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE }, |
| 223 | |
| 224 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) |
| 225 | }; /* button_context_settings */ |
| 226 | |
| 227 | /** Settings - Using Sliders **/ |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 228 | static const struct button_mapping button_context_settings_r_is_inc[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 229 | { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, |
| 230 | { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
| 231 | { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, |
| 232 | { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
| 233 | { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, |
| 234 | { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 235 | { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, |
| 236 | { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 237 | { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE }, |
| 238 | |
| 239 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) |
| 240 | }; /* button_context_settings_r_is_inc */ |
| 241 | |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 242 | static const struct button_mapping remote_button_context_settings_r_is_inc[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 243 | { ACTION_SETTINGS_INC, BUTTON_RC_VOL_UP, BUTTON_NONE }, |
| 244 | { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 245 | { ACTION_SETTINGS_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, |
| 246 | { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 247 | { ACTION_STD_PREV, BUTTON_RC_REW, BUTTON_NONE }, |
| 248 | { ACTION_STD_PREVREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE }, |
| 249 | { ACTION_STD_NEXT, BUTTON_RC_FF, BUTTON_NONE }, |
| 250 | { ACTION_STD_NEXTREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE }, |
| 251 | |
| 252 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) |
| 253 | }; /* remote_button_context_settings_r_is_inc */ |
| 254 | |
| 255 | /** Settings - Time/Date **/ |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 256 | static const struct button_mapping button_context_settings_time[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 257 | { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
| 258 | { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, |
| 259 | { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
| 260 | |
| 261 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) |
| 262 | }; /* button_context_settings */ |
| 263 | |
| 264 | /** Tree **/ |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 265 | static const struct button_mapping button_context_tree[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 266 | { ACTION_NONE, BUTTON_PLAY, BUTTON_NONE }, |
| 267 | { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, |
| 268 | { ACTION_TREE_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, |
| 269 | |
| 270 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) |
| 271 | }; /* button_context_tree */ |
| 272 | |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 273 | static const struct button_mapping remote_button_context_tree[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 274 | { ACTION_STD_CANCEL, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, |
| 275 | { ACTION_STD_OK, BUTTON_RC_VOL_UP, BUTTON_NONE }, |
| 276 | { ACTION_NONE, BUTTON_RC_MODE, BUTTON_NONE }, |
| 277 | { ACTION_TREE_WPS, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE }, |
| 278 | |
| 279 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) |
| 280 | }; /* remote_button_context_tree */ |
| 281 | |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 282 | static const struct button_mapping button_context_tree_scroll_lr[] = { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 283 | { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, |
| 284 | { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, |
| 285 | { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, |
| 286 | { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
| 287 | { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, |
| 288 | { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE }, |
| 289 | { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, |
| 290 | { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
| 291 | { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, |
| 292 | |
| 293 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), |
| 294 | }; /* button_context_tree_scroll_lr */ |
| 295 | |
| 296 | /** While-Playing Screen (WPS) **/ |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 297 | static const struct button_mapping button_context_wps[] = { |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 298 | { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, |
| 299 | { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, |
| 300 | { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, |
Jens Arnold | 1fdb5bf | 2006-08-16 00:32:45 +0000 | [diff] [blame] | 301 | { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 302 | { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, |
| 303 | { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, |
Jens Arnold | 1fdb5bf | 2006-08-16 00:32:45 +0000 | [diff] [blame] | 304 | { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 305 | { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 306 | |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 307 | { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE }, |
Jens Arnold | 1fdb5bf | 2006-08-16 00:32:45 +0000 | [diff] [blame] | 308 | { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 309 | { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE }, |
Jens Arnold | 1fdb5bf | 2006-08-16 00:32:45 +0000 | [diff] [blame] | 310 | { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 311 | |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 312 | { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, |
| 313 | { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, |
| 314 | { ACTION_WPS_MENU, BUTTON_REC|BUTTON_REL, BUTTON_REC }, |
| 315 | { ACTION_WPS_QUICKSCREEN, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC }, |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 316 | |
| 317 | LAST_ITEM_IN_LIST |
Rani Hod | cbe4427 | 2006-09-23 02:10:00 +0000 | [diff] [blame] | 318 | }; /* button_context_wps */ |
| 319 | |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 320 | static const struct button_mapping remote_button_context_wps[] = { |
Rani Hod | cbe4427 | 2006-09-23 02:10:00 +0000 | [diff] [blame] | 321 | { ACTION_WPS_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY }, |
| 322 | { ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY }, |
| 323 | { ACTION_WPS_SKIPPREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW }, |
| 324 | { ACTION_WPS_SEEKBACK, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE }, |
| 325 | { ACTION_WPS_STOPSEEK, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT }, |
| 326 | { ACTION_WPS_SKIPNEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF }, |
| 327 | { ACTION_WPS_SEEKFWD, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE }, |
| 328 | { ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT }, |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 329 | |
Rani Hod | cbe4427 | 2006-09-23 02:10:00 +0000 | [diff] [blame] | 330 | { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, |
| 331 | { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 332 | { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE }, |
| 333 | { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 334 | |
Rani Hod | cbe4427 | 2006-09-23 02:10:00 +0000 | [diff] [blame] | 335 | { ACTION_WPS_BROWSE, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE }, |
| 336 | { ACTION_WPS_CONTEXT, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE }, |
| 337 | { ACTION_WPS_MENU, BUTTON_RC_MENU|BUTTON_REL, BUTTON_RC_MENU }, |
| 338 | { ACTION_WPS_QUICKSCREEN, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_RC_MENU }, |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 339 | |
Rani Hod | cbe4427 | 2006-09-23 02:10:00 +0000 | [diff] [blame] | 340 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) |
| 341 | }; /* remote_button_context_wps */ |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 342 | |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 343 | /** Yes/No Screen **/ |
Jens Arnold | a0f3113 | 2006-12-12 07:55:17 +0000 | [diff] [blame] | 344 | static const struct button_mapping button_context_yesnoscreen[] = { |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 345 | { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE }, |
Linus Nielsen Feltzing | 1d1c59e | 2006-08-22 08:33:51 +0000 | [diff] [blame] | 346 | LAST_ITEM_IN_LIST |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 347 | }; /* button_context_settings_yesnoscreen */ |
Martin Scarratt | a982365 | 2006-09-22 12:18:58 +0000 | [diff] [blame] | 348 | |
Linus Nielsen Feltzing | e5f1fe9 | 2006-08-17 14:33:05 +0000 | [diff] [blame] | 349 | static const struct button_mapping* get_context_mapping_remote( int context ) |
| 350 | { |
| 351 | context ^= CONTEXT_REMOTE; |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 352 | |
Linus Nielsen Feltzing | e5f1fe9 | 2006-08-17 14:33:05 +0000 | [diff] [blame] | 353 | switch (context) |
| 354 | { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 355 | /* anything that uses remote_button_context_standard */ |
| 356 | default: |
| 357 | return remote_button_context_standard; |
| 358 | |
| 359 | /* remote contexts with special mapping */ |
Michael Sevakis | d17a383 | 2007-03-07 07:41:47 +0000 | [diff] [blame] | 360 | case CONTEXT_KEYBOARD: |
| 361 | return remote_button_context_keyboard; |
| 362 | |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 363 | case CONTEXT_MAINMENU: |
| 364 | return remote_button_context_mainmenu; |
| 365 | |
| 366 | case CONTEXT_PITCHSCREEN: |
| 367 | return remote_button_context_pitchscreen; |
| 368 | |
| 369 | case CONTEXT_QUICKSCREEN: |
| 370 | return remote_button_context_quickscreen; |
| 371 | |
| 372 | case CONTEXT_SETTINGS_COLOURCHOOSER: |
| 373 | case CONTEXT_SETTINGS_EQ: |
| 374 | case CONTEXT_SETTINGS_TIME: |
| 375 | return remote_button_context_settings_r_is_inc; |
| 376 | |
Linus Nielsen Feltzing | e5f1fe9 | 2006-08-17 14:33:05 +0000 | [diff] [blame] | 377 | case CONTEXT_TREE: |
| 378 | return remote_button_context_tree; |
| 379 | |
| 380 | case CONTEXT_WPS: |
| 381 | return remote_button_context_wps; |
Linus Nielsen Feltzing | e5f1fe9 | 2006-08-17 14:33:05 +0000 | [diff] [blame] | 382 | } |
| 383 | } |
| 384 | |
Jens Arnold | 1fdb5bf | 2006-08-16 00:32:45 +0000 | [diff] [blame] | 385 | const struct button_mapping* get_context_mapping( int context ) |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 386 | { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 387 | if (context & CONTEXT_REMOTE) |
Linus Nielsen Feltzing | e5f1fe9 | 2006-08-17 14:33:05 +0000 | [diff] [blame] | 388 | return get_context_mapping_remote(context); |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 389 | |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 390 | switch( context ) |
| 391 | { |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 392 | /* anything that uses button_context_standard */ |
| 393 | case CONTEXT_LIST: |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 394 | case CONTEXT_STD: |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 395 | default: |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 396 | return button_context_standard; |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 397 | |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 398 | /* contexts with special mapping */ |
| 399 | case CONTEXT_BOOKMARKSCREEN: |
| 400 | return button_context_bmark; |
| 401 | |
| 402 | case CONTEXT_FM: |
| 403 | return button_context_radio; |
| 404 | |
| 405 | case CONTEXT_KEYBOARD: |
| 406 | return button_context_keyboard; |
| 407 | |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 408 | |
| 409 | case CONTEXT_PITCHSCREEN: |
| 410 | return button_context_pitchscreen; |
| 411 | |
| 412 | case CONTEXT_QUICKSCREEN: |
| 413 | return button_context_quickscreen; |
| 414 | |
| 415 | case CONTEXT_RECSCREEN: |
| 416 | return button_context_recscreen; |
Linus Nielsen Feltzing | 0fec0f5 | 2006-08-16 20:09:29 +0000 | [diff] [blame] | 417 | |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 418 | case CONTEXT_SETTINGS: |
| 419 | return button_context_settings; |
| 420 | |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 421 | case CONTEXT_SETTINGS_COLOURCHOOSER: |
| 422 | case CONTEXT_SETTINGS_EQ: |
Jonathan Gordon | ff469ab | 2008-05-28 10:55:39 +0000 | [diff] [blame] | 423 | case CONTEXT_SETTINGS_RECTRIGGER: |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 424 | return button_context_settings_r_is_inc; |
| 425 | |
| 426 | case CONTEXT_SETTINGS_TIME: |
| 427 | return button_context_settings_time; |
| 428 | |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 429 | case CONTEXT_TREE: |
Jonathan Gordon | a053e58 | 2007-04-08 01:33:01 +0000 | [diff] [blame] | 430 | case CONTEXT_MAINMENU: |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 431 | if (global_settings.hold_lr_for_scroll_in_list) |
| 432 | return button_context_tree_scroll_lr; |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 433 | /* else fall through to CONTEXT_TREE|CONTEXT_CUSTOM */ |
| 434 | case CONTEXT_TREE|CONTEXT_CUSTOM: |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 435 | return button_context_tree; |
Martin Scarratt | 0ba2204 | 2006-08-22 13:21:13 +0000 | [diff] [blame] | 436 | |
Michael Sevakis | 6c9b1d4 | 2006-10-12 17:49:46 +0000 | [diff] [blame] | 437 | case CONTEXT_WPS: |
| 438 | return button_context_wps; |
| 439 | |
| 440 | case CONTEXT_YESNOSCREEN: |
| 441 | return button_context_yesnoscreen; |
Linus Nielsen Feltzing | 224c0a1 | 2006-08-15 12:27:07 +0000 | [diff] [blame] | 442 | } |
| 443 | } |