diff options
author | Jean-Louis Biasini <jlbiasini@gmail.com> | 2012-03-01 20:34:38 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2012-03-03 19:55:51 +0100 |
commit | db856890df7d2680b7cad38c43114dac31315a7e (patch) | |
tree | 184c5685466eaa753ed03fb02389b1fc0828c541 /apps/plugins/test_fps.c | |
parent | 83b4d70af5831254eb3f73ca912ac46e359245eb (diff) | |
download | rockbox-db856890df7d2680b7cad38c43114dac31315a7e.tar.gz rockbox-db856890df7d2680b7cad38c43114dac31315a7e.zip |
test_X plugins PLA integration
1) change all keymaps to PLA
2) add alternative exit keymaps
Change-Id: I5cb8b1fcc515d2b6f9934482e72b80767b2c2fb0
Reviewed-on: http://gerrit.rockbox.org/158
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Diffstat (limited to 'apps/plugins/test_fps.c')
-rw-r--r-- | apps/plugins/test_fps.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/apps/plugins/test_fps.c b/apps/plugins/test_fps.c index d5bfb55907..358ab827f3 100644 --- a/apps/plugins/test_fps.c +++ b/apps/plugins/test_fps.c | |||
@@ -23,31 +23,14 @@ | |||
23 | #include "lib/grey.h" | 23 | #include "lib/grey.h" |
24 | #include "lib/pluginlib_touchscreen.h" | 24 | #include "lib/pluginlib_touchscreen.h" |
25 | #include "lib/pluginlib_exit.h" | 25 | #include "lib/pluginlib_exit.h" |
26 | #include "lib/pluginlib_actions.h" | ||
26 | 27 | ||
27 | #if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \ | 28 | /* this set the context to use with PLA */ |
28 | (CONFIG_KEYPAD == IPOD_1G2G_PAD) | 29 | static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; |
29 | #define FPS_QUIT BUTTON_MENU | 30 | |
30 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | 31 | |
31 | #define FPS_QUIT BUTTON_RC_REC | 32 | #define FPS_QUIT PLA_EXIT |
32 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD | 33 | #define FPS_QUIT2 PLA_CANCEL |
33 | #define FPS_QUIT BUTTON_PLAY | ||
34 | #elif CONFIG_KEYPAD == SANSA_FUZE_PAD | ||
35 | #define FPS_QUIT (BUTTON_HOME|BUTTON_REPEAT) | ||
36 | #elif CONFIG_KEYPAD == MPIO_HD200_PAD | ||
37 | #define FPS_QUIT (BUTTON_REC|BUTTON_PLAY) | ||
38 | #elif CONFIG_KEYPAD == MPIO_HD300_PAD | ||
39 | #define FPS_QUIT (BUTTON_REC|BUTTON_REPEAT) | ||
40 | #elif CONFIG_KEYPAD == RK27XX_GENERIC_PAD | ||
41 | #define FPS_QUIT (BUTTON_M|BUTTON_REPEAT) | ||
42 | #elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD | ||
43 | #define FPS_QUIT BUTTON_BACK | ||
44 | #elif defined(HAVE_TOUCHSCREEN) | ||
45 | #define FPS_QUIT (BUTTON_BOTTOMMIDDLE|BUTTON_REL) | ||
46 | #elif defined(BUTTON_OFF) | ||
47 | #define FPS_QUIT BUTTON_OFF | ||
48 | #else | ||
49 | #define FPS_QUIT BUTTON_POWER | ||
50 | #endif | ||
51 | 34 | ||
52 | #define DURATION (2*HZ) /* longer duration gives more precise results */ | 35 | #define DURATION (2*HZ) /* longer duration gives more precise results */ |
53 | 36 | ||
@@ -391,9 +374,10 @@ void plugin_quit(void) | |||
391 | #endif | 374 | #endif |
392 | while (1) | 375 | while (1) |
393 | { | 376 | { |
394 | int btn = rb->button_get(true); | 377 | int btn = pluginlib_getaction(TIMEOUT_BLOCK, plugin_contexts, |
378 | ARRAYLEN(plugin_contexts)); | ||
395 | exit_on_usb(btn); | 379 | exit_on_usb(btn); |
396 | if (btn == FPS_QUIT) | 380 | if ((btn == FPS_QUIT) || (btn == FPS_QUIT2)) |
397 | break; | 381 | break; |
398 | } | 382 | } |
399 | } | 383 | } |