summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/snow.c80
-rw-r--r--manual/plugins/snow.tex11
2 files changed, 11 insertions, 80 deletions
diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c
index 6371a697da..74efb8ea00 100644
--- a/apps/plugins/snow.c
+++ b/apps/plugins/snow.c
@@ -21,8 +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
26 25
27#ifdef HAVE_LCD_BITMAP 26#ifdef HAVE_LCD_BITMAP
28#define NUM_PARTICLES (LCD_WIDTH * LCD_HEIGHT / 72) 27#define NUM_PARTICLES (LCD_WIDTH * LCD_HEIGHT / 72)
@@ -34,70 +33,11 @@
34#define SNOW_WIDTH 20 33#define SNOW_WIDTH 20
35#endif 34#endif
36 35
37/* variable button definitions */ 36static const struct button_mapping *plugin_contexts[] = { pla_main_ctx };
38#if CONFIG_KEYPAD == PLAYER_PAD
39#define SNOW_QUIT BUTTON_STOP
40
41#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
42 (CONFIG_KEYPAD == IPOD_3G_PAD) || \
43 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
44#define SNOW_QUIT BUTTON_MENU
45
46#elif (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) || \
47 (CONFIG_KEYPAD == SAMSUNG_YH_PAD)
48#define SNOW_QUIT BUTTON_PLAY
49
50#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
51(CONFIG_KEYPAD == SANSA_C200_PAD) || \
52(CONFIG_KEYPAD == SANSA_CLIP_PAD) || \
53(CONFIG_KEYPAD == SANSA_M200_PAD) || \
54(CONFIG_KEYPAD == MROBE500_PAD) || \
55(CONFIG_KEYPAD == IRIVER_H10_PAD) || \
56(CONFIG_KEYPAD == MROBE100_PAD) || \
57(CONFIG_KEYPAD == COWON_D2_PAD) || \
58(CONFIG_KEYPAD == IAUDIO67_PAD) || \
59(CONFIG_KEYPAD == ONDAVX747_PAD) || \
60(CONFIG_KEYPAD == ONDAVX777_PAD) || \
61(CONFIG_KEYPAD == GIGABEAT_PAD) || \
62(CONFIG_KEYPAD == IAUDIO_X5M5_PAD) || \
63(CONFIG_KEYPAD == SANSA_CONNECT_PAD)
64#define SNOW_QUIT BUTTON_POWER
65
66#elif (CONFIG_KEYPAD == SANSA_FUZE_PAD)
67#define SNOW_QUIT (BUTTON_HOME|BUTTON_REPEAT)
68
69#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) || \
70(CONFIG_KEYPAD == CREATIVEZVM_PAD) || \
71(CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
72#define SNOW_QUIT BUTTON_BACK
73
74#elif (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) || \
75(CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) || \
76(CONFIG_KEYPAD == PHILIPS_SA9200_PAD)
77#define SNOW_QUIT BUTTON_POWER
78
79#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
80#define SNOW_QUIT BUTTON_REC
81#define SNOW_RC_QUIT BUTTON_RC_REC
82 37
83#elif CONFIG_KEYPAD == PBELL_VIBE500_PAD 38/* PLA definitions */
84#define SNOW_QUIT BUTTON_REC 39#define SNOW_QUIT PLA_EXIT
85 40#define SNOW_QUIT2 PLA_CANCEL
86#elif CONFIG_KEYPAD == MPIO_HD200_PAD
87#define SNOW_QUIT (BUTTON_REC|BUTTON_PLAY)
88
89#elif CONFIG_KEYPAD == MPIO_HD300_PAD
90#define SNOW_QUIT (BUTTON_REC|BUTTON_REPEAT)
91
92#elif CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD
93#define SNOW_QUIT BUTTON_POWER
94
95#else
96#define SNOW_QUIT BUTTON_OFF
97#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
98#define SNOW_RC_QUIT BUTTON_RC_STOP
99#endif
100#endif
101 41
102static short particles[NUM_PARTICLES][2]; 42static short particles[NUM_PARTICLES][2];
103 43
@@ -240,13 +180,11 @@ enum plugin_status plugin_start(const void* parameter)
240#endif 180#endif
241 rb->sleep(HZ/20); 181 rb->sleep(HZ/20);
242 182
243 button = rb->button_get(false); 183 /*We get button from PLA this way */
184 button = pluginlib_getaction(TIMEOUT_NOBLOCK, plugin_contexts,
185 ARRAYLEN(plugin_contexts));
244 186
245 if (button == SNOW_QUIT 187 if ((button == SNOW_QUIT) || (button == SNOW_QUIT2))
246#ifdef SNOW_RC_QUIT
247 || button == SNOW_RC_QUIT
248#endif
249 )
250 { 188 {
251#ifdef HAVE_LCD_CHARCELLS 189#ifdef HAVE_LCD_CHARCELLS
252 pgfx_release(); 190 pgfx_release();
diff --git a/manual/plugins/snow.tex b/manual/plugins/snow.tex
index 35ae71abce..13edf8af39 100644
--- a/manual/plugins/snow.tex
+++ b/manual/plugins/snow.tex
@@ -2,12 +2,5 @@
2\screenshot{plugins/images/ss-snow}{Have you ever seen snow falling?}{img:snow} 2\screenshot{plugins/images/ss-snow}{Have you ever seen snow falling?}{img:snow}
3This demo replicates snow falling on your screen. If you love winter, 3This demo replicates snow falling on your screen. If you love winter,
4you will love this demo. Or maybe not. 4you will love this demo. Or maybe not.
5% 5Press \PluginCancel{} or \PluginExit{} to quit.
6\opt{archosplayer}{Press \ButtonStop\ to quit.}% 6
7\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRVER_H300_PAD}{Press \ButtonOff\ to quit.}%
8\opt{IPOD_4G_PAD,IPOD_3G_PAD}{Press \ButtonMenu\ to quit.}%
9\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,GIGABEAT_PAD,MROBE100_PAD}%
10 {Press \ButtonPower\ to quit.}%
11\opt{SANSA_FUZE_PAD}{Press \ButtonHome to quit.}%
12\opt{GIGABEAT_S_PAD}{Press \ButtonBack\ to quit.}%
13\opt{PBELL_VIBE500_PAD}{Press \ButtonRec\ to quit.}