1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 Itai Shaked
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 **************************************************************************/
20 #include "playergfx.h"
24 #ifdef HAVE_LCD_BITMAP
25 #define MYLCD(fn) rb->lcd_ ## fn
26 #define GFX_X (LCD_WIDTH/2-1)
27 #define GFX_Y (LCD_HEIGHT/2-1)
28 #if LCD_WIDTH != LCD_HEIGHT
29 #define GFX_WIDTH GFX_X
30 #define GFX_HEIGHT GFX_Y
32 #define GFX_WIDTH GFX_X
33 #define GFX_HEIGHT (4*GFX_Y/5)
36 #define MYLCD(fn) pgfx_ ## fn
43 /* variable button definitions */
44 #if CONFIG_KEYPAD == RECORDER_PAD
45 #define MOSAIQUE_QUIT BUTTON_OFF
46 #define MOSAIQUE_SPEED BUTTON_F1
47 #define MOSAIQUE_RESTART BUTTON_PLAY
49 #elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
50 #define MOSAIQUE_QUIT BUTTON_OFF
51 #define MOSAIQUE_SPEED BUTTON_F1
52 #define MOSAIQUE_RESTART BUTTON_SELECT
54 #elif CONFIG_KEYPAD == PLAYER_PAD
55 #define MOSAIQUE_QUIT BUTTON_STOP
56 #define MOSAIQUE_SPEED BUTTON_MENU
57 #define MOSAIQUE_RESTART BUTTON_PLAY
59 #elif CONFIG_KEYPAD == ONDIO_PAD
60 #define MOSAIQUE_QUIT BUTTON_OFF
61 #define MOSAIQUE_SPEED BUTTON_MENU
62 #define MOSAIQUE_RESTART BUTTON_RIGHT
64 #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
65 (CONFIG_KEYPAD == IRIVER_H300_PAD)
66 #define MOSAIQUE_QUIT BUTTON_OFF
67 #define MOSAIQUE_SPEED BUTTON_MODE
68 #define MOSAIQUE_RESTART BUTTON_ON
70 #define MOSAIQUE_RC_QUIT BUTTON_RC_STOP
72 #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
73 (CONFIG_KEYPAD == IPOD_3G_PAD) || \
74 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
75 #define MOSAIQUE_QUIT BUTTON_MENU
76 #define MOSAIQUE_SPEED BUTTON_SELECT
77 #define MOSAIQUE_RESTART BUTTON_PLAY
79 #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
80 #define MOSAIQUE_QUIT BUTTON_PLAY
81 #define MOSAIQUE_SPEED BUTTON_MODE
82 #define MOSAIQUE_RESTART BUTTON_SELECT
84 #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
85 #define MOSAIQUE_QUIT BUTTON_POWER
86 #define MOSAIQUE_SPEED BUTTON_SELECT
87 #define MOSAIQUE_RESTART BUTTON_PLAY
89 #elif CONFIG_KEYPAD == GIGABEAT_PAD
90 #define MOSAIQUE_QUIT BUTTON_POWER
91 #define MOSAIQUE_SPEED BUTTON_A
92 #define MOSAIQUE_RESTART BUTTON_SELECT
94 #elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
95 (CONFIG_KEYPAD == SANSA_C200_PAD)
96 #define MOSAIQUE_QUIT BUTTON_POWER
97 #define MOSAIQUE_SPEED BUTTON_DOWN
98 #define MOSAIQUE_RESTART BUTTON_SELECT
100 #elif CONFIG_KEYPAD == IRIVER_H10_PAD
101 #define MOSAIQUE_QUIT BUTTON_POWER
102 #define MOSAIQUE_SPEED BUTTON_FF
103 #define MOSAIQUE_RESTART BUTTON_PLAY
105 #elif CONFIG_KEYPAD == MROBE500_PAD
106 #define MOSAIQUE_QUIT BUTTON_POWER
107 #define MOSAIQUE_SPEED BUTTON_RC_FF
108 #define MOSAIQUE_RESTART BUTTON_RC_PLAY
110 #elif CONFIG_KEYPAD == GIGABEAT_S_PAD
111 #define MOSAIQUE_QUIT BUTTON_BACK
112 #define MOSAIQUE_SPEED BUTTON_SELECT
113 #define MOSAIQUE_RESTART BUTTON_MENU
115 #elif CONFIG_KEYPAD == MROBE100_PAD
116 #define MOSAIQUE_QUIT BUTTON_POWER
117 #define MOSAIQUE_SPEED BUTTON_DISPLAY
118 #define MOSAIQUE_RESTART BUTTON_SELECT
120 #elif CONFIG_KEYPAD == IAUDIO_M3_PAD
121 #define MOSAIQUE_QUIT BUTTON_RC_REC
122 #define MOSAIQUE_SPEED BUTTON_RC_MENU
123 #define MOSAIQUE_RESTART BUTTON_RC_PLAY
125 #elif CONFIG_KEYPAD == COWOND2_PAD
126 #define MOSAIQUE_QUIT BUTTON_POWER
127 #define MOSAIQUE_SPEED BUTTON_RIGHT
128 #define MOSAIQUE_RESTART BUTTON_MENU
131 #error No keymap defined!
134 enum plugin_status
plugin_start(struct plugin_api
* api
, void* parameter
)
142 struct plugin_api
* rb
= api
;
145 #ifdef HAVE_LCD_CHARCELLS
146 if (!pgfx_init(rb
, 4, 2))
148 rb
->splash(HZ
*2, "Old LCD :(");
153 MYLCD(clear_display
)();
154 MYLCD(set_drawmode
)(DRMODE_COMPLEMENT
);
183 MYLCD(fillrect
)(GFX_X
-x
, GFX_Y
-y
, 2*x
+1, 1);
184 MYLCD(fillrect
)(GFX_X
-x
, GFX_Y
+y
, 2*x
+1, 1);
185 MYLCD(fillrect
)(GFX_X
-x
, GFX_Y
-y
+1, 1, 2*y
-1);
186 MYLCD(fillrect
)(GFX_X
+x
, GFX_Y
-y
+1, 1, 2*y
-1);
191 button
= rb
->button_get(false);
194 #ifdef MOSAIQUE_RC_QUIT
195 case MOSAIQUE_RC_QUIT
:
198 MYLCD(set_drawmode
)(DRMODE_SOLID
);
199 #ifdef HAVE_LCD_CHARCELLS
210 case MOSAIQUE_RESTART
:
212 sx
= rb
->rand() % (GFX_HEIGHT
/2) + 1;
213 sy
= rb
->rand() % (GFX_HEIGHT
/2) + 1;
216 MYLCD(clear_display
)();
221 if (rb
->default_event_handler(button
) == SYS_USB_CONNECTED
)
223 MYLCD(set_drawmode
)(DRMODE_SOLID
);
224 #ifdef HAVE_LCD_CHARCELLS
227 return PLUGIN_USB_CONNECTED
;