blob: e647455402979b268cadb70b204dcc71d485d46a [file] [log] [blame]
Mats Lidell89d22852002-08-21 10:37:34 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 Mats Lidell <matsl@contactor.se>
11 *
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.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#ifdef HAVE_LCD_CHARCELLS
20
21#include "sim_icons.h"
22
23#include <lcd.h>
24#include <kernel.h>
25#include <sprintf.h>
26#include <string.h>
27#include <debug.h>
28
Kjell Ericsona901c3a2002-10-21 20:46:10 +000029extern void lcd_print_icon(int x, int icon_line, bool enable, char **icon);
30
Mats Lidell0d79fa12002-10-31 17:34:07 +000031static char* icon_battery_bit[]=
32{
33 "------",
34 "------",
35 "------",
36 "******",
37 "******",
38 "******",
39 "******",
40 "******",
41 "******",
42 "******",
43 "******",
44 "******",
45 "******",
46 "******",
47 "******",
48 "******",
49 "------",
50 "------",
51 "------",
52 NULL
53};
54
Kjell Ericsonfe10eb32002-10-21 20:17:47 +000055static char* icon_battery[]=
Mats Lidell0d79fa12002-10-31 17:34:07 +000056{
57 " ********************************** ",
Kjell Ericsonb3e41c72002-11-01 08:10:33 +000058 "*..................................* ",
59 "*..................................* ",
60 "*..................................* ",
61 "*..................................* ",
62 "*..................................*****",
63 "*..................................*****",
64 "*..................................*****",
65 "*..................................*****",
66 "*..................................*****",
67 "*..................................*****",
68 "*..................................*****",
69 "*..................................*****",
70 "*..................................*****",
71 "*..................................* ",
72 "*..................................* ",
73 "*..................................* ",
74 "*..................................* ",
Mats Lidell0d79fa12002-10-31 17:34:07 +000075 " ********************************** ",
76 NULL
77};
Mats Lidell89d22852002-08-21 10:37:34 +000078
Kjell Ericsonfe10eb32002-10-21 20:17:47 +000079static char* icon_volume[]=
Mats Lidell0d79fa12002-10-31 17:34:07 +000080{
81 " ",
82 " ",
83 " ",
84 " ",
85 " ",
86 " ",
87 "* * * ",
88 "* * * ",
89 " * * * ",
90 " * * * ",
91 " * * * ",
92 " * * * ",
93 " * * * ",
94 " * * ** * ",
95 " * * * * * ",
96 " * * * * * ",
97 " * * * * * ",
98 " * * * * * ",
99 " * ** * ",
100 NULL
101};
Mats Lidell89d22852002-08-21 10:37:34 +0000102
Mats Lidell0d79fa12002-10-31 17:34:07 +0000103static char* icon_volume_1[]=
104{
105 " ",
106 " ",
107 " ",
108 " ",
109 " ",
110 " ",
111 " ",
112 " ",
113 " ",
114 " ",
115 " ",
116 " ",
117 " ",
118 " ",
119 " ",
120 " ",
121 "**",
122 "**",
123 "**",
124 NULL
125};
126
127static char* icon_volume_2[]=
128{
129 " ",
130 " ",
131 " ",
132 " ",
133 " ",
134 " ",
135 " ",
136 " ",
137 " ",
138 " ",
139 " ",
140 " ",
141 " ",
142 "**",
143 "**",
144 "**",
145 "**",
146 "**",
147 "**",
148 NULL
149};
150
151static char* icon_volume_3[]=
152{
153 " ",
154 " ",
155 " ",
156 " ",
157 " ",
158 " ",
159 " ",
160 " ",
161 " ",
162 " ",
163 "**",
164 "**",
165 "**",
166 "**",
167 "**",
168 "**",
169 "**",
170 "**",
171 "**",
172 NULL
173};
174
175static char* icon_volume_4[]=
176{
177 " ",
178 " ",
179 " ",
180 " ",
181 " ",
182 " ",
183 " ",
184 "**",
185 "**",
186 "**",
187 "**",
188 "**",
189 "**",
190 "**",
191 "**",
192 "**",
193 "**",
194 "**",
195 "**",
196 NULL
197};
198
199static char* icon_volume_5[]=
200{
201 " ",
202 " ",
203 " ",
204 " ",
205 "**",
206 "**",
207 "**",
208 "**",
209 "**",
210 "**",
211 "**",
212 "**",
213 "**",
214 "**",
215 "**",
216 "**",
217 "**",
218 "**",
219 "**",
220 NULL
221};
222
223static char* icon_pause[]=
224{
225 "**** ****",
226 "**** ****",
227 "**** ****",
228 "**** ****",
229 "**** ****",
230 "**** ****",
231 "**** ****",
232 "**** ****",
233 "**** ****",
234 "**** ****",
235 "**** ****",
236 "**** ****",
237 "**** ****",
238 "**** ****",
239 "**** ****",
240 "**** ****",
241 "**** ****",
242 "**** ****",
243 "**** ****",
244 NULL
245};
246
247static char* icon_play[]=
248{
249 "** ",
250 "**** ",
251 "****** ",
252 "******** ",
253 "********** ",
254 "************ ",
255 "************** ",
256 "**************** ",
257 "****************** ",
258 "******************** ",
259 "****************** ",
260 "**************** ",
261 "************** ",
262 "************ ",
263 "********** ",
264 "******** ",
265 "****** ",
266 "**** ",
267 "** ",
268 NULL
269};
270
271static char* icon_record[]=
272{
273 " ",
274 " ",
275 " ",
276 " ",
277 " *** ",
278 " ********* ",
279 " ************* ",
280 " *************** ",
281 "*****************",
282 "*****************",
283 "*****************",
284 " *************** ",
285 " ************* ",
286 " ********* ",
287 " *** ",
288 " ",
289 " ",
290 " ",
291 " ",
292 NULL
293};
294
295static char* icon_usb[]=
296{
297 " ",
298 " ",
299 " ************************** ",
300 " ** **** ",
301 " ** ",
302 " ** ",
303 " ** ",
304 " ** ",
305 " ** ",
306 " **** ** **** ",
307 "***************************************************",
308 " **** ** **** ",
309 " ** ",
310 " ** ",
311 " ** ",
312 " ** ",
313 " *** *** ",
314 " ***************** ",
315 " ",
316 NULL
317};
318
319static char* icon_audio[]=
320{
321 " ************************************** ",
322 " ****************************************** ",
323 " ** ** ",
324 " ** ** ",
325 " ** **** ** ** ****** ** **** ** ",
326 "** ****** ** ** ******* ** ****** **",
327 "** ** ** ** ** ** ** ** ** ** **",
328 "** ** ** ** ** ** ** ** ** ** **",
329 "** ** ** ** ** ** ** ** ** ** **",
330 "** ** ** ** ** ** ** ** ** ** **",
331 "** ******** ** ** ** ** ** ** ** **",
332 "** ******** ** ** ** ** ** ** ** **",
333 "** ** ** ** ** ** ** ** ** ** **",
334 "** ** ** ****** ******* ** ****** **",
335 " ** ** ** **** ****** ** **** ** ",
336 " ** ** ",
337 " ** ** ",
338 " ****************************************** ",
339 " ************************************** ",
340 NULL
341};
342
343static char* icon_param[]=
344{
345 " ********************************************** ",
346 " ************************************************** ",
347 " ** ** ",
348 " ** ** ",
349 " ** ******* **** ******* ***** ** ** ** ",
350 "** ******** ****** ******** ******* ** ** **",
351 "** ** ** ** ** ** ** ** ** *** *** **",
352 "** ** ** ** ** ** ** ** ** *** *** **",
353 "** ** ** ** ** ** ** ** ** **** **** **",
354 "** ** ** ** ** ** ** ** ** ** **** ** **",
355 "** ******** ******** ******** ******** ** **** ** **",
356 "** ******* ******** ******* ******** ** ** ** **",
357 "** ** ** ** ** *** ** ** ** ** **",
358 "** ** ** ** ** *** ** ** ** ** **",
359 " ** ** ** ** ** *** ** ** ** ** ** ",
360 " ** ** ",
361 " ** ** ",
362 " ************************************************** ",
363 " ********************************************** ",
364 NULL
365};
366
367static char* icon_repeat[]=
368{
369 " ************************* ",
370 " *************************** ",
371 " *** ",
372 " ** ",
373 " ** ",
374 " ** ",
375 " ** ",
376 "** ",
377 "** ",
378 "** ",
379 "** ",
380 "** ",
381 " ** ** ",
382 " ** **** ",
383 " ** ****** ",
384 " ** ******** ",
385 " *** ********** ",
386 " ***************************** ",
387 " *****************************",
388 NULL
389};
390
391static char* icon_repeat2[]=
392{
393 " *",
394 " **",
395 "***",
396 " *",
397 " *",
398 " *",
399 " *",
400 " *",
401 " *",
402 " *",
403 " *",
404 " *",
405 " *",
406 " *",
407 " *",
408 " *",
409 " *",
410 " *",
411 " *",
412 NULL
413};
414
Mats Lidell89d22852002-08-21 10:37:34 +0000415
416struct icon_info
417{
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000418 char** bitmap;
Mats Lidell89d22852002-08-21 10:37:34 +0000419 int xpos;
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000420 int row;
Mats Lidell89d22852002-08-21 10:37:34 +0000421};
422
Jörg Hohensohnc6fb5652003-04-19 13:15:33 +0000423#define ICON_VOLUME_POS 224
Mats Lidell0d79fa12002-10-31 17:34:07 +0000424#define ICON_VOLUME_SIZE 20
425#define ICON_VOLUME_X_SIZE 2
426
427static struct icon_info icons [] =
Mats Lidell89d22852002-08-21 10:37:34 +0000428{
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000429 {icon_battery, 0, 0},
Mats Lidell0d79fa12002-10-31 17:34:07 +0000430 {icon_battery_bit, 5, 0},
431 {icon_battery_bit, 15, 0},
432 {icon_battery_bit, 25, 0},
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000433 {icon_usb, 0, 1},
Mats Lidell0d79fa12002-10-31 17:34:07 +0000434 {icon_play, 55, 0},
435 {icon_record, 75, 0},
436 {icon_pause, 100, 0},
437 {icon_audio, 90, 1},
438 {icon_repeat, 170, 0},
439 {icon_repeat2, 170+35+4, 0},
440 {icon_volume, ICON_VOLUME_POS, 0},
441 {icon_volume_1, ICON_VOLUME_POS+ICON_VOLUME_SIZE, 0},
442 {icon_volume_2, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(1*ICON_VOLUME_X_SIZE)+1, 0},
443 {icon_volume_3, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(2*ICON_VOLUME_X_SIZE)+2, 0},
444 {icon_volume_4, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(3*ICON_VOLUME_X_SIZE)+3, 0},
445 {icon_volume_5, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(4*ICON_VOLUME_X_SIZE)+4, 0},
446 {icon_param, 170, 1}
Mats Lidell89d22852002-08-21 10:37:34 +0000447};
448
449void
Björn Stenberg86f9a842002-09-23 11:17:52 +0000450lcd_icon(int icon, bool enable)
Mats Lidell89d22852002-08-21 10:37:34 +0000451{
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000452 lcd_print_icon(icons[icon].xpos, icons[icon].row, enable,
453 icons[icon].bitmap);
Mats Lidell89d22852002-08-21 10:37:34 +0000454}
455
456#endif /* HAVE_LCD_CHARCELLS */
Mats Lidell0d79fa12002-10-31 17:34:07 +0000457
458