diff options
author | Jean-Louis Biasini <jlbiasini@gmail.com> | 2012-02-09 14:18:46 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2012-02-22 09:15:50 +0100 |
commit | d8fd988cf2f18d900accecc5f07f12ec71c48e73 (patch) | |
tree | ef161bcfb6c5fe61e8fde5c8a32f576da77da71d /apps | |
parent | 164cb21fe5964a8bc3a78f9acbccea0ab7295ccf (diff) | |
download | rockbox-d8fd988cf2f18d900accecc5f07f12ec71c48e73.tar.gz rockbox-d8fd988cf2f18d900accecc5f07f12ec71c48e73.zip |
stats's plugin PLA integration (main code + manual)
1) this patch replace all keymaps with PLA ones. It also clean some optionnal
compiling that are not needed anymore througt PLA
2) the patch also made required change to the manual in order to match code's
change.
3) it also add an alternative exit button (PLA_EXIT or PLA_CANCEL)
TO TEST:
I'm not sure if remote control works anymore and cannot test it. I'm not
sure about the way PLA handle those so if that doesn't work let me know ;)
Change-Id: I3fb81e75ef6e4d49e19be24f09c0413599ed0c9c
Reviewed-on: http://gerrit.rockbox.org/90
Tested-by: Thomas Martitz <kugel@rockbox.org>
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/stats.c | 115 |
1 files changed, 13 insertions, 102 deletions
diff --git a/apps/plugins/stats.c b/apps/plugins/stats.c index da231b772c..ff23911336 100644 --- a/apps/plugins/stats.c +++ b/apps/plugins/stats.c | |||
@@ -19,105 +19,19 @@ | |||
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | #include "plugin.h" | 21 | #include "plugin.h" |
22 | 22 | #include "lib/pluginlib_actions.h" | |
23 | 23 | ||
24 | 24 | ||
25 | static int files, dirs, audiofiles, m3ufiles, imagefiles, videofiles, largestdir; | 25 | static int files, dirs, audiofiles, m3ufiles, imagefiles, videofiles, largestdir; |
26 | static int lasttick; | 26 | static int lasttick; |
27 | static bool cancel; | 27 | static bool cancel; |
28 | 28 | ||
29 | #if CONFIG_KEYPAD == PLAYER_PAD | ||
30 | #define STATS_STOP BUTTON_STOP | ||
31 | |||
32 | #elif (CONFIG_KEYPAD == RECORDER_PAD) \ | ||
33 | || (CONFIG_KEYPAD == ONDIO_PAD) \ | ||
34 | || (CONFIG_KEYPAD == ARCHOS_AV300_PAD) | ||
35 | #define STATS_STOP BUTTON_OFF | ||
36 | |||
37 | #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) \ | ||
38 | || (CONFIG_KEYPAD == IRIVER_H300_PAD) | ||
39 | #define STATS_STOP BUTTON_OFF | ||
40 | #define STATS_STOP_REMOTE BUTTON_RC_STOP | ||
41 | |||
42 | #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \ | ||
43 | (CONFIG_KEYPAD == IPOD_3G_PAD) || \ | ||
44 | (CONFIG_KEYPAD == IPOD_1G2G_PAD) | ||
45 | #define STATS_STOP BUTTON_MENU | ||
46 | |||
47 | #elif (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) || \ | ||
48 | (CONFIG_KEYPAD == SAMSUNG_YH_PAD) | ||
49 | #define STATS_STOP BUTTON_PLAY | ||
50 | |||
51 | #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD | ||
52 | #define STATS_STOP BUTTON_POWER | ||
53 | #define STATS_STOP_REMOTE BUTTON_RC_PLAY | ||
54 | |||
55 | #elif CONFIG_KEYPAD == GIGABEAT_PAD | ||
56 | #define STATS_STOP BUTTON_POWER | ||
57 | |||
58 | #elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \ | ||
59 | (CONFIG_KEYPAD == SANSA_C200_PAD) || \ | ||
60 | (CONFIG_KEYPAD == SANSA_CLIP_PAD) || \ | ||
61 | (CONFIG_KEYPAD == SANSA_M200_PAD) || \ | ||
62 | (CONFIG_KEYPAD == SANSA_CONNECT_PAD) | ||
63 | #define STATS_STOP BUTTON_POWER | ||
64 | |||
65 | #elif (CONFIG_KEYPAD == SANSA_FUZE_PAD) | ||
66 | #define STATS_STOP BUTTON_HOME | ||
67 | |||
68 | #elif CONFIG_KEYPAD == IRIVER_H10_PAD | ||
69 | #define STATS_STOP BUTTON_POWER | ||
70 | |||
71 | #elif CONFIG_KEYPAD == MROBE500_PAD | ||
72 | #define STATS_STOP BUTTON_POWER | ||
73 | #define STATS_STOP_REMOTE BUTTON_RC_DOWN | ||
74 | |||
75 | #elif CONFIG_KEYPAD == GIGABEAT_S_PAD || \ | ||
76 | CONFIG_KEYPAD == SAMSUNG_YPR0_PAD | ||
77 | #define STATS_STOP BUTTON_BACK | ||
78 | |||
79 | #elif CONFIG_KEYPAD == MROBE100_PAD | ||
80 | #define STATS_STOP BUTTON_POWER | ||
81 | #define STATS_STOP_REMOTE BUTTON_RC_DOWN | ||
82 | |||
83 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | ||
84 | #define STATS_STOP BUTTON_REC | ||
85 | #define STATS_STOP_REMOTE BUTTON_RC_REC | ||
86 | |||
87 | #elif CONFIG_KEYPAD == COWON_D2_PAD | ||
88 | #define STATS_STOP BUTTON_POWER | ||
89 | 29 | ||
90 | #elif CONFIG_KEYPAD == IAUDIO67_PAD | 30 | /* we use PLA */ |
91 | #define STATS_STOP BUTTON_POWER | 31 | #define STATS_STOP PLA_EXIT |
92 | 32 | #define STATS_STOP2 PLA_CANCEL | |
93 | #elif CONFIG_KEYPAD == CREATIVEZVM_PAD | 33 | /* this set the context to use with PLA */ |
94 | #define STATS_STOP BUTTON_BACK | 34 | static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; |
95 | |||
96 | #elif (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) || \ | ||
97 | (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) || \ | ||
98 | (CONFIG_KEYPAD == PHILIPS_SA9200_PAD) | ||
99 | #define STATS_STOP BUTTON_POWER | ||
100 | |||
101 | #elif CONFIG_KEYPAD == ONDAVX747_PAD | ||
102 | #define STATS_STOP BUTTON_POWER | ||
103 | #elif CONFIG_KEYPAD == ONDAVX777_PAD | ||
104 | #define STATS_STOP BUTTON_POWER | ||
105 | |||
106 | #elif CONFIG_KEYPAD == PBELL_VIBE500_PAD | ||
107 | #define STATS_STOP BUTTON_REC | ||
108 | |||
109 | #elif CONFIG_KEYPAD == MPIO_HD200_PAD | ||
110 | #define STATS_STOP BUTTON_REC | ||
111 | |||
112 | #elif CONFIG_KEYPAD == MPIO_HD300_PAD | ||
113 | #define STATS_STOP BUTTON_REC | ||
114 | |||
115 | #elif CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD | ||
116 | #define STATS_STOP BUTTON_BACK | ||
117 | |||
118 | #else | ||
119 | #error No keymap defined! | ||
120 | #endif | ||
121 | 35 | ||
122 | /* we don't have yet a filetype attribute for image files */ | 36 | /* we don't have yet a filetype attribute for image files */ |
123 | static const char *image_exts[] = {"bmp","jpg","jpe","jpeg","png","ppm"}; | 37 | static const char *image_exts[] = {"bmp","jpg","jpe","jpeg","png","ppm"}; |
@@ -240,12 +154,9 @@ static void traversedir(char* location, char* name) | |||
240 | if (*rb->current_tick - lasttick > (HZ/2)) { | 154 | if (*rb->current_tick - lasttick > (HZ/2)) { |
241 | update_screen(); | 155 | update_screen(); |
242 | lasttick = *rb->current_tick; | 156 | lasttick = *rb->current_tick; |
243 | button = rb->button_get(false); | 157 | button = pluginlib_getaction(TIMEOUT_NOBLOCK, plugin_contexts, |
244 | if (button == STATS_STOP | 158 | ARRAYLEN(plugin_contexts)); |
245 | #ifdef HAVE_REMOTE_LCD | 159 | if (button == STATS_STOP) { |
246 | || button == STATS_STOP_REMOTE | ||
247 | #endif | ||
248 | ) { | ||
249 | cancel = true; | 160 | cancel = true; |
250 | break; | 161 | break; |
251 | } | 162 | } |
@@ -292,12 +203,12 @@ enum plugin_status plugin_start(const void* parameter) | |||
292 | rb->splash(HZ, "Done"); | 203 | rb->splash(HZ, "Done"); |
293 | update_screen(); | 204 | update_screen(); |
294 | while (1) { | 205 | while (1) { |
295 | button = rb->button_get(true); | 206 | |
207 | button = pluginlib_getaction(TIMEOUT_BLOCK, plugin_contexts, | ||
208 | ARRAYLEN(plugin_contexts)); | ||
296 | switch (button) { | 209 | switch (button) { |
297 | #ifdef HAVE_REMOTE_LCD | ||
298 | case STATS_STOP_REMOTE: | ||
299 | #endif | ||
300 | case STATS_STOP: | 210 | case STATS_STOP: |
211 | case STATS_STOP2: | ||
301 | return PLUGIN_OK; | 212 | return PLUGIN_OK; |
302 | break; | 213 | break; |
303 | default: | 214 | default: |