summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJean-Louis Biasini <jlbiasini@gmail.com>2012-02-26 00:39:00 +0100
committerThomas Martitz <kugel@rockbox.org>2012-03-03 10:48:22 +0100
commitf1e1ab8d416058692281ed7442485ed6037f7afb (patch)
tree905eca090c402abcb6ea86f7d32cc4f8926bc8df /apps
parentd5e676ba29c112ff170402df0352a43416b82690 (diff)
downloadrockbox-f1e1ab8d416058692281ed7442485ed6037f7afb.tar.gz
rockbox-f1e1ab8d416058692281ed7442485ed6037f7afb.zip
Plugin snow PLA integration (code + manual)
this commit changes: 1) replace all keymaps with PLA ones. 2) do the required change to the manual in order to match code's changes. 3) add an alternative exit button (PLA_EXIT or PLA_CANCEL) Change-Id: I8a064b98c118e369f8464de5e43c7641d8a08e9e Reviewed-on: http://gerrit.rockbox.org/130 Reviewed-by: Thomas Martitz <kugel@rockbox.org> Tested-by: Thomas Martitz <kugel@rockbox.org>
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/snow.c80
1 files changed, 9 insertions, 71 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();