diff options
author | Kevin Ferrare <kevin@rockbox.org> | 2007-07-19 03:49:43 +0000 |
---|---|---|
committer | Kevin Ferrare <kevin@rockbox.org> | 2007-07-19 03:49:43 +0000 |
commit | e68a2e6c41c50a3b14b368112573ab91f2a148bf (patch) | |
tree | a41780a6bed30cff6677a0c782185cd3c8f08999 /apps | |
parent | f074b4635b558238b4debad4ebf14fa675496d23 (diff) | |
download | rockbox-e68a2e6c41c50a3b14b368112573ab91f2a148bf.tar.gz rockbox-e68a2e6c41c50a3b14b368112573ab91f2a148bf.zip |
Remote keys support for the demystify plugin (added remote_directions to the plugins actions), updated key bindings in manual
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13927 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/demystify.c | 26 | ||||
-rw-r--r-- | apps/plugins/lib/pluginlib_actions.h | 41 |
2 files changed, 58 insertions, 9 deletions
diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c index 0cb06ee473..1ea9806a7b 100644 --- a/apps/plugins/demystify.c +++ b/apps/plugins/demystify.c | |||
@@ -47,7 +47,11 @@ PLUGIN_HEADER | |||
47 | #define DEMYSTIFY_REMOVE_POLYGON_REPEAT PLA_DOWN_REPEAT | 47 | #define DEMYSTIFY_REMOVE_POLYGON_REPEAT PLA_DOWN_REPEAT |
48 | 48 | ||
49 | const struct button_mapping *plugin_contexts[] | 49 | const struct button_mapping *plugin_contexts[] |
50 | = {generic_directions, generic_actions}; | 50 | = {generic_directions, generic_actions, |
51 | #if defined(HAVE_REMOTE_LCD) | ||
52 | remote_directions | ||
53 | #endif | ||
54 | }; | ||
51 | 55 | ||
52 | #ifdef HAVE_LCD_COLOR | 56 | #ifdef HAVE_LCD_COLOR |
53 | struct line_color | 57 | struct line_color |
@@ -293,8 +297,17 @@ void color_change(struct line_color * color) | |||
293 | color_randomize(color); | 297 | color_randomize(color); |
294 | } | 298 | } |
295 | 299 | ||
296 | #define COLOR_RGBPACK(color) LCD_RGBPACK((color)->current_r, (color)->current_g, (color)->current_b) | 300 | #define COLOR_RGBPACK(color) \ |
301 | LCD_RGBPACK((color)->current_r, (color)->current_g, (color)->current_b) | ||
297 | 302 | ||
303 | void color_apply(struct line_color * color, struct screen * display) | ||
304 | { | ||
305 | if (display->is_color){ | ||
306 | unsigned foreground= | ||
307 | SCREEN_COLOR_TO_NATIVE(display,COLOR_RGBPACK(color)); | ||
308 | display->set_foreground(foreground); | ||
309 | } | ||
310 | } | ||
298 | #endif | 311 | #endif |
299 | 312 | ||
300 | /* | 313 | /* |
@@ -352,13 +365,8 @@ int plugin_main(void) | |||
352 | polygon_update(&leading_polygon[i], display, &move[i]); | 365 | polygon_update(&leading_polygon[i], display, &move[i]); |
353 | 366 | ||
354 | /* Now the drawing part */ | 367 | /* Now the drawing part */ |
355 | |||
356 | #ifdef HAVE_LCD_COLOR | 368 | #ifdef HAVE_LCD_COLOR |
357 | if (display->is_color){ | 369 | color_apply(&color, display); |
358 | unsigned foreground= | ||
359 | SCREEN_COLOR_TO_NATIVE(display,COLOR_RGBPACK(&color)); | ||
360 | display->set_foreground(foreground); | ||
361 | } | ||
362 | #endif | 370 | #endif |
363 | display->clear_display(); | 371 | display->clear_display(); |
364 | polygons_draw(&polygons[i], display); | 372 | polygons_draw(&polygons[i], display); |
@@ -373,7 +381,7 @@ int plugin_main(void) | |||
373 | else | 381 | else |
374 | rb->sleep(sleep_time); | 382 | rb->sleep(sleep_time); |
375 | 383 | ||
376 | action = pluginlib_getaction(rb, TIMEOUT_NOBLOCK, plugin_contexts, 2); | 384 | action = pluginlib_getaction(rb, TIMEOUT_NOBLOCK, plugin_contexts, 3); |
377 | switch(action) | 385 | switch(action) |
378 | { | 386 | { |
379 | case DEMYSTIFY_QUIT: | 387 | case DEMYSTIFY_QUIT: |
diff --git a/apps/plugins/lib/pluginlib_actions.h b/apps/plugins/lib/pluginlib_actions.h index 1a3ab522be..a5c199d209 100644 --- a/apps/plugins/lib/pluginlib_actions.h +++ b/apps/plugins/lib/pluginlib_actions.h | |||
@@ -45,6 +45,47 @@ enum { | |||
45 | LAST_PLUGINLIB_ACTION | 45 | LAST_PLUGINLIB_ACTION |
46 | }; | 46 | }; |
47 | 47 | ||
48 | #if defined(HAVE_REMOTE_LCD) | ||
49 | static const struct button_mapping remote_directions[] = | ||
50 | { | ||
51 | #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ | ||
52 | (CONFIG_KEYPAD == IRIVER_H300_PAD) | ||
53 | { PLA_UP, BUTTON_RC_BITRATE, BUTTON_NONE}, | ||
54 | { PLA_DOWN, BUTTON_RC_SOURCE, BUTTON_NONE}, | ||
55 | { PLA_LEFT, BUTTON_RC_VOL_DOWN, BUTTON_NONE}, | ||
56 | { PLA_RIGHT, BUTTON_RC_VOL_UP, BUTTON_NONE}, | ||
57 | { PLA_UP_REPEAT, BUTTON_RC_BITRATE|BUTTON_REPEAT, BUTTON_NONE}, | ||
58 | { PLA_DOWN_REPEAT, BUTTON_RC_SOURCE|BUTTON_REPEAT, BUTTON_NONE}, | ||
59 | { PLA_LEFT_REPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE}, | ||
60 | { PLA_RIGHT_REPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE}, | ||
61 | #elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) || \ | ||
62 | (CONFIG_KEYPAD == IRIVER_H10_PAD) || \ | ||
63 | (CONFIG_KEYPAD == GIGABEAT_PAD) | ||
64 | { PLA_UP, BUTTON_RC_FF, BUTTON_NONE}, | ||
65 | { PLA_DOWN, BUTTON_RC_REW, BUTTON_NONE}, | ||
66 | { PLA_LEFT, BUTTON_RC_VOL_DOWN, BUTTON_NONE}, | ||
67 | { PLA_RIGHT, BUTTON_RC_VOL_UP, BUTTON_NONE}, | ||
68 | { PLA_UP_REPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE}, | ||
69 | { PLA_DOWN_REPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE}, | ||
70 | { PLA_LEFT_REPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE}, | ||
71 | { PLA_RIGHT_REPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE}, | ||
72 | #elif (CONFIG_KEYPAD == PLAYER_PAD) || \ | ||
73 | (CONFIG_KEYPAD == RECORDER_PAD) | ||
74 | { PLA_UP, BUTTON_RC_VOL_UP, BUTTON_NONE}, | ||
75 | { PLA_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE}, | ||
76 | { PLA_LEFT, BUTTON_RC_LEFT, BUTTON_NONE}, | ||
77 | { PLA_RIGHT, BUTTON_RC_RIGHT, BUTTON_NONE}, | ||
78 | { PLA_UP_REPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE}, | ||
79 | { PLA_DOWN_REPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE}, | ||
80 | { PLA_LEFT_REPEAT, BUTTON_RC_LEFT|BUTTON_REPEAT, BUTTON_NONE}, | ||
81 | { PLA_RIGHT_REPEAT, BUTTON_RC_RIGHT|BUTTON_REPEAT, BUTTON_NONE}, | ||
82 | #else | ||
83 | #error pluginlib_actions: Unsupported remote keypad | ||
84 | #endif | ||
85 | {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE} | ||
86 | }; | ||
87 | #endif /* HAVE_REMOTE_LCD */ | ||
88 | |||
48 | static const struct button_mapping generic_directions[] = | 89 | static const struct button_mapping generic_directions[] = |
49 | { | 90 | { |
50 | #if (CONFIG_KEYPAD == IRIVER_H100_PAD) \ | 91 | #if (CONFIG_KEYPAD == IRIVER_H100_PAD) \ |