blob: f24fce2ca56c01a0d103e1ac4e7641bc41fb34bd [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 ****************************************************************************/
Björn Stenberg8b695042004-09-16 14:36:08 +000019#include "config.h"
Mats Lidell89d22852002-08-21 10:37:34 +000020#ifdef HAVE_LCD_CHARCELLS
21
Mats Lidell89d22852002-08-21 10:37:34 +000022#include <lcd.h>
23#include <kernel.h>
24#include <sprintf.h>
25#include <string.h>
26#include <debug.h>
27
Kjell Ericsona901c3a2002-10-21 20:46:10 +000028extern void lcd_print_icon(int x, int icon_line, bool enable, char **icon);
29
Mats Lidell0d79fa12002-10-31 17:34:07 +000030static char* icon_battery_bit[]=
31{
Jens Arnold3e496e32006-02-20 00:31:10 +000032 "-----",
33 " ",
34 "*****",
35 "*****",
36 "*****",
37 "*****",
38 "*****",
39 "*****",
40 " ",
41 "-----",
Mats Lidell0d79fa12002-10-31 17:34:07 +000042 NULL
43};
44
Kjell Ericsonfe10eb32002-10-21 20:17:47 +000045static char* icon_battery[]=
Mats Lidell0d79fa12002-10-31 17:34:07 +000046{
Jens Arnold3e496e32006-02-20 00:31:10 +000047 "********************* ",
48 "* * ",
Jens Arnold6f3c6002007-04-02 19:31:11 +000049 "* ----- ----- ----- * ",
50 "* ----- ----- ----- ***",
51 "* ----- ----- ----- * *",
52 "* ----- ----- ----- * *",
53 "* ----- ----- ----- ***",
54 "* ----- ----- ----- * ",
Jens Arnold3e496e32006-02-20 00:31:10 +000055 "* * ",
56 "********************* ",
Mats Lidell0d79fa12002-10-31 17:34:07 +000057 NULL
58};
Mats Lidell89d22852002-08-21 10:37:34 +000059
Kjell Ericsonfe10eb32002-10-21 20:17:47 +000060static char* icon_volume[]=
Mats Lidell0d79fa12002-10-31 17:34:07 +000061{
Jens Arnold3e496e32006-02-20 00:31:10 +000062 " ",
63 " ",
64 " ",
65 " ",
66 "* * * ",
67 "* * * ",
68 " * * *** * ",
69 " * * * * * ",
70 " * * * * ",
71 " * *** * ",
Mats Lidell0d79fa12002-10-31 17:34:07 +000072 NULL
73};
Mats Lidell89d22852002-08-21 10:37:34 +000074
Mats Lidell0d79fa12002-10-31 17:34:07 +000075static char* icon_volume_1[]=
76{
77 " ",
78 " ",
79 " ",
80 " ",
Jens Arnold3e496e32006-02-20 00:31:10 +000081 "**",
82 "**",
83 "**",
Mats Lidell0d79fa12002-10-31 17:34:07 +000084 "**",
85 "**",
86 "**",
87 NULL
88};
89
90static char* icon_volume_2[]=
91{
92 " ",
93 " ",
94 " ",
Jens Arnold3e496e32006-02-20 00:31:10 +000095 "**",
Mats Lidell0d79fa12002-10-31 17:34:07 +000096 "**",
97 "**",
98 "**",
99 "**",
100 "**",
101 "**",
102 NULL
103};
104
105static char* icon_volume_3[]=
106{
107 " ",
108 " ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000109 "**",
110 "**",
111 "**",
112 "**",
113 "**",
114 "**",
115 "**",
116 "**",
117 NULL
118};
119
120static char* icon_volume_4[]=
121{
122 " ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000123 "**",
124 "**",
125 "**",
126 "**",
127 "**",
128 "**",
129 "**",
130 "**",
131 "**",
132 NULL
133};
134
135static char* icon_volume_5[]=
136{
Mats Lidell0d79fa12002-10-31 17:34:07 +0000137 "**",
138 "**",
139 "**",
140 "**",
141 "**",
142 "**",
143 "**",
144 "**",
145 "**",
146 "**",
147 NULL
148};
149
150static char* icon_pause[]=
151{
Jens Arnold3e496e32006-02-20 00:31:10 +0000152 " **** **** ",
153 " **** **** ",
154 " **** **** ",
155 " **** **** ",
156 " **** **** ",
157 " **** **** ",
158 " **** **** ",
159 " **** **** ",
160 " **** **** ",
161 " **** **** ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000162 NULL
163};
164
165static char* icon_play[]=
166{
Jens Arnold3e496e32006-02-20 00:31:10 +0000167 "** ",
168 "***** ",
169 "******* ",
170 "********* ",
171 "*********** ",
172 "********* ",
173 "******* ",
174 "***** ",
175 "** ",
176 " ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000177 NULL
178};
179
180static char* icon_record[]=
181{
Jens Arnold3e496e32006-02-20 00:31:10 +0000182 " *** ",
183 " ***** ",
184 " ******* ",
185 " ********* ",
186 " ********* ",
187 " ********* ",
188 " ******* ",
189 " ***** ",
190 " *** ",
191 " ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000192 NULL
193};
194
195static char* icon_usb[]=
196{
Jens Arnold3e496e32006-02-20 00:31:10 +0000197 " ********* ",
198 " ** ** ",
199 " * ",
200 " ** * ** ",
201 "***********************",
202 " ** * ** ",
203 " * ",
204 " ** ** ",
205 " ******** ",
206 " ** ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000207 NULL
208};
209
210static char* icon_audio[]=
211{
Jens Arnold3e496e32006-02-20 00:31:10 +0000212 " *************************** ",
213 " ** ** ",
214 "* ** * * **** * *** *",
215 "* * * * * * * * * * *",
216 "* * * * * * * * * * *",
217 "* ****** * * * * * * * *",
218 "* * * * * * * * * * *",
219 "* * * *** **** * *** *",
220 " ** ** ",
221 " *************************** ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000222 NULL
223};
224
225static char* icon_param[]=
226{
Jens Arnold3e496e32006-02-20 00:31:10 +0000227 " ********************************* ",
228 " ** ** ",
229 "* **** ** **** ** ** ** *",
230 "* * * * * * * * * ** ** *",
231 "* * * * * * * * * * * * * *",
232 "* **** ****** **** ****** * * * * *",
233 "* * * * * * * * * * * *",
234 "* * * * * * * * * * * *",
235 " ** ** ",
236 " ********************************* ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000237 NULL
238};
239
240static char* icon_repeat[]=
241{
Jens Arnold3e496e32006-02-20 00:31:10 +0000242 " ",
243 " *************",
244 " * ",
245 " * ",
246 "* ",
247 "* ",
248 "* ** ",
249 " * **** ",
250 " * ****** ",
251 " *************",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000252 NULL
253};
254
255static char* icon_repeat2[]=
256{
Jens Arnold3e496e32006-02-20 00:31:10 +0000257 " ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000258 " *",
259 " **",
260 "***",
261 " *",
262 " *",
263 " *",
264 " *",
265 " *",
266 " *",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000267 NULL
268};
269
Mats Lidell89d22852002-08-21 10:37:34 +0000270
271struct icon_info
272{
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000273 char** bitmap;
Mats Lidell89d22852002-08-21 10:37:34 +0000274 int xpos;
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000275 int row;
Mats Lidell89d22852002-08-21 10:37:34 +0000276};
277
Jens Arnold3e496e32006-02-20 00:31:10 +0000278#define ICON_VOLUME_POS 102
279#define ICON_VOLUME_SIZE 14
Mats Lidell0d79fa12002-10-31 17:34:07 +0000280#define ICON_VOLUME_X_SIZE 2
281
282static struct icon_info icons [] =
Mats Lidell89d22852002-08-21 10:37:34 +0000283{
Jens Arnold3e496e32006-02-20 00:31:10 +0000284
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000285 {icon_battery, 0, 0},
Jens Arnold3e496e32006-02-20 00:31:10 +0000286 {icon_battery_bit, 2, 0},
287 {icon_battery_bit, 8, 0},
288 {icon_battery_bit, 14, 0},
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000289 {icon_usb, 0, 1},
Jens Arnold3e496e32006-02-20 00:31:10 +0000290 {icon_play, 36, 0},
291 {icon_record, 48, 0},
292 {icon_pause, 60, 0},
293 {icon_audio, 37, 1},
294 {icon_repeat, 74, 0},
295 {icon_repeat2, 94, 0},
Mats Lidell0d79fa12002-10-31 17:34:07 +0000296 {icon_volume, ICON_VOLUME_POS, 0},
297 {icon_volume_1, ICON_VOLUME_POS+ICON_VOLUME_SIZE, 0},
298 {icon_volume_2, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(1*ICON_VOLUME_X_SIZE)+1, 0},
299 {icon_volume_3, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(2*ICON_VOLUME_X_SIZE)+2, 0},
300 {icon_volume_4, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(3*ICON_VOLUME_X_SIZE)+3, 0},
301 {icon_volume_5, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(4*ICON_VOLUME_X_SIZE)+4, 0},
Jens Arnold3e496e32006-02-20 00:31:10 +0000302 {icon_param, 90, 1}
Mats Lidell89d22852002-08-21 10:37:34 +0000303};
304
305void
Björn Stenberg86f9a842002-09-23 11:17:52 +0000306lcd_icon(int icon, bool enable)
Mats Lidell89d22852002-08-21 10:37:34 +0000307{
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000308 lcd_print_icon(icons[icon].xpos, icons[icon].row, enable,
309 icons[icon].bitmap);
Mats Lidell89d22852002-08-21 10:37:34 +0000310}
311
312#endif /* HAVE_LCD_CHARCELLS */
Mats Lidell0d79fa12002-10-31 17:34:07 +0000313
314