diff options
author | Jean-Louis Biasini <jlbiasini@gmail.com> | 2012-02-25 21:29:01 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2012-03-03 12:05:58 +0100 |
commit | 10c566ed94189141ba5aca287c74cd984a2010f5 (patch) | |
tree | 0cd17a732365486170521fc6c8a56dc6bc5753da /apps/plugins/logo.c | |
parent | f1e1ab8d416058692281ed7442485ed6037f7afb (diff) | |
download | rockbox-10c566ed94189141ba5aca287c74cd984a2010f5.tar.gz rockbox-10c566ed94189141ba5aca287c74cd984a2010f5.zip |
Plugin logo PLA integration (code + manual)
This commit changes:
1) replace all keymaps with PLA ones.
2) do the required change to the manual in order to match
code's changes.
3) add an alternative exit button (PLA_EXIT or PLA_CANCEL)
4) add the possibility to change values repeatily by holding key
pressed.
Change-Id: Ie68fd4e94830bba8a592941ee4e8b10aeacda923
Reviewed-on: http://gerrit.rockbox.org/127
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Tested-by: Thomas Martitz <kugel@rockbox.org>
Diffstat (limited to 'apps/plugins/logo.c')
-rw-r--r-- | apps/plugins/logo.c | 266 |
1 files changed, 31 insertions, 235 deletions
diff --git a/apps/plugins/logo.c b/apps/plugins/logo.c index 14360b4845..aae9e54562 100644 --- a/apps/plugins/logo.c +++ b/apps/plugins/logo.c | |||
@@ -20,8 +20,15 @@ | |||
20 | **************************************************************************/ | 20 | **************************************************************************/ |
21 | #include "plugin.h" | 21 | #include "plugin.h" |
22 | #include "lib/playergfx.h" | 22 | #include "lib/playergfx.h" |
23 | #include "lib/pluginlib_actions.h" | ||
23 | 24 | ||
24 | 25 | /* this set the context to use with PLA */ | |
26 | static const struct button_mapping *plugin_contexts[] | ||
27 | = { pla_main_ctx, | ||
28 | #ifdef HAVE_REMOTE_LCD | ||
29 | pla_remote_ctx, | ||
30 | #endif | ||
31 | }; | ||
25 | 32 | ||
26 | #ifdef HAVE_LCD_BITMAP | 33 | #ifdef HAVE_LCD_BITMAP |
27 | #define DISPLAY_WIDTH LCD_WIDTH | 34 | #define DISPLAY_WIDTH LCD_WIDTH |
@@ -57,223 +64,17 @@ const unsigned char rockbox16x7[] = { | |||
57 | }; | 64 | }; |
58 | #endif /* !LCD_BITMAP */ | 65 | #endif /* !LCD_BITMAP */ |
59 | 66 | ||
60 | /* variable button definitions */ | 67 | /* We use PLA */ |
61 | #if CONFIG_KEYPAD == PLAYER_PAD | 68 | #define LP_QUIT PLA_EXIT |
62 | #define LP_QUIT BUTTON_STOP | 69 | #define LP_QUIT2 PLA_CANCEL |
63 | #define LP_DEC_X BUTTON_LEFT | 70 | #define LP_DEC_X PLA_LEFT |
64 | #define LP_INC_X BUTTON_RIGHT | 71 | #define LP_DEC_X_REPEAT PLA_LEFT_REPEAT |
65 | #define LP_DEC_Y (BUTTON_ON | BUTTON_LEFT) | 72 | #define LP_INC_X PLA_RIGHT |
66 | #define LP_INC_Y (BUTTON_ON | BUTTON_RIGHT) | 73 | #define LP_INC_X_REPEAT PLA_RIGHT_REPEAT |
67 | 74 | #define LP_DEC_Y PLA_DOWN | |
68 | #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \ | 75 | #define LP_DEC_Y_REPEAT PLA_DOWN_REPEAT |
69 | (CONFIG_KEYPAD == IPOD_3G_PAD) || \ | 76 | #define LP_INC_Y PLA_UP |
70 | (CONFIG_KEYPAD == IPOD_1G2G_PAD) | 77 | #define LP_INC_Y_REPEAT PLA_UP_REPEAT |
71 | #define LP_QUIT BUTTON_MENU | ||
72 | #define LP_DEC_X BUTTON_LEFT | ||
73 | #define LP_INC_X BUTTON_RIGHT | ||
74 | #define LP_DEC_Y BUTTON_SCROLL_BACK | ||
75 | #define LP_INC_Y BUTTON_SCROLL_FWD | ||
76 | |||
77 | #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD | ||
78 | #define LP_QUIT BUTTON_PLAY | ||
79 | #define LP_DEC_X BUTTON_LEFT | ||
80 | #define LP_INC_X BUTTON_RIGHT | ||
81 | #define LP_DEC_Y BUTTON_DOWN | ||
82 | #define LP_INC_Y BUTTON_UP | ||
83 | |||
84 | #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD | ||
85 | #define LP_QUIT BUTTON_POWER | ||
86 | #define LP_DEC_X BUTTON_LEFT | ||
87 | #define LP_INC_X BUTTON_RIGHT | ||
88 | #define LP_DEC_Y BUTTON_DOWN | ||
89 | #define LP_INC_Y BUTTON_UP | ||
90 | |||
91 | #elif CONFIG_KEYPAD == GIGABEAT_PAD | ||
92 | #define LP_QUIT BUTTON_POWER | ||
93 | #define LP_DEC_X BUTTON_LEFT | ||
94 | #define LP_INC_X BUTTON_RIGHT | ||
95 | #define LP_DEC_Y BUTTON_DOWN | ||
96 | #define LP_INC_Y BUTTON_UP | ||
97 | |||
98 | #elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \ | ||
99 | (CONFIG_KEYPAD == SANSA_C200_PAD) || \ | ||
100 | (CONFIG_KEYPAD == SANSA_CLIP_PAD) || \ | ||
101 | (CONFIG_KEYPAD == SANSA_M200_PAD) || \ | ||
102 | (CONFIG_KEYPAD == SANSA_CONNECT_PAD) | ||
103 | #define LP_QUIT BUTTON_POWER | ||
104 | #define LP_DEC_X BUTTON_LEFT | ||
105 | #define LP_INC_X BUTTON_RIGHT | ||
106 | #define LP_DEC_Y BUTTON_DOWN | ||
107 | #define LP_INC_Y BUTTON_UP | ||
108 | |||
109 | #elif (CONFIG_KEYPAD == SANSA_FUZE_PAD) | ||
110 | #define LP_QUIT (BUTTON_HOME|BUTTON_REPEAT) | ||
111 | #define LP_DEC_X BUTTON_LEFT | ||
112 | #define LP_INC_X BUTTON_RIGHT | ||
113 | #define LP_DEC_Y BUTTON_DOWN | ||
114 | #define LP_INC_Y BUTTON_UP | ||
115 | |||
116 | #elif CONFIG_KEYPAD == IRIVER_H10_PAD | ||
117 | #define LP_QUIT BUTTON_POWER | ||
118 | #define LP_DEC_X BUTTON_LEFT | ||
119 | #define LP_INC_X BUTTON_RIGHT | ||
120 | #define LP_DEC_Y BUTTON_SCROLL_DOWN | ||
121 | #define LP_INC_Y BUTTON_SCROLL_UP | ||
122 | |||
123 | #elif CONFIG_KEYPAD == MROBE500_PAD | ||
124 | #define LP_QUIT BUTTON_POWER | ||
125 | |||
126 | #elif CONFIG_KEYPAD == GIGABEAT_S_PAD || \ | ||
127 | CONFIG_KEYPAD == SAMSUNG_YPR0_PAD | ||
128 | #define LP_QUIT BUTTON_BACK | ||
129 | #define LP_DEC_X BUTTON_LEFT | ||
130 | #define LP_INC_X BUTTON_RIGHT | ||
131 | #define LP_DEC_Y BUTTON_DOWN | ||
132 | #define LP_INC_Y BUTTON_UP | ||
133 | |||
134 | #elif CONFIG_KEYPAD == MROBE100_PAD | ||
135 | #define LP_QUIT BUTTON_POWER | ||
136 | #define LP_DEC_X BUTTON_LEFT | ||
137 | #define LP_INC_X BUTTON_RIGHT | ||
138 | #define LP_DEC_Y BUTTON_DOWN | ||
139 | #define LP_INC_Y BUTTON_UP | ||
140 | |||
141 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | ||
142 | #define LP_QUIT BUTTON_RC_REC | ||
143 | #define LP_DEC_X BUTTON_RC_REW | ||
144 | #define LP_INC_X BUTTON_RC_FF | ||
145 | #define LP_DEC_Y BUTTON_RC_VOL_DOWN | ||
146 | #define LP_INC_Y BUTTON_RC_VOL_UP | ||
147 | |||
148 | #elif CONFIG_KEYPAD == COWON_D2_PAD | ||
149 | #define LP_QUIT BUTTON_POWER | ||
150 | |||
151 | #elif CONFIG_KEYPAD == IAUDIO67_PAD | ||
152 | #define LP_QUIT BUTTON_POWER | ||
153 | #define LP_DEC_X BUTTON_LEFT | ||
154 | #define LP_INC_X BUTTON_RIGHT | ||
155 | #define LP_DEC_Y BUTTON_PLAY | ||
156 | #define LP_INC_Y BUTTON_STOP | ||
157 | |||
158 | #elif CONFIG_KEYPAD == CREATIVEZVM_PAD | ||
159 | #define LP_QUIT BUTTON_BACK | ||
160 | #define LP_DEC_X BUTTON_LEFT | ||
161 | #define LP_INC_X BUTTON_RIGHT | ||
162 | #define LP_DEC_Y BUTTON_DOWN | ||
163 | #define LP_INC_Y BUTTON_UP | ||
164 | |||
165 | #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD | ||
166 | #define LP_QUIT BUTTON_POWER | ||
167 | #define LP_DEC_X BUTTON_LEFT | ||
168 | #define LP_INC_X BUTTON_RIGHT | ||
169 | #define LP_DEC_Y BUTTON_DOWN | ||
170 | #define LP_INC_Y BUTTON_UP | ||
171 | |||
172 | #elif CONFIG_KEYPAD == PHILIPS_HDD6330_PAD | ||
173 | #define LP_QUIT BUTTON_POWER | ||
174 | #define LP_DEC_X BUTTON_LEFT | ||
175 | #define LP_INC_X BUTTON_RIGHT | ||
176 | #define LP_DEC_Y BUTTON_DOWN | ||
177 | #define LP_INC_Y BUTTON_UP | ||
178 | |||
179 | #elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD | ||
180 | #define LP_QUIT BUTTON_POWER | ||
181 | #define LP_DEC_X BUTTON_PREV | ||
182 | #define LP_INC_X BUTTON_NEXT | ||
183 | #define LP_DEC_Y BUTTON_DOWN | ||
184 | #define LP_INC_Y BUTTON_UP | ||
185 | |||
186 | #elif CONFIG_KEYPAD == ONDAVX747_PAD | ||
187 | #define LP_QUIT BUTTON_POWER | ||
188 | #elif CONFIG_KEYPAD == ONDAVX777_PAD | ||
189 | #define LP_QUIT BUTTON_POWER | ||
190 | |||
191 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD | ||
192 | #define LP_QUIT BUTTON_PLAY | ||
193 | #define LP_DEC_X BUTTON_LEFT | ||
194 | #define LP_INC_X BUTTON_RIGHT | ||
195 | #define LP_DEC_Y BUTTON_DOWN | ||
196 | #define LP_INC_Y BUTTON_UP | ||
197 | |||
198 | #elif CONFIG_KEYPAD == PBELL_VIBE500_PAD | ||
199 | #define LP_QUIT BUTTON_REC | ||
200 | #define LP_DEC_X BUTTON_PREV | ||
201 | #define LP_INC_X BUTTON_NEXT | ||
202 | #define LP_DEC_Y BUTTON_DOWN | ||
203 | #define LP_INC_Y BUTTON_UP | ||
204 | |||
205 | #elif CONFIG_KEYPAD == MPIO_HD200_PAD | ||
206 | #define LP_QUIT (BUTTON_REC|BUTTON_PLAY) | ||
207 | #define LP_DEC_X BUTTON_VOL_DOWN | ||
208 | #define LP_INC_X BUTTON_VOL_UP | ||
209 | #define LP_DEC_Y BUTTON_REW | ||
210 | #define LP_INC_Y BUTTON_FF | ||
211 | |||
212 | #elif CONFIG_KEYPAD == MPIO_HD300_PAD | ||
213 | #define LP_QUIT (BUTTON_MENU|BUTTON_REPEAT) | ||
214 | #define LP_DEC_X BUTTON_REW | ||
215 | #define LP_INC_X BUTTON_FF | ||
216 | #define LP_DEC_Y BUTTON_DOWN | ||
217 | #define LP_INC_Y BUTTON_UP | ||
218 | |||
219 | #elif CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD | ||
220 | #define LP_QUIT BUTTON_POWER | ||
221 | #define LP_DEC_X BUTTON_LEFT | ||
222 | #define LP_INC_X BUTTON_RIGHT | ||
223 | #define LP_DEC_Y BUTTON_DOWN | ||
224 | #define LP_INC_Y BUTTON_UP | ||
225 | |||
226 | #else | ||
227 | #define LP_QUIT BUTTON_OFF | ||
228 | #define LP_DEC_X BUTTON_LEFT | ||
229 | #define LP_INC_X BUTTON_RIGHT | ||
230 | #define LP_DEC_Y BUTTON_DOWN | ||
231 | #define LP_INC_Y BUTTON_UP | ||
232 | #endif | ||
233 | |||
234 | #ifdef CONFIG_REMOTE_KEYPAD | ||
235 | #if (CONFIG_REMOTE_KEYPAD == H100_REMOTE) || \ | ||
236 | (CONFIG_REMOTE_KEYPAD == H300_REMOTE) | ||
237 | #define LP_R_QUIT BUTTON_RC_STOP | ||
238 | #define LP_R_DEC_X BUTTON_RC_REW | ||
239 | #define LP_R_INC_X BUTTON_RC_FF | ||
240 | #define LP_R_DEC_Y BUTTON_RC_SOURCE | ||
241 | #define LP_R_INC_Y BUTTON_RC_BITRATE | ||
242 | |||
243 | #elif CONFIG_REMOTE_KEYPAD == IAUDIO_REMOTE | ||
244 | #define LP_R_QUIT BUTTON_RC_REC | ||
245 | #define LP_R_DEC_X BUTTON_RC_REW | ||
246 | #define LP_R_INC_X BUTTON_RC_FF | ||
247 | #define LP_R_DEC_Y BUTTON_RC_VOL_DOWN | ||
248 | #define LP_R_INC_Y BUTTON_RC_VOL_UP | ||
249 | |||
250 | #elif (CONFIG_REMOTE_KEYPAD == MROBE_REMOTE) | ||
251 | #define LP_R_QUIT BUTTON_RC_HEART | ||
252 | #define LP_R_DEC_X BUTTON_RC_REW | ||
253 | #define LP_R_INC_X BUTTON_RC_FF | ||
254 | #define LP_R_DEC_Y BUTTON_RC_DOWN | ||
255 | #define LP_R_INC_Y BUTTON_RC_PLAY | ||
256 | #endif | ||
257 | |||
258 | #endif /* CONFIG_REMOTE_KEYPAD */ | ||
259 | |||
260 | #ifdef HAVE_TOUCHSCREEN | ||
261 | #ifndef LP_QUIT | ||
262 | #define LP_QUIT BUTTON_TOPLEFT | ||
263 | #endif | ||
264 | #ifndef LP_DEC_X | ||
265 | #define LP_DEC_X BUTTON_MIDLEFT | ||
266 | #endif | ||
267 | #ifndef LP_INC_X | ||
268 | #define LP_INC_X BUTTON_MIDRIGHT | ||
269 | #endif | ||
270 | #ifndef LP_DEC_Y | ||
271 | #define LP_DEC_Y BUTTON_TOPMIDDLE | ||
272 | #endif | ||
273 | #ifndef LP_INC_Y | ||
274 | #define LP_INC_Y BUTTON_BOTTOMMIDDLE | ||
275 | #endif | ||
276 | #endif | ||
277 | 78 | ||
278 | enum plugin_status plugin_start(const void* parameter) { | 79 | enum plugin_status plugin_start(const void* parameter) { |
279 | int button; | 80 | int button; |
@@ -350,41 +151,36 @@ enum plugin_status plugin_start(const void* parameter) { | |||
350 | pgfx_update(); | 151 | pgfx_update(); |
351 | #endif | 152 | #endif |
352 | rb->sleep(HZ/timer); | 153 | rb->sleep(HZ/timer); |
353 | 154 | ||
354 | button = rb->button_get(false); | 155 | |
156 | |||
157 | /*We get button from PLA this way */ | ||
158 | button = pluginlib_getaction(TIMEOUT_NOBLOCK, plugin_contexts, | ||
159 | ARRAYLEN(plugin_contexts)); | ||
160 | |||
355 | switch (button) { | 161 | switch (button) { |
356 | case LP_QUIT: | 162 | case LP_QUIT: |
357 | #ifdef CONFIG_REMOTE_KEYPAD | 163 | case LP_QUIT2: |
358 | case LP_R_QUIT: | ||
359 | #endif | ||
360 | #ifdef HAVE_LCD_CHARCELLS | 164 | #ifdef HAVE_LCD_CHARCELLS |
361 | pgfx_release(); | 165 | pgfx_release(); |
362 | #endif | 166 | #endif |
363 | return PLUGIN_OK; | 167 | return PLUGIN_OK; |
364 | case LP_DEC_X: | 168 | case LP_DEC_X: |
365 | #ifdef CONFIG_REMOTE_KEYPAD | 169 | case LP_DEC_X_REPEAT: |
366 | case LP_R_DEC_X: | ||
367 | #endif | ||
368 | if (dx) | 170 | if (dx) |
369 | dx += (dx < 0) ? 1 : -1; | 171 | dx += (dx < 0) ? 1 : -1; |
370 | break; | 172 | break; |
371 | case LP_INC_X: | 173 | case LP_INC_X: |
372 | #ifdef CONFIG_REMOTE_KEYPAD | 174 | case LP_INC_X_REPEAT: |
373 | case LP_R_INC_X: | ||
374 | #endif | ||
375 | dx += (dx < 0) ? -1 : 1; | 175 | dx += (dx < 0) ? -1 : 1; |
376 | break; | 176 | break; |
377 | case LP_DEC_Y: | 177 | case LP_DEC_Y: |
378 | #ifdef CONFIG_REMOTE_KEYPAD | 178 | case LP_DEC_Y_REPEAT: |
379 | case LP_R_DEC_Y: | ||
380 | #endif | ||
381 | if (dy) | 179 | if (dy) |
382 | dy += (dy < 0) ? 1 : -1; | 180 | dy += (dy < 0) ? 1 : -1; |
383 | break; | 181 | break; |
384 | case LP_INC_Y: | 182 | case LP_INC_Y: |
385 | #ifdef CONFIG_REMOTE_KEYPAD | 183 | case LP_INC_Y_REPEAT: |
386 | case LP_R_INC_Y: | ||
387 | #endif | ||
388 | dy += (dy < 0) ? -1 : 1; | 184 | dy += (dy < 0) ? -1 : 1; |
389 | break; | 185 | break; |
390 | 186 | ||