diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/mosaique.c | 181 |
1 files changed, 12 insertions, 169 deletions
diff --git a/apps/plugins/mosaique.c b/apps/plugins/mosaique.c index 87e664e102..68938a1f13 100644 --- a/apps/plugins/mosaique.c +++ b/apps/plugins/mosaique.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include "plugin.h" | 21 | #include "plugin.h" |
22 | #include "lib/playergfx.h" | 22 | #include "lib/playergfx.h" |
23 | #include "lib/mylcd.h" | 23 | #include "lib/mylcd.h" |
24 | 24 | #include "lib/pluginlib_actions.h" | |
25 | 25 | ||
26 | 26 | ||
27 | #ifdef HAVE_LCD_BITMAP | 27 | #ifdef HAVE_LCD_BITMAP |
@@ -41,174 +41,13 @@ | |||
41 | #define GFX_HEIGHT 6 | 41 | #define GFX_HEIGHT 6 |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | /* variable button definitions */ | 44 | /* this set the context to use with PLA */ |
45 | #if CONFIG_KEYPAD == RECORDER_PAD | 45 | static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; |
46 | #define MOSAIQUE_QUIT BUTTON_OFF | ||
47 | #define MOSAIQUE_SPEED BUTTON_F1 | ||
48 | #define MOSAIQUE_RESTART BUTTON_PLAY | ||
49 | |||
50 | #elif CONFIG_KEYPAD == ARCHOS_AV300_PAD | ||
51 | #define MOSAIQUE_QUIT BUTTON_OFF | ||
52 | #define MOSAIQUE_SPEED BUTTON_F1 | ||
53 | #define MOSAIQUE_RESTART BUTTON_SELECT | ||
54 | |||
55 | #elif CONFIG_KEYPAD == PLAYER_PAD | ||
56 | #define MOSAIQUE_QUIT BUTTON_STOP | ||
57 | #define MOSAIQUE_SPEED BUTTON_MENU | ||
58 | #define MOSAIQUE_RESTART BUTTON_PLAY | ||
59 | |||
60 | #elif CONFIG_KEYPAD == ONDIO_PAD | ||
61 | #define MOSAIQUE_QUIT BUTTON_OFF | ||
62 | #define MOSAIQUE_SPEED BUTTON_MENU | ||
63 | #define MOSAIQUE_RESTART BUTTON_RIGHT | ||
64 | |||
65 | #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ | ||
66 | (CONFIG_KEYPAD == IRIVER_H300_PAD) | ||
67 | #define MOSAIQUE_QUIT BUTTON_OFF | ||
68 | #define MOSAIQUE_SPEED BUTTON_MODE | ||
69 | #define MOSAIQUE_RESTART BUTTON_ON | ||
70 | |||
71 | #define MOSAIQUE_RC_QUIT BUTTON_RC_STOP | ||
72 | |||
73 | #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \ | ||
74 | (CONFIG_KEYPAD == IPOD_3G_PAD) || \ | ||
75 | (CONFIG_KEYPAD == IPOD_1G2G_PAD) | ||
76 | #define MOSAIQUE_QUIT BUTTON_MENU | ||
77 | #define MOSAIQUE_SPEED BUTTON_SELECT | ||
78 | #define MOSAIQUE_RESTART BUTTON_PLAY | ||
79 | |||
80 | #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD | ||
81 | #define MOSAIQUE_QUIT BUTTON_PLAY | ||
82 | #define MOSAIQUE_SPEED BUTTON_MODE | ||
83 | #define MOSAIQUE_RESTART BUTTON_SELECT | ||
84 | |||
85 | #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD | ||
86 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
87 | #define MOSAIQUE_SPEED BUTTON_SELECT | ||
88 | #define MOSAIQUE_RESTART BUTTON_PLAY | ||
89 | |||
90 | #elif CONFIG_KEYPAD == GIGABEAT_PAD | ||
91 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
92 | #define MOSAIQUE_SPEED BUTTON_A | ||
93 | #define MOSAIQUE_RESTART BUTTON_SELECT | ||
94 | |||
95 | #elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \ | ||
96 | (CONFIG_KEYPAD == SANSA_C200_PAD) || \ | ||
97 | (CONFIG_KEYPAD == SANSA_CLIP_PAD) || \ | ||
98 | (CONFIG_KEYPAD == SANSA_M200_PAD) | ||
99 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
100 | #define MOSAIQUE_SPEED BUTTON_DOWN | ||
101 | #define MOSAIQUE_RESTART BUTTON_SELECT | ||
102 | |||
103 | #elif (CONFIG_KEYPAD == SANSA_FUZE_PAD) | ||
104 | #define MOSAIQUE_QUIT (BUTTON_HOME|BUTTON_REPEAT) | ||
105 | #define MOSAIQUE_SPEED BUTTON_DOWN | ||
106 | #define MOSAIQUE_RESTART BUTTON_SELECT | ||
107 | |||
108 | #elif CONFIG_KEYPAD == IRIVER_H10_PAD | ||
109 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
110 | #define MOSAIQUE_SPEED BUTTON_FF | ||
111 | #define MOSAIQUE_RESTART BUTTON_PLAY | ||
112 | |||
113 | #elif CONFIG_KEYPAD == MROBE500_PAD | ||
114 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
115 | |||
116 | #elif CONFIG_KEYPAD == GIGABEAT_S_PAD || \ | ||
117 | CONFIG_KEYPAD == SAMSUNG_YPR0_PAD | ||
118 | #define MOSAIQUE_QUIT BUTTON_BACK | ||
119 | #define MOSAIQUE_SPEED BUTTON_SELECT | ||
120 | #define MOSAIQUE_RESTART BUTTON_MENU | ||
121 | |||
122 | #elif CONFIG_KEYPAD == MROBE100_PAD | ||
123 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
124 | #define MOSAIQUE_SPEED BUTTON_DISPLAY | ||
125 | #define MOSAIQUE_RESTART BUTTON_SELECT | ||
126 | |||
127 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | ||
128 | #define MOSAIQUE_QUIT BUTTON_RC_REC | ||
129 | #define MOSAIQUE_SPEED BUTTON_RC_MENU | ||
130 | #define MOSAIQUE_RESTART BUTTON_RC_PLAY | ||
131 | |||
132 | #elif CONFIG_KEYPAD == COWON_D2_PAD | ||
133 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
134 | #define MOSAIQUE_SPEED BUTTON_MINUS | ||
135 | #define MOSAIQUE_RESTART BUTTON_MENU | ||
136 | |||
137 | #elif CONFIG_KEYPAD == IAUDIO67_PAD | ||
138 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
139 | #define MOSAIQUE_SPEED BUTTON_PLAY | ||
140 | #define MOSAIQUE_RESTART BUTTON_MENU | ||
141 | 46 | ||
142 | #elif CONFIG_KEYPAD == CREATIVEZVM_PAD | 47 | #define MOSAIQUE_QUIT PLA_EXIT |
143 | #define MOSAIQUE_QUIT BUTTON_BACK | 48 | #define MOSAIQUE_QUIT2 PLA_CANCEL |
144 | #define MOSAIQUE_SPEED BUTTON_SELECT | 49 | #define MOSAIQUE_SPEED PLA_UP |
145 | #define MOSAIQUE_RESTART BUTTON_PLAY | 50 | #define MOSAIQUE_RESTART PLA_SELECT |
146 | |||
147 | #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD | ||
148 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
149 | #define MOSAIQUE_SPEED BUTTON_VIEW | ||
150 | #define MOSAIQUE_RESTART BUTTON_MENU | ||
151 | |||
152 | #elif CONFIG_KEYPAD == PHILIPS_HDD6330_PAD | ||
153 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
154 | #define MOSAIQUE_SPEED BUTTON_RIGHT | ||
155 | #define MOSAIQUE_RESTART BUTTON_MENU | ||
156 | |||
157 | #elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD | ||
158 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
159 | #define MOSAIQUE_SPEED BUTTON_RIGHT | ||
160 | #define MOSAIQUE_RESTART BUTTON_MENU | ||
161 | |||
162 | #elif CONFIG_KEYPAD == ONDAVX747_PAD | ||
163 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
164 | #elif CONFIG_KEYPAD == ONDAVX777_PAD | ||
165 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
166 | |||
167 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD | ||
168 | #define MOSAIQUE_QUIT BUTTON_PLAY | ||
169 | #define MOSAIQUE_SPEED BUTTON_UP | ||
170 | #define MOSAIQUE_RESTART BUTTON_DOWN | ||
171 | |||
172 | #elif CONFIG_KEYPAD == PBELL_VIBE500_PAD | ||
173 | #define MOSAIQUE_QUIT BUTTON_REC | ||
174 | #define MOSAIQUE_SPEED BUTTON_PLAY | ||
175 | #define MOSAIQUE_RESTART BUTTON_MENU | ||
176 | |||
177 | #elif CONFIG_KEYPAD == MPIO_HD200_PAD | ||
178 | #define MOSAIQUE_QUIT (BUTTON_REC | BUTTON_PLAY) | ||
179 | #define MOSAIQUE_SPEED BUTTON_FUNC | ||
180 | #define MOSAIQUE_RESTART BUTTON_PLAY | ||
181 | |||
182 | #elif CONFIG_KEYPAD == MPIO_HD300_PAD | ||
183 | #define MOSAIQUE_QUIT (BUTTON_REC | BUTTON_REPEAT) | ||
184 | #define MOSAIQUE_SPEED BUTTON_ENTER | ||
185 | #define MOSAIQUE_RESTART BUTTON_PLAY | ||
186 | |||
187 | #elif CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD | ||
188 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
189 | #define MOSAIQUE_SPEED BUTTON_PLAYPAUSE | ||
190 | #define MOSAIQUE_RESTART BUTTON_BACK | ||
191 | |||
192 | #elif CONFIG_KEYPAD == SANSA_CONNECT_PAD | ||
193 | #define MOSAIQUE_QUIT BUTTON_POWER | ||
194 | #define MOSAIQUE_SPEED BUTTON_SELECT | ||
195 | #define MOSAIQUE_RESTART BUTTON_DOWN | ||
196 | |||
197 | #else | ||
198 | #error No keymap defined! | ||
199 | #endif | ||
200 | |||
201 | #ifdef HAVE_TOUCHSCREEN | ||
202 | #ifndef MOSAIQUE_QUIT | ||
203 | #define MOSAIQUE_QUIT BUTTON_TOPLEFT | ||
204 | #endif | ||
205 | #ifndef MOSAIQUE_SPEED | ||
206 | #define MOSAIQUE_SPEED BUTTON_MIDRIGHT | ||
207 | #endif | ||
208 | #ifndef MOSAIQUE_RESTART | ||
209 | #define MOSAIQUE_RESTART BUTTON_CENTER | ||
210 | #endif | ||
211 | #endif | ||
212 | 51 | ||
213 | enum plugin_status plugin_start(const void* parameter) | 52 | enum plugin_status plugin_start(const void* parameter) |
214 | { | 53 | { |
@@ -266,13 +105,17 @@ enum plugin_status plugin_start(const void* parameter) | |||
266 | 105 | ||
267 | rb->sleep(HZ/timer); | 106 | rb->sleep(HZ/timer); |
268 | 107 | ||
269 | button = rb->button_get(false); | 108 | /*We get button from PLA this way */ |
109 | button = pluginlib_getaction(TIMEOUT_NOBLOCK, plugin_contexts, | ||
110 | ARRAYLEN(plugin_contexts)); | ||
111 | |||
270 | switch (button) | 112 | switch (button) |
271 | { | 113 | { |
272 | #ifdef MOSAIQUE_RC_QUIT | 114 | #ifdef MOSAIQUE_RC_QUIT |
273 | case MOSAIQUE_RC_QUIT: | 115 | case MOSAIQUE_RC_QUIT: |
274 | #endif | 116 | #endif |
275 | case MOSAIQUE_QUIT: | 117 | case MOSAIQUE_QUIT: |
118 | case MOSAIQUE_QUIT2: | ||
276 | mylcd_set_drawmode(DRMODE_SOLID); | 119 | mylcd_set_drawmode(DRMODE_SOLID); |
277 | #ifdef HAVE_LCD_CHARCELLS | 120 | #ifdef HAVE_LCD_CHARCELLS |
278 | pgfx_release(); | 121 | pgfx_release(); |