Onda VX747: don't enable software volume control in sims
[kugel-rb.git] / apps / keymaps / keymap-cowond2.c
blob61fade99ed12647718044690f42e5ad49dec18d4
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2008 Rob Purchase
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 the Cowon D2 target */
23 /* NB: Up/Down/Left/Right are not physical buttons - touchscreen emulation */
25 #include <stdio.h>
26 #include <string.h>
27 #include <stdlib.h>
29 #include "config.h"
30 #include "action.h"
31 #include "button.h"
32 #include "settings.h"
35 * The format of the list is as follows
36 * { Action Code, Button code, Prereq button code }
37 * if there's no need to check the previous button's value, use BUTTON_NONE
38 * Insert LAST_ITEM_IN_LIST at the end of each mapping
41 static const struct button_mapping button_context_standard[] = {
42 { ACTION_STD_PREV, BUTTON_MINUS, BUTTON_NONE },
43 { ACTION_STD_PREVREPEAT, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE },
44 { ACTION_STD_NEXT, BUTTON_PLUS, BUTTON_NONE },
45 { ACTION_STD_NEXTREPEAT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE },
47 { ACTION_STD_OK, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
48 { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
50 { ACTION_STD_QUICKSCREEN, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE },
51 { ACTION_STD_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
53 LAST_ITEM_IN_LIST
54 }; /* button_context_standard */
57 static const struct button_mapping button_context_wps[] = {
59 { ACTION_WPS_VOLDOWN, BUTTON_MINUS, BUTTON_NONE },
60 { ACTION_WPS_VOLDOWN, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE },
61 { ACTION_WPS_VOLUP, BUTTON_PLUS, BUTTON_NONE },
62 { ACTION_WPS_VOLUP, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE },
63 { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
64 { ACTION_WPS_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
66 { ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
68 LAST_ITEM_IN_LIST
69 }; /* button_context_wps */
71 static const struct button_mapping button_context_list[] = {
72 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
73 }; /* button_context_list */
75 static const struct button_mapping button_context_tree[] = {
76 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST)
77 }; /* button_context_tree */
79 static const struct button_mapping button_context_listtree_scroll_with_combo[] = {
80 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
83 static const struct button_mapping button_context_listtree_scroll_without_combo[] = {
84 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
87 static const struct button_mapping button_context_settings[] = {
88 { ACTION_SETTINGS_INC, BUTTON_PLUS, BUTTON_NONE },
89 { ACTION_SETTINGS_INCREPEAT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE },
90 { ACTION_SETTINGS_DEC, BUTTON_MINUS, BUTTON_NONE },
91 { ACTION_SETTINGS_DECREPEAT, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE },
92 { ACTION_STD_OK, BUTTON_MENU, BUTTON_NONE },
93 { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
95 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
96 }; /* button_context_settings */
98 static const struct button_mapping button_context_settings_right_is_inc[] = {
100 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
101 }; /* button_context_settingsgraphical */
103 static const struct button_mapping button_context_yesno[] = {
104 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
105 }; /* button_context_settings_yesno */
107 static const struct button_mapping button_context_colorchooser[] = {
108 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
109 }; /* button_context_colorchooser */
111 static const struct button_mapping button_context_eq[] = {
112 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
113 }; /* button_context_eq */
115 /** Bookmark Screen **/
116 static const struct button_mapping button_context_bmark[] = {
117 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
118 }; /* button_context_bmark */
120 static const struct button_mapping button_context_time[] = {
121 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS),
122 }; /* button_context_time */
124 static const struct button_mapping button_context_quickscreen[] = {
126 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
127 }; /* button_context_quickscreen */
129 static const struct button_mapping button_context_pitchscreen[] = {
131 { ACTION_PS_INC_SMALL, BUTTON_PLUS, BUTTON_NONE },
132 { ACTION_PS_INC_SMALL, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE },
133 { ACTION_PS_DEC_SMALL, BUTTON_MINUS, BUTTON_NONE },
134 { ACTION_PS_DEC_SMALL, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE },
135 { ACTION_PS_EXIT, BUTTON_POWER, BUTTON_NONE },
136 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
137 }; /* button_context_pitchcreen */
139 static const struct button_mapping button_context_keyboard[] = {
140 { ACTION_KBD_PAGE_FLIP, BUTTON_MENU, BUTTON_NONE },
141 { ACTION_KBD_CURSOR_LEFT, BUTTON_MINUS, BUTTON_NONE },
142 { ACTION_KBD_CURSOR_LEFT, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE },
143 { ACTION_KBD_CURSOR_RIGHT, BUTTON_PLUS, BUTTON_NONE },
144 { ACTION_KBD_CURSOR_RIGHT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE },
146 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
147 }; /* button_context_keyboard */
149 static const struct button_mapping button_context_radio[] = {
150 { ACTION_FM_MENU, BUTTON_MENU, BUTTON_NONE },
151 { ACTION_FM_STOP, BUTTON_POWER, BUTTON_NONE },
153 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
154 }; /* button_context_radio */
156 const struct button_mapping* target_get_context_mapping(int context)
158 switch (context)
160 case CONTEXT_STD:
161 return button_context_standard;
162 case CONTEXT_WPS:
163 return button_context_wps;
165 case CONTEXT_LIST:
166 return button_context_list;
167 case CONTEXT_MAINMENU:
168 case CONTEXT_TREE:
169 if (global_settings.hold_lr_for_scroll_in_list)
170 return button_context_listtree_scroll_without_combo;
171 else
172 return button_context_listtree_scroll_with_combo;
173 case CONTEXT_CUSTOM|CONTEXT_TREE:
174 return button_context_tree;
176 case CONTEXT_SETTINGS:
177 return button_context_settings;
178 case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
179 case CONTEXT_SETTINGS_RECTRIGGER:
180 return button_context_settings_right_is_inc;
182 case CONTEXT_SETTINGS_COLOURCHOOSER:
183 return button_context_colorchooser;
184 case CONTEXT_SETTINGS_EQ:
185 return button_context_eq;
187 case CONTEXT_SETTINGS_TIME:
188 return button_context_time;
190 case CONTEXT_YESNOSCREEN:
191 return button_context_yesno;
192 case CONTEXT_FM:
193 return button_context_radio;
194 case CONTEXT_BOOKMARKSCREEN:
195 return button_context_bmark;
196 case CONTEXT_QUICKSCREEN:
197 return button_context_quickscreen;
198 case CONTEXT_PITCHSCREEN:
199 return button_context_pitchscreen;
200 case CONTEXT_KEYBOARD:
201 return button_context_keyboard;
203 return button_context_standard;