summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/bounce.c270
-rw-r--r--manual/plugins/bounce.tex53
2 files changed, 45 insertions, 278 deletions
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c
index 21bec53fa7..ece8440e53 100644
--- a/apps/plugins/bounce.c
+++ b/apps/plugins/bounce.c
@@ -21,7 +21,7 @@
21#include "plugin.h" 21#include "plugin.h"
22#include "time.h" 22#include "time.h"
23#include "lib/fixedpoint.h" 23#include "lib/fixedpoint.h"
24 24#include "lib/pluginlib_actions.h"
25 25
26 26
27#define SS_TITLE "Bouncer" 27#define SS_TITLE "Bouncer"
@@ -30,238 +30,30 @@
30#define XSPEED 3 30#define XSPEED 3
31#define YADD -4 31#define YADD -4
32 32
33/* variable button definitions */ 33/* this set the context to use with PLA */
34#if CONFIG_KEYPAD == RECORDER_PAD 34static const struct button_mapping *plugin_contexts[] = { pla_main_ctx };
35#define BOUNCE_LEFT BUTTON_LEFT 35
36#define BOUNCE_RIGHT BUTTON_RIGHT 36/* We set button maping with PLA */
37#define BOUNCE_UP BUTTON_UP 37#define BOUNCE_UP PLA_UP
38#define BOUNCE_DOWN BUTTON_DOWN 38#define BOUNCE_UP_REPEAT PLA_UP_REPEAT
39#define BOUNCE_QUIT (BUTTON_OFF | BUTTON_REL) 39#define BOUNCE_DOWN PLA_DOWN
40#define BOUNCE_MODE (BUTTON_ON | BUTTON_REL) 40#define BOUNCE_DOWN_REPEAT PLA_DOWN_REPEAT
41
42#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
43#define BOUNCE_LEFT BUTTON_LEFT
44#define BOUNCE_RIGHT BUTTON_RIGHT
45#define BOUNCE_UP BUTTON_UP
46#define BOUNCE_DOWN BUTTON_DOWN
47#define BOUNCE_QUIT (BUTTON_OFF | BUTTON_REL)
48#define BOUNCE_MODE (BUTTON_ON | BUTTON_REL)
49
50#elif CONFIG_KEYPAD == ONDIO_PAD
51#define BOUNCE_LEFT BUTTON_LEFT
52#define BOUNCE_RIGHT BUTTON_RIGHT
53#define BOUNCE_UP BUTTON_UP
54#define BOUNCE_DOWN BUTTON_DOWN
55#define BOUNCE_QUIT (BUTTON_OFF | BUTTON_REL)
56#define BOUNCE_MODE (BUTTON_MENU | BUTTON_REL)
57
58#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
59 (CONFIG_KEYPAD == IRIVER_H300_PAD)
60#define BOUNCE_LEFT BUTTON_LEFT
61#define BOUNCE_RIGHT BUTTON_RIGHT
62#define BOUNCE_UP BUTTON_UP
63#define BOUNCE_DOWN BUTTON_DOWN
64#define BOUNCE_QUIT (BUTTON_OFF | BUTTON_REL)
65#define BOUNCE_MODE (BUTTON_SELECT | BUTTON_REL)
66
67#define BOUNCE_RC_QUIT (BUTTON_RC_STOP | BUTTON_REL)
68
69#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
70 (CONFIG_KEYPAD == IPOD_3G_PAD) || \
71 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
72#define BOUNCE_LEFT BUTTON_LEFT
73#define BOUNCE_RIGHT BUTTON_RIGHT
74#define BOUNCE_UP BUTTON_SCROLL_BACK
75#define BOUNCE_DOWN BUTTON_SCROLL_FWD
76#define BOUNCE_QUIT (BUTTON_MENU | BUTTON_REL)
77#define BOUNCE_MODE (BUTTON_SELECT | BUTTON_REL)
78
79#elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD)
80#define BOUNCE_LEFT BUTTON_LEFT
81#define BOUNCE_RIGHT BUTTON_RIGHT
82#define BOUNCE_UP BUTTON_UP
83#define BOUNCE_DOWN BUTTON_DOWN
84#define BOUNCE_QUIT BUTTON_POWER
85#define BOUNCE_MODE BUTTON_PLAY
86
87#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
88#define BOUNCE_LEFT BUTTON_LEFT
89#define BOUNCE_RIGHT BUTTON_RIGHT
90#define BOUNCE_UP BUTTON_UP
91#define BOUNCE_DOWN BUTTON_DOWN
92#define BOUNCE_QUIT BUTTON_POWER
93#define BOUNCE_MODE BUTTON_A
94
95#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
96#define BOUNCE_LEFT BUTTON_LEFT
97#define BOUNCE_RIGHT BUTTON_RIGHT
98#define BOUNCE_UP BUTTON_SCROLL_BACK
99#define BOUNCE_DOWN BUTTON_SCROLL_FWD
100#define BOUNCE_QUIT BUTTON_POWER
101#define BOUNCE_MODE BUTTON_SELECT
102
103#elif (CONFIG_KEYPAD == SANSA_FUZE_PAD)
104#define BOUNCE_LEFT BUTTON_LEFT
105#define BOUNCE_RIGHT BUTTON_RIGHT
106#define BOUNCE_UP BUTTON_SCROLL_BACK
107#define BOUNCE_DOWN BUTTON_SCROLL_FWD
108#define BOUNCE_QUIT (BUTTON_HOME|BUTTON_REPEAT)
109#define BOUNCE_MODE BUTTON_SELECT
110
111#elif CONFIG_KEYPAD == SANSA_C200_PAD || \
112 CONFIG_KEYPAD == SANSA_CLIP_PAD || \
113 CONFIG_KEYPAD == SANSA_M200_PAD || \
114 CONFIG_KEYPAD == SANSA_CONNECT_PAD
115#define BOUNCE_LEFT BUTTON_LEFT
116#define BOUNCE_RIGHT BUTTON_RIGHT
117#define BOUNCE_UP BUTTON_UP
118#define BOUNCE_DOWN BUTTON_DOWN
119#define BOUNCE_QUIT BUTTON_POWER
120#define BOUNCE_MODE BUTTON_SELECT
121
122#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
123#define BOUNCE_LEFT BUTTON_LEFT
124#define BOUNCE_RIGHT BUTTON_RIGHT
125#define BOUNCE_UP BUTTON_SCROLL_UP
126#define BOUNCE_DOWN BUTTON_SCROLL_DOWN
127#define BOUNCE_QUIT BUTTON_POWER
128#define BOUNCE_MODE BUTTON_PLAY
129
130#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) \
131 || (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
132#define BOUNCE_LEFT BUTTON_LEFT
133#define BOUNCE_RIGHT BUTTON_RIGHT
134#define BOUNCE_UP BUTTON_UP
135#define BOUNCE_DOWN BUTTON_DOWN
136#define BOUNCE_QUIT BUTTON_BACK
137#define BOUNCE_MODE BUTTON_MENU
138
139#elif (CONFIG_KEYPAD == MROBE100_PAD)
140#define BOUNCE_LEFT BUTTON_LEFT
141#define BOUNCE_RIGHT BUTTON_RIGHT
142#define BOUNCE_UP BUTTON_UP
143#define BOUNCE_DOWN BUTTON_DOWN
144#define BOUNCE_QUIT BUTTON_POWER
145#define BOUNCE_MODE BUTTON_DISPLAY
146
147#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
148#define BOUNCE_LEFT BUTTON_RC_REW
149#define BOUNCE_RIGHT BUTTON_RC_FF
150#define BOUNCE_UP BUTTON_RC_VOL_UP
151#define BOUNCE_DOWN BUTTON_RC_VOL_DOWN
152#define BOUNCE_QUIT BUTTON_RC_REC
153#define BOUNCE_MODE BUTTON_RC_MODE
154
155#elif (CONFIG_KEYPAD == COWON_D2_PAD)
156#define BOUNCE_QUIT BUTTON_POWER
157#define BOUNCE_MODE BUTTON_MENU
158
159#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
160#define BOUNCE_LEFT BUTTON_LEFT
161#define BOUNCE_RIGHT BUTTON_RIGHT
162#define BOUNCE_UP BUTTON_UP
163#define BOUNCE_DOWN BUTTON_DOWN
164#define BOUNCE_QUIT BUTTON_BACK
165#define BOUNCE_MODE BUTTON_MENU
166
167#elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD
168#define BOUNCE_LEFT BUTTON_LEFT
169#define BOUNCE_RIGHT BUTTON_RIGHT
170#define BOUNCE_UP BUTTON_UP
171#define BOUNCE_DOWN BUTTON_DOWN
172#define BOUNCE_QUIT BUTTON_POWER
173#define BOUNCE_MODE BUTTON_MENU
174
175#elif CONFIG_KEYPAD == PHILIPS_HDD6330_PAD
176#define BOUNCE_LEFT BUTTON_PREV
177#define BOUNCE_RIGHT BUTTON_NEXT
178#define BOUNCE_UP BUTTON_UP
179#define BOUNCE_DOWN BUTTON_DOWN
180#define BOUNCE_QUIT BUTTON_POWER
181#define BOUNCE_MODE BUTTON_MENU
182
183#elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD
184#define BOUNCE_LEFT BUTTON_PREV
185#define BOUNCE_RIGHT BUTTON_NEXT
186#define BOUNCE_UP BUTTON_UP
187#define BOUNCE_DOWN BUTTON_DOWN
188#define BOUNCE_QUIT BUTTON_POWER
189#define BOUNCE_MODE BUTTON_MENU
190
191#elif (CONFIG_KEYPAD == ONDAVX747_PAD)
192#define BOUNCE_QUIT BUTTON_POWER
193#define BOUNCE_MODE BUTTON_MENU
194
195#elif (CONFIG_KEYPAD == ONDAVX777_PAD)
196#define BOUNCE_QUIT BUTTON_POWER
197
198#elif CONFIG_KEYPAD == MROBE500_PAD
199#define BOUNCE_QUIT BUTTON_POWER
200
201#elif CONFIG_KEYPAD == SAMSUNG_YH_PAD
202#define BOUNCE_LEFT BUTTON_LEFT
203#define BOUNCE_RIGHT BUTTON_RIGHT
204#define BOUNCE_UP BUTTON_UP
205#define BOUNCE_DOWN BUTTON_DOWN
206#define BOUNCE_QUIT BUTTON_FFWD
207#define BOUNCE_MODE BUTTON_PLAY
208
209#elif CONFIG_KEYPAD == PBELL_VIBE500_PAD
210#define BOUNCE_LEFT BUTTON_PREV
211#define BOUNCE_RIGHT BUTTON_NEXT
212#define BOUNCE_UP BUTTON_UP
213#define BOUNCE_DOWN BUTTON_DOWN
214#define BOUNCE_QUIT BUTTON_REC
215#define BOUNCE_MODE BUTTON_MENU
216
217#elif CONFIG_KEYPAD == MPIO_HD200_PAD
218#define BOUNCE_LEFT BUTTON_VOL_DOWN
219#define BOUNCE_RIGHT BUTTON_VOL_UP
220#define BOUNCE_UP BUTTON_REW
221#define BOUNCE_DOWN BUTTON_FF
222#define BOUNCE_QUIT (BUTTON_REC | BUTTON_PLAY)
223#define BOUNCE_MODE BUTTON_FUNC
224
225#elif CONFIG_KEYPAD == MPIO_HD300_PAD
226#define BOUNCE_LEFT BUTTON_REW
227#define BOUNCE_RIGHT BUTTON_FF
228#define BOUNCE_UP BUTTON_UP
229#define BOUNCE_DOWN BUTTON_DOWN
230#define BOUNCE_QUIT (BUTTON_MENU | BUTTON_REPEAT)
231#define BOUNCE_MODE BUTTON_PLAY
232
233#elif CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD
234#define BOUNCE_LEFT BUTTON_LEFT
235#define BOUNCE_RIGHT BUTTON_RIGHT
236#define BOUNCE_UP BUTTON_UP
237#define BOUNCE_DOWN BUTTON_DOWN
238#define BOUNCE_QUIT BUTTON_POWER
239#define BOUNCE_MODE BUTTON_PLAYPAUSE
240 41
42#ifdef HAVE_SCROLLWHEEL
43#define BOUNCE_LEFT PLA_SCROLL_BACK
44#define BOUNCE_LEFT_REPEAT PLA_SCROLL_BACK_REPEAT
45#define BOUNCE_RIGHT PLA_SCROLL_FWD
46#define BOUNCE_RIGHT_REPEAT PLA_SCROLL_FWD_REPEAT
241#else 47#else
242#error No keymap defined! 48#define BOUNCE_LEFT PLA_LEFT
49#define BOUNCE_LEFT_REPEAT PLA_LEFT_REPEAT
50#define BOUNCE_RIGHT PLA_RIGHT
51#define BOUNCE_RIGHT_REPEAT PLA_RIGHT_REPEAT
243#endif 52#endif
244 53
245#ifdef HAVE_TOUCHSCREEN 54#define BOUNCE_QUIT PLA_EXIT
246#ifndef BOUNCE_LEFT 55#define BOUNCE_QUIT2 PLA_CANCEL
247#define BOUNCE_LEFT BUTTON_MIDLEFT 56#define BOUNCE_MODE PLA_SELECT
248#endif
249#ifndef BOUNCE_RIGHT
250#define BOUNCE_RIGHT BUTTON_MIDRIGHT
251#endif
252#ifndef BOUNCE_UP
253#define BOUNCE_UP BUTTON_TOPMIDDLE
254#endif
255#ifndef BOUNCE_DOWN
256#define BOUNCE_DOWN BUTTON_BOTTOMMIDDLE
257#endif
258#ifndef BOUNCE_QUIT
259#define BOUNCE_QUIT BUTTON_TOPLEFT
260#endif
261#ifndef BOUNCE_MODE
262#define BOUNCE_MODE BUTTON_CENTER
263#endif
264#endif
265 57
266#define LETTER_WIDTH 11 58#define LETTER_WIDTH 11
267#define LETTER_HEIGHT 16 59#define LETTER_HEIGHT 16
@@ -542,13 +334,12 @@ static int scrollit(void)
542 rb->lcd_clear_display(); 334 rb->lcd_clear_display();
543 while(1) 335 while(1)
544 { 336 {
545 b = rb->button_get_w_tmo(HZ/10); 337 b = pluginlib_getaction(HZ/10, plugin_contexts,
338 ARRAYLEN(plugin_contexts));
546 switch(b) 339 switch(b)
547 { 340 {
548#ifdef BOUNCE_RC_QUIT
549 case BOUNCE_RC_QUIT :
550#endif
551 case BOUNCE_QUIT : 341 case BOUNCE_QUIT :
342 case BOUNCE_QUIT2 :
552 return 0; 343 return 0;
553 case BOUNCE_MODE : 344 case BOUNCE_MODE :
554 return 1; 345 return 1;
@@ -612,8 +403,9 @@ static int loopit(void)
612 rb->lcd_clear_display(); 403 rb->lcd_clear_display();
613 while(1) 404 while(1)
614 { 405 {
615 b = rb->button_get_w_tmo(HZ/10); 406 b = pluginlib_getaction(HZ/10, plugin_contexts,
616 if ( b == BOUNCE_QUIT ) 407 ARRAYLEN(plugin_contexts));
408 if (( b == BOUNCE_QUIT ) || ( b == BOUNCE_QUIT2 ))
617 return 0; 409 return 0;
618 410
619 if ( b == BOUNCE_MODE ) 411 if ( b == BOUNCE_MODE )
@@ -635,20 +427,20 @@ static int loopit(void)
635 if(timeout) { 427 if(timeout) {
636 switch(b) { 428 switch(b) {
637 case BOUNCE_LEFT: 429 case BOUNCE_LEFT:
638 case BOUNCE_LEFT|BUTTON_REPEAT: 430 case BOUNCE_LEFT_REPEAT:
639 values[show].num--; 431 values[show].num--;
640 break; 432 break;
641 case BOUNCE_RIGHT: 433 case BOUNCE_RIGHT:
642 case BOUNCE_RIGHT|BUTTON_REPEAT: 434 case BOUNCE_RIGHT_REPEAT:
643 values[show].num++; 435 values[show].num++;
644 break; 436 break;
645 case BOUNCE_UP: 437 case BOUNCE_UP:
646 case BOUNCE_UP|BUTTON_REPEAT: 438 case BOUNCE_UP_REPEAT:
647 if(++show == NUM_LAST) 439 if(++show == NUM_LAST)
648 show=0; 440 show=0;
649 break; 441 break;
650 case BOUNCE_DOWN: 442 case BOUNCE_DOWN:
651 case BOUNCE_DOWN|BUTTON_REPEAT: 443 case BOUNCE_DOWN_REPEAT:
652 if(--show < 0) 444 if(--show < 0)
653 show=NUM_LAST-1; 445 show=NUM_LAST-1;
654 break; 446 break;
diff --git a/manual/plugins/bounce.tex b/manual/plugins/bounce.tex
index cf554da658..fe26c67198 100644
--- a/manual/plugins/bounce.tex
+++ b/manual/plugins/bounce.tex
@@ -6,48 +6,23 @@ In \setting{Scroll mode} the bouncing text is replaced by a different one
6scrolling from right to left. 6scrolling from right to left.
7 7
8\begin{btnmap} 8\begin{btnmap}
9\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 9 \PluginUp / \PluginDown
10 ,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD} 10 \opt{HAVEREMOTEKEYMAP}{& }
11 {\ButtonUp\ /\ \ButtonDown} 11 & Moves to next/previous option\\
12\opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}% 12 \nopt{scrollwheel} {
13 {\ButtonScrollBack\ /\ \ButtonScrollFwd} 13 \PluginRight{} / \PluginLeft
14\opt{IRIVER_H10_PAD,MPIO_HD300_PAD}{\ButtonScrollDown\ /\ \ButtonScrollUp} 14 }
15\opt{COWON_D2_PAD}{\TouchBottomMiddle{} / \TouchTopMiddle} 15 \opt{scrollwheel} {
16\opt{MPIO_HD200_PAD}{\ButtonRew / \ButtonFF} 16 \PluginScrollFwd{} / \PluginScrollBack
17 }
17 \opt{HAVEREMOTEKEYMAP}{& } 18 \opt{HAVEREMOTEKEYMAP}{& }
18& Moves to next/previous option\\ 19 & Increases/decreases option value\\
19\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 20 \PluginSelect
20 ,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,IPOD_4G_PAD%
21 ,IPOD_3G_PAD,SANSA_E200_PAD,IRIVER_H10_PAD,SANSA_FUZE_PAD,PBELL_VIBE500_PAD}
22 {\ButtonRight{} / \ButtonLeft}
23\opt{COWON_D2_PAD}{\TouchMidRight{} / \TouchMidLeft}
24\opt{MPIO_HD200_PAD}{\ButtonVolDown / \ButtonVolUp}
25\opt{MPIO_HD300_PAD}{\ButtonRew / \ButtonFF}
26 \opt{HAVEREMOTEKEYMAP}{& } 21 \opt{HAVEREMOTEKEYMAP}{& }
27& Increases/decreases option value\\ 22 & Toggles Scroll mode\\
28\opt{RECORDER_PAD}{\ButtonOn} 23 \PluginCancel{} or \PluginExit
29\opt{ONDIO_PAD}{\ButtonMenu}
30\opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD%
31 ,SANSA_C200_PAD,SANSA_FUZE_PAD}
32 {\ButtonSelect}
33\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,MPIO_HD300_PAD}{\ButtonPlay}
34\opt{GIGABEAT_PAD}{\ButtonA}
35\opt{GIGABEAT_S_PAD,COWON_D2_PAD,PBELL_VIBE500_PAD}{\ButtonMenu}
36\opt{MROBE100_PAD}{\ButtonDisplay}
37\opt{MPIO_HD200_PAD}{\ButtonFunc}
38 \opt{HAVEREMOTEKEYMAP}{& } 24 \opt{HAVEREMOTEKEYMAP}{& }
39& Toggles Scroll mode\\ 25 & Exits bounce demo\\
40\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
41\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu}
42\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,GIGABEAT_PAD%
43 ,COWON_D2_PAD}{\ButtonPower}
44\opt{SANSA_FUZE_PAD}{Long \ButtonHome}
45\opt{GIGABEAT_S_PAD}{\ButtonBack}
46\opt{PBELL_VIBE500_PAD}{\ButtonRec}
47\opt{MPIO_HD200_PAD}{\ButtonRec + \ButtonPlay}
48\opt{MPIO_HD300_PAD}{Long \ButtonMenu}
49 \opt{HAVEREMOTEKEYMAP}{& }
50& Exits bounce demo\\
51\end{btnmap} 26\end{btnmap}
52 27
53Available options are: 28Available options are: