diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/test_codec.c | 44 | ||||
-rw-r--r-- | apps/plugins/test_fps.c | 36 | ||||
-rw-r--r-- | apps/plugins/test_grey.c | 108 | ||||
-rw-r--r-- | apps/plugins/test_greylib_bitmap_scale.c | 29 | ||||
-rw-r--r-- | apps/plugins/test_scanrate.c | 98 |
5 files changed, 91 insertions, 224 deletions
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c index 3e13842cfb..6d915d66e4 100644 --- a/apps/plugins/test_codec.c +++ b/apps/plugins/test_codec.c | |||
@@ -21,33 +21,14 @@ | |||
21 | #include "plugin.h" | 21 | #include "plugin.h" |
22 | #include "lib/pluginlib_touchscreen.h" | 22 | #include "lib/pluginlib_touchscreen.h" |
23 | #include "lib/pluginlib_exit.h" | 23 | #include "lib/pluginlib_exit.h" |
24 | #include "lib/pluginlib_actions.h" | ||
25 | |||
26 | /* this set the context to use with PLA */ | ||
27 | static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; | ||
28 | |||
29 | #define TESTCODEC_EXITBUTTON PLA_EXIT | ||
30 | #define TESTCODEC_EXITBUTTON2 PLA_CANCEL | ||
24 | 31 | ||
25 | /* All swcodec targets have BUTTON_SELECT apart from the H10 and M3 */ | ||
26 | |||
27 | #if CONFIG_KEYPAD == IRIVER_H10_PAD | ||
28 | #define TESTCODEC_EXITBUTTON BUTTON_RIGHT | ||
29 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | ||
30 | #define TESTCODEC_EXITBUTTON BUTTON_RC_PLAY | ||
31 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD | ||
32 | #define TESTCODEC_EXITBUTTON BUTTON_PLAY | ||
33 | #elif CONFIG_KEYPAD == COWON_D2_PAD || CONFIG_KEYPAD == ONDAVX747_PAD \ | ||
34 | || CONFIG_KEYPAD == PHILIPS_HDD6330_PAD | ||
35 | #define TESTCODEC_EXITBUTTON BUTTON_POWER | ||
36 | #elif CONFIG_KEYPAD == PBELL_VIBE500_PAD | ||
37 | #define TESTCODEC_EXITBUTTON BUTTON_REC | ||
38 | #elif CONFIG_KEYPAD == MPIO_HD200_PAD | ||
39 | #define TESTCODEC_EXITBUTTON (BUTTON_REC | BUTTON_PLAY) | ||
40 | #elif CONFIG_KEYPAD == MPIO_HD300_PAD | ||
41 | #define TESTCODEC_EXITBUTTON (BUTTON_REC | BUTTON_REPEAT) | ||
42 | #elif CONFIG_KEYPAD == RK27XX_GENERIC_PAD | ||
43 | #define TESTCODEC_EXITBUTTON (BUTTON_M | BUTTON_REPEAT) | ||
44 | #elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD | ||
45 | #define TESTCODEC_EXITBUTTON BUTTON_BACK | ||
46 | #elif defined(HAVE_TOUCHSCREEN) | ||
47 | #define TESTCODEC_EXITBUTTON (BUTTON_BOTTOMMIDDLE|BUTTON_REL) | ||
48 | #else | ||
49 | #define TESTCODEC_EXITBUTTON BUTTON_SELECT | ||
50 | #endif | ||
51 | 32 | ||
52 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 33 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
53 | static unsigned int boost =1; | 34 | static unsigned int boost =1; |
@@ -734,7 +715,9 @@ static enum plugin_status test_track(const char* filename) | |||
734 | /* Wait for codec thread to die */ | 715 | /* Wait for codec thread to die */ |
735 | while (codec_playing) | 716 | while (codec_playing) |
736 | { | 717 | { |
737 | if (rb->button_get_w_tmo(HZ) == TESTCODEC_EXITBUTTON) | 718 | int button = pluginlib_getaction(HZ, plugin_contexts, |
719 | ARRAYLEN(plugin_contexts)); | ||
720 | if ((button == TESTCODEC_EXITBUTTON) || (button == TESTCODEC_EXITBUTTON2)) | ||
738 | { | 721 | { |
739 | codec_action = CODEC_ACTION_HALT; | 722 | codec_action = CODEC_ACTION_HALT; |
740 | break; | 723 | break; |
@@ -848,9 +831,12 @@ void plugin_quit(void) | |||
848 | else | 831 | else |
849 | #endif | 832 | #endif |
850 | do { | 833 | do { |
851 | btn = rb->button_get(true); | 834 | btn = pluginlib_getaction(TIMEOUT_BLOCK, plugin_contexts, |
835 | ARRAYLEN(plugin_contexts)); | ||
852 | exit_on_usb(btn); | 836 | exit_on_usb(btn); |
853 | } while (codec_action != CODEC_ACTION_HALT && btn != TESTCODEC_EXITBUTTON); | 837 | } while ((codec_action != CODEC_ACTION_HALT) |
838 | && (btn != TESTCODEC_EXITBUTTON) | ||
839 | && (btn != TESTCODEC_EXITBUTTON2)); | ||
854 | } | 840 | } |
855 | 841 | ||
856 | /* plugin entry point */ | 842 | /* plugin entry point */ |
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 | } |
diff --git a/apps/plugins/test_grey.c b/apps/plugins/test_grey.c index f4555c1eed..c4179df135 100644 --- a/apps/plugins/test_grey.c +++ b/apps/plugins/test_grey.c | |||
@@ -21,87 +21,27 @@ | |||
21 | #include "plugin.h" | 21 | #include "plugin.h" |
22 | #include "lib/grey.h" | 22 | #include "lib/grey.h" |
23 | #include "lib/helper.h" | 23 | #include "lib/helper.h" |
24 | 24 | #include "lib/pluginlib_actions.h" | |
25 | 25 | ||
26 | 26 | /* this set the context to use with PLA */ | |
27 | #if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) \ | 27 | static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; |
28 | || (CONFIG_KEYPAD == IPOD_1G2G_PAD) | 28 | |
29 | #define GREY_QUIT BUTTON_MENU | 29 | #define GREY_QUIT PLA_EXIT |
30 | #define GREY_OK BUTTON_SELECT | 30 | #define GREY_QUIT2 PLA_CANCEL |
31 | #define GREY_PREV BUTTON_LEFT | 31 | #define GREY_OK PLA_SELECT |
32 | #define GREY_NEXT BUTTON_RIGHT | 32 | #define GREY_PREV PLA_LEFT |
33 | #define GREY_UP BUTTON_SCROLL_FWD | 33 | #define GREY_NEXT PLA_RIGHT |
34 | #define GREY_DOWN BUTTON_SCROLL_BACK | 34 | #ifdef HAVE_SCROLLWHEEL |
35 | 35 | #define GREY_UP PLA_SCROLL_FWD | |
36 | #elif CONFIG_KEYPAD == IRIVER_H100_PAD | 36 | #define GREY_UP_REPEAT PLA_SCROLL_FWD_REPEAT |
37 | #define GREY_QUIT BUTTON_OFF | 37 | #define GREY_DOWN PLA_SCROLL_BACK |
38 | #define GREY_OK BUTTON_SELECT | 38 | #define GREY_DOWN_REPEAT PLA_SCROLL_BACK_REPEAT |
39 | #define GREY_PREV BUTTON_LEFT | ||
40 | #define GREY_NEXT BUTTON_RIGHT | ||
41 | #define GREY_UP BUTTON_UP | ||
42 | #define GREY_DOWN BUTTON_DOWN | ||
43 | |||
44 | #elif CONFIG_KEYPAD == RECORDER_PAD | ||
45 | #define GREY_QUIT BUTTON_OFF | ||
46 | #define GREY_OK BUTTON_PLAY | ||
47 | #define GREY_PREV BUTTON_LEFT | ||
48 | #define GREY_NEXT BUTTON_RIGHT | ||
49 | #define GREY_UP BUTTON_UP | ||
50 | #define GREY_DOWN BUTTON_DOWN | ||
51 | |||
52 | #elif CONFIG_KEYPAD == ONDIO_PAD | ||
53 | #define GREY_QUIT BUTTON_OFF | ||
54 | #define GREY_OK BUTTON_MENU | ||
55 | #define GREY_PREV BUTTON_LEFT | ||
56 | #define GREY_NEXT BUTTON_RIGHT | ||
57 | #define GREY_UP BUTTON_UP | ||
58 | #define GREY_DOWN BUTTON_DOWN | ||
59 | |||
60 | #elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \ | ||
61 | || (CONFIG_KEYPAD == MROBE100_PAD) \ | ||
62 | || (CONFIG_KEYPAD == SANSA_CLIP_PAD) | ||
63 | #define GREY_QUIT BUTTON_POWER | ||
64 | #define GREY_OK BUTTON_SELECT | ||
65 | #define GREY_PREV BUTTON_LEFT | ||
66 | #define GREY_NEXT BUTTON_RIGHT | ||
67 | #define GREY_UP BUTTON_UP | ||
68 | #define GREY_DOWN BUTTON_DOWN | ||
69 | |||
70 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | ||
71 | #define GREY_QUIT BUTTON_RC_REC | ||
72 | #define GREY_OK BUTTON_RC_PLAY | ||
73 | #define GREY_PREV BUTTON_RC_REW | ||
74 | #define GREY_NEXT BUTTON_RC_FF | ||
75 | #define GREY_UP BUTTON_RC_VOL_UP | ||
76 | #define GREY_DOWN BUTTON_RC_VOL_DOWN | ||
77 | |||
78 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD | ||
79 | #define GREY_QUIT BUTTON_REC | ||
80 | #define GREY_OK BUTTON_PLAY | ||
81 | #define GREY_PREV BUTTON_LEFT | ||
82 | #define GREY_NEXT BUTTON_RIGHT | ||
83 | #define GREY_UP BUTTON_UP | ||
84 | #define GREY_DOWN BUTTON_DOWN | ||
85 | |||
86 | #elif CONFIG_KEYPAD == MPIO_HD200_PAD | ||
87 | #define GREY_QUIT (BUTTON_REC|BUTTON_PLAY) | ||
88 | #define GREY_OK BUTTON_PLAY | ||
89 | #define GREY_PREV BUTTON_REW | ||
90 | #define GREY_NEXT BUTTON_FF | ||
91 | #define GREY_UP BUTTON_VOL_UP | ||
92 | #define GREY_DOWN BUTTON_VOL_DOWN | ||
93 | |||
94 | #elif CONFIG_KEYPAD == MPIO_HD300_PAD | ||
95 | #define GREY_QUIT (BUTTON_REC|BUTTON_REPEAT) | ||
96 | #define GREY_OK BUTTON_PLAY | ||
97 | #define GREY_PREV BUTTON_REW | ||
98 | #define GREY_NEXT BUTTON_FF | ||
99 | #define GREY_UP BUTTON_UP | ||
100 | #define GREY_DOWN BUTTON_DOWN | ||
101 | |||
102 | #else | 39 | #else |
103 | #error unsupported keypad | 40 | #define GREY_UP PLA_UP |
104 | #endif | 41 | #define GREY_UP_REPEAT PLA_UP_REPEAT |
42 | #define GREY_DOWN PLA_DOWN | ||
43 | #define GREY_DOWN_REPEAT PLA_DOWN_REPEAT | ||
44 | #endif /*HAVE_SCROLLWHEEL*/ | ||
105 | 45 | ||
106 | #define BLOCK_WIDTH (LCD_WIDTH/8) | 46 | #define BLOCK_WIDTH (LCD_WIDTH/8) |
107 | #define BLOCK_HEIGHT (LCD_HEIGHT/8) | 47 | #define BLOCK_HEIGHT (LCD_HEIGHT/8) |
@@ -207,7 +147,8 @@ enum plugin_status plugin_start(const void* parameter) | |||
207 | fill_rastered(1, 1, 2, 2, cur_step - 1); | 147 | fill_rastered(1, 1, 2, 2, cur_step - 1); |
208 | grey_update(); | 148 | grey_update(); |
209 | 149 | ||
210 | button = rb->button_get(true); | 150 | button = pluginlib_getaction(TIMEOUT_BLOCK, plugin_contexts, |
151 | ARRAYLEN(plugin_contexts)); | ||
211 | switch (button) | 152 | switch (button) |
212 | { | 153 | { |
213 | case GREY_PREV: | 154 | case GREY_PREV: |
@@ -221,7 +162,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
221 | break; | 162 | break; |
222 | 163 | ||
223 | case GREY_UP: | 164 | case GREY_UP: |
224 | case GREY_UP|BUTTON_REPEAT: | 165 | case GREY_UP_REPEAT: |
225 | l = lcd_levels[cur_step]; | 166 | l = lcd_levels[cur_step]; |
226 | if (l < 255) | 167 | if (l < 255) |
227 | { | 168 | { |
@@ -233,7 +174,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
233 | break; | 174 | break; |
234 | 175 | ||
235 | case GREY_DOWN: | 176 | case GREY_DOWN: |
236 | case GREY_DOWN|BUTTON_REPEAT: | 177 | case GREY_DOWN_REPEAT: |
237 | l = lcd_levels[cur_step]; | 178 | l = lcd_levels[cur_step]; |
238 | if (l > 0) | 179 | if (l > 0) |
239 | { | 180 | { |
@@ -273,6 +214,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
273 | /* fall through */ | 214 | /* fall through */ |
274 | 215 | ||
275 | case GREY_QUIT: | 216 | case GREY_QUIT: |
217 | case GREY_QUIT2: | ||
276 | done = true; | 218 | done = true; |
277 | break; | 219 | break; |
278 | } | 220 | } |
diff --git a/apps/plugins/test_greylib_bitmap_scale.c b/apps/plugins/test_greylib_bitmap_scale.c index 5d08253997..6362aa766e 100644 --- a/apps/plugins/test_greylib_bitmap_scale.c +++ b/apps/plugins/test_greylib_bitmap_scale.c | |||
@@ -22,23 +22,11 @@ | |||
22 | #include "plugin.h" | 22 | #include "plugin.h" |
23 | #include "lib/grey.h" | 23 | #include "lib/grey.h" |
24 | #include "lib/pluginlib_bmp.h" | 24 | #include "lib/pluginlib_bmp.h" |
25 | 25 | #include "lib/pluginlib_actions.h" | |
26 | #if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \ | 26 | /* this set the context to use with PLA */ |
27 | (CONFIG_KEYPAD == IPOD_1G2G_PAD) | 27 | static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; |
28 | #define GBS_QUIT BUTTON_MENU | 28 | #define GBS_QUIT PLA_EXIT |
29 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | 29 | #define GBS_QUIT2 PLA_CANCEL |
30 | #define GBS_QUIT BUTTON_RC_REC | ||
31 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD | ||
32 | #define GBS_QUIT BUTTON_PLAY | ||
33 | #elif CONFIG_KEYPAD == MPIO_HD200_PAD | ||
34 | #define GBS_QUIT (BUTTON_REC|BUTTON_PLAY) | ||
35 | #elif CONFIG_KEYPAD == MPIO_HD300_PAD | ||
36 | #define GBS_QUIT (BUTTON_REC|BUTTON_REPEAT) | ||
37 | #elif defined(BUTTON_OFF) | ||
38 | #define GBS_QUIT BUTTON_OFF | ||
39 | #else | ||
40 | #define GBS_QUIT BUTTON_POWER | ||
41 | #endif | ||
42 | 30 | ||
43 | #if LCD_DEPTH == 1 | 31 | #if LCD_DEPTH == 1 |
44 | #define BMP_LOAD read_bmp_file | 32 | #define BMP_LOAD read_bmp_file |
@@ -63,6 +51,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
63 | .data = grey_bm_buf | 51 | .data = grey_bm_buf |
64 | }; | 52 | }; |
65 | int ret, x, y; | 53 | int ret, x, y; |
54 | int button = 0; | ||
66 | 55 | ||
67 | if(!parameter) return PLUGIN_ERROR; | 56 | if(!parameter) return PLUGIN_ERROR; |
68 | 57 | ||
@@ -92,7 +81,11 @@ enum plugin_status plugin_start(const void* parameter) | |||
92 | grey_show(true); | 81 | grey_show(true); |
93 | 82 | ||
94 | /* wait until user closes plugin */ | 83 | /* wait until user closes plugin */ |
95 | while (rb->button_get(true) != GBS_QUIT); | 84 | while ((button != GBS_QUIT) && (button != GBS_QUIT2)) |
85 | { | ||
86 | button = pluginlib_getaction(TIMEOUT_BLOCK, plugin_contexts, | ||
87 | ARRAYLEN(plugin_contexts)); | ||
88 | } | ||
96 | 89 | ||
97 | grey_release(); | 90 | grey_release(); |
98 | 91 | ||
diff --git a/apps/plugins/test_scanrate.c b/apps/plugins/test_scanrate.c index ba9f5330a7..b558e765c3 100644 --- a/apps/plugins/test_scanrate.c +++ b/apps/plugins/test_scanrate.c | |||
@@ -20,68 +20,28 @@ | |||
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | 21 | ||
22 | #include "plugin.h" | 22 | #include "plugin.h" |
23 | 23 | #include "lib/pluginlib_actions.h" | |
24 | #if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == ONDIO_PAD) \ | 24 | |
25 | || (CONFIG_KEYPAD == IRIVER_H100_PAD) | 25 | /* this set the context to use with PLA */ |
26 | #define SCANRATE_DONE BUTTON_OFF | 26 | static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; |
27 | #define SCANRATE_FASTINC BUTTON_UP | 27 | #define SCANRATE_QUIT PLA_EXIT |
28 | #define SCANRATE_FASTDEC BUTTON_DOWN | 28 | #define SCANRATE_QUIT2 PLA_CANCEL |
29 | #define SCANRATE_INC BUTTON_RIGHT | 29 | #define SCANRATE_FASTINC PLA_UP |
30 | #define SCANRATE_DEC BUTTON_LEFT | 30 | #define SCANRATE_FASTINC_REPEAT PLA_UP_REPEAT |
31 | 31 | #define SCANRATE_FASTDEC PLA_DOWN | |
32 | #elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \ | 32 | #define SCANRATE_FASTDEC_REPEAT PLA_DOWN_REPEAT |
33 | || (CONFIG_KEYPAD == MROBE100_PAD) \ | 33 | |
34 | || (CONFIG_KEYPAD == SANSA_CLIP_PAD) | 34 | #ifdef HAVE_SCROLLWHEEL |
35 | #define SCANRATE_DONE BUTTON_POWER | 35 | #define SCANRATE_INC PLA_SCROLL_FWD |
36 | #define SCANRATE_FASTINC BUTTON_UP | 36 | #define SCANRATE_INC_REPEAT PLA_SCROLL_FWD_REPEAT |
37 | #define SCANRATE_FASTDEC BUTTON_DOWN | 37 | #define SCANRATE_DEC PLA_SCROLL_BACK |
38 | #define SCANRATE_INC BUTTON_RIGHT | 38 | #define SCANRATE_DEC_REPEAT PLA_SCROLL_BACK_REPEAT |
39 | #define SCANRATE_DEC BUTTON_LEFT | 39 | #else |
40 | 40 | #define SCANRATE_INC PLA_RIGHT | |
41 | #elif CONFIG_KEYPAD == SANSA_FUZE_PAD | 41 | #define SCANRATE_INC_REPEAT PLA_RIGHT_REPEAT |
42 | #define SCANRATE_DONE (BUTTON_HOME|BUTTON_REPEAT) | 42 | #define SCANRATE_DEC PLA_LEFT |
43 | #define SCANRATE_FASTINC BUTTON_UP | 43 | #define SCANRATE_DEC_REPEAT PLA_LEFT_REPEAT |
44 | #define SCANRATE_FASTDEC BUTTON_DOWN | 44 | #endif /*HAVE_SCROLLWHEEL*/ |
45 | #define SCANRATE_INC BUTTON_RIGHT | ||
46 | #define SCANRATE_DEC BUTTON_LEFT | ||
47 | |||
48 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | ||
49 | #define SCANRATE_DONE BUTTON_RC_REC | ||
50 | #define SCANRATE_FASTINC BUTTON_RC_VOL_UP | ||
51 | #define SCANRATE_FASTDEC BUTTON_RC_VOL_DOWN | ||
52 | #define SCANRATE_INC BUTTON_RC_FF | ||
53 | #define SCANRATE_DEC BUTTON_RC_REW | ||
54 | |||
55 | #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) \ | ||
56 | || (CONFIG_KEYPAD == IPOD_1G2G_PAD) | ||
57 | #define SCANRATE_DONE BUTTON_MENU | ||
58 | #define SCANRATE_FASTINC BUTTON_SCROLL_FWD | ||
59 | #define SCANRATE_FASTDEC BUTTON_SCROLL_BACK | ||
60 | #define SCANRATE_INC BUTTON_RIGHT | ||
61 | #define SCANRATE_DEC BUTTON_LEFT | ||
62 | |||
63 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD | ||
64 | #define SCANRATE_DONE BUTTON_PLAY | ||
65 | #define SCANRATE_FASTINC BUTTON_FFWD | ||
66 | #define SCANRATE_FASTDEC BUTTON_REW | ||
67 | #define SCANRATE_INC BUTTON_UP | ||
68 | #define SCANRATE_DEC BUTTON_DOWN | ||
69 | |||
70 | #elif CONFIG_KEYPAD == MPIO_HD200_PAD | ||
71 | #define SCANRATE_DONE BUTTON_PLAY | ||
72 | #define SCANRATE_FASTINC BUTTON_FF | ||
73 | #define SCANRATE_FASTDEC BUTTON_REW | ||
74 | #define SCANRATE_INC BUTTON_VOL_UP | ||
75 | #define SCANRATE_DEC BUTTON_VOL_DOWN | ||
76 | |||
77 | #elif CONFIG_KEYPAD == MPIO_HD300_PAD | ||
78 | #define SCANRATE_DONE BUTTON_PLAY | ||
79 | #define SCANRATE_FASTINC BUTTON_UP | ||
80 | #define SCANRATE_FASTDEC BUTTON_DOWN | ||
81 | #define SCANRATE_INC BUTTON_FF | ||
82 | #define SCANRATE_DEC BUTTON_REW | ||
83 | |||
84 | #endif | ||
85 | 45 | ||
86 | /* Default refresh rates in 1/10 Hz */ | 46 | /* Default refresh rates in 1/10 Hz */ |
87 | #if defined ARCHOS_RECORDER || defined ARCHOS_FMRECORDER \ | 47 | #if defined ARCHOS_RECORDER || defined ARCHOS_FMRECORDER \ |
@@ -199,34 +159,36 @@ int plugin_main(void) | |||
199 | need_refresh = true; | 159 | need_refresh = true; |
200 | change = false; | 160 | change = false; |
201 | } | 161 | } |
202 | button = rb->button_get(true); | 162 | button = pluginlib_getaction(TIMEOUT_BLOCK, plugin_contexts, |
163 | ARRAYLEN(plugin_contexts)); | ||
203 | switch (button) | 164 | switch (button) |
204 | { | 165 | { |
205 | case SCANRATE_FASTINC: | 166 | case SCANRATE_FASTINC: |
206 | case SCANRATE_FASTINC|BUTTON_REPEAT: | 167 | case SCANRATE_FASTINC_REPEAT: |
207 | scan_rate += 10; | 168 | scan_rate += 10; |
208 | change = true; | 169 | change = true; |
209 | break; | 170 | break; |
210 | 171 | ||
211 | case SCANRATE_FASTDEC: | 172 | case SCANRATE_FASTDEC: |
212 | case SCANRATE_FASTDEC|BUTTON_REPEAT: | 173 | case SCANRATE_FASTDEC_REPEAT: |
213 | scan_rate -= 10; | 174 | scan_rate -= 10; |
214 | change = true; | 175 | change = true; |
215 | break; | 176 | break; |
216 | 177 | ||
217 | case SCANRATE_INC: | 178 | case SCANRATE_INC: |
218 | case SCANRATE_INC|BUTTON_REPEAT: | 179 | case SCANRATE_INC_REPEAT: |
219 | scan_rate++; | 180 | scan_rate++; |
220 | change = true; | 181 | change = true; |
221 | break; | 182 | break; |
222 | 183 | ||
223 | case SCANRATE_DEC: | 184 | case SCANRATE_DEC: |
224 | case SCANRATE_DEC|BUTTON_REPEAT: | 185 | case SCANRATE_DEC_REPEAT: |
225 | scan_rate--; | 186 | scan_rate--; |
226 | change = true; | 187 | change = true; |
227 | break; | 188 | break; |
228 | 189 | ||
229 | case SCANRATE_DONE: | 190 | case SCANRATE_QUIT: |
191 | case SCANRATE_QUIT2: | ||
230 | done = true; | 192 | done = true; |
231 | break; | 193 | break; |
232 | } | 194 | } |