blob: b72f6003e8d9dd1fe258d9f7d438128fdd764835 [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 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
Mats Lidell89d22852002-08-21 10:37:34 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
Thomas Martitz55e4fe72010-05-06 22:33:57 +000021#include <stdio.h>
Björn Stenberg8b695042004-09-16 14:36:08 +000022#include "config.h"
Mats Lidell89d22852002-08-21 10:37:34 +000023
Mats Lidell89d22852002-08-21 10:37:34 +000024#include <lcd.h>
25#include <kernel.h>
Mats Lidell89d22852002-08-21 10:37:34 +000026#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{
Jens Arnold3e496e32006-02-20 00:31:10 +000033 "-----",
34 " ",
35 "*****",
36 "*****",
37 "*****",
38 "*****",
39 "*****",
40 "*****",
41 " ",
42 "-----",
Mats Lidell0d79fa12002-10-31 17:34:07 +000043 NULL
44};
45
Kjell Ericsonfe10eb32002-10-21 20:17:47 +000046static char* icon_battery[]=
Mats Lidell0d79fa12002-10-31 17:34:07 +000047{
Jens Arnold3e496e32006-02-20 00:31:10 +000048 "********************* ",
49 "* * ",
Jens Arnold6f3c6002007-04-02 19:31:11 +000050 "* ----- ----- ----- * ",
51 "* ----- ----- ----- ***",
52 "* ----- ----- ----- * *",
53 "* ----- ----- ----- * *",
54 "* ----- ----- ----- ***",
55 "* ----- ----- ----- * ",
Jens Arnold3e496e32006-02-20 00:31:10 +000056 "* * ",
57 "********************* ",
Mats Lidell0d79fa12002-10-31 17:34:07 +000058 NULL
59};
Mats Lidell89d22852002-08-21 10:37:34 +000060
Kjell Ericsonfe10eb32002-10-21 20:17:47 +000061static char* icon_volume[]=
Mats Lidell0d79fa12002-10-31 17:34:07 +000062{
Jens Arnold3e496e32006-02-20 00:31:10 +000063 " ",
64 " ",
65 " ",
66 " ",
67 "* * * ",
68 "* * * ",
69 " * * *** * ",
70 " * * * * * ",
71 " * * * * ",
72 " * *** * ",
Mats Lidell0d79fa12002-10-31 17:34:07 +000073 NULL
74};
Mats Lidell89d22852002-08-21 10:37:34 +000075
Mats Lidell0d79fa12002-10-31 17:34:07 +000076static char* icon_volume_1[]=
77{
78 " ",
79 " ",
80 " ",
81 " ",
Jens Arnold3e496e32006-02-20 00:31:10 +000082 "**",
83 "**",
84 "**",
Mats Lidell0d79fa12002-10-31 17:34:07 +000085 "**",
86 "**",
87 "**",
88 NULL
89};
90
91static char* icon_volume_2[]=
92{
93 " ",
94 " ",
95 " ",
Jens Arnold3e496e32006-02-20 00:31:10 +000096 "**",
Mats Lidell0d79fa12002-10-31 17:34:07 +000097 "**",
98 "**",
99 "**",
100 "**",
101 "**",
102 "**",
103 NULL
104};
105
106static char* icon_volume_3[]=
107{
108 " ",
109 " ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000110 "**",
111 "**",
112 "**",
113 "**",
114 "**",
115 "**",
116 "**",
117 "**",
118 NULL
119};
120
121static char* icon_volume_4[]=
122{
123 " ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000124 "**",
125 "**",
126 "**",
127 "**",
128 "**",
129 "**",
130 "**",
131 "**",
132 "**",
133 NULL
134};
135
136static char* icon_volume_5[]=
137{
Mats Lidell0d79fa12002-10-31 17:34:07 +0000138 "**",
139 "**",
140 "**",
141 "**",
142 "**",
143 "**",
144 "**",
145 "**",
146 "**",
147 "**",
148 NULL
149};
150
151static char* icon_pause[]=
152{
Jens Arnold3e496e32006-02-20 00:31:10 +0000153 " **** **** ",
154 " **** **** ",
155 " **** **** ",
156 " **** **** ",
157 " **** **** ",
158 " **** **** ",
159 " **** **** ",
160 " **** **** ",
161 " **** **** ",
162 " **** **** ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000163 NULL
164};
165
166static char* icon_play[]=
167{
Jens Arnold3e496e32006-02-20 00:31:10 +0000168 "** ",
169 "***** ",
170 "******* ",
171 "********* ",
172 "*********** ",
173 "********* ",
174 "******* ",
175 "***** ",
176 "** ",
177 " ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000178 NULL
179};
180
181static char* icon_record[]=
182{
Jens Arnold3e496e32006-02-20 00:31:10 +0000183 " *** ",
184 " ***** ",
185 " ******* ",
186 " ********* ",
187 " ********* ",
188 " ********* ",
189 " ******* ",
190 " ***** ",
191 " *** ",
192 " ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000193 NULL
194};
195
196static char* icon_usb[]=
197{
Jens Arnold3e496e32006-02-20 00:31:10 +0000198 " ********* ",
199 " ** ** ",
200 " * ",
201 " ** * ** ",
202 "***********************",
203 " ** * ** ",
204 " * ",
205 " ** ** ",
206 " ******** ",
207 " ** ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000208 NULL
209};
210
211static char* icon_audio[]=
212{
Jens Arnold3e496e32006-02-20 00:31:10 +0000213 " *************************** ",
214 " ** ** ",
215 "* ** * * **** * *** *",
216 "* * * * * * * * * * *",
217 "* * * * * * * * * * *",
218 "* ****** * * * * * * * *",
219 "* * * * * * * * * * *",
220 "* * * *** **** * *** *",
221 " ** ** ",
222 " *************************** ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000223 NULL
224};
225
226static char* icon_param[]=
227{
Jens Arnold3e496e32006-02-20 00:31:10 +0000228 " ********************************* ",
229 " ** ** ",
230 "* **** ** **** ** ** ** *",
231 "* * * * * * * * * ** ** *",
232 "* * * * * * * * * * * * * *",
233 "* **** ****** **** ****** * * * * *",
234 "* * * * * * * * * * * *",
235 "* * * * * * * * * * * *",
236 " ** ** ",
237 " ********************************* ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000238 NULL
239};
240
241static char* icon_repeat[]=
242{
Jens Arnold3e496e32006-02-20 00:31:10 +0000243 " ",
244 " *************",
245 " * ",
246 " * ",
247 "* ",
248 "* ",
249 "* ** ",
250 " * **** ",
251 " * ****** ",
252 " *************",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000253 NULL
254};
255
256static char* icon_repeat2[]=
257{
Jens Arnold3e496e32006-02-20 00:31:10 +0000258 " ",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000259 " *",
260 " **",
261 "***",
262 " *",
263 " *",
264 " *",
265 " *",
266 " *",
267 " *",
Mats Lidell0d79fa12002-10-31 17:34:07 +0000268 NULL
269};
270
Mats Lidell89d22852002-08-21 10:37:34 +0000271
272struct icon_info
273{
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000274 char** bitmap;
Mats Lidell89d22852002-08-21 10:37:34 +0000275 int xpos;
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000276 int row;
Mats Lidell89d22852002-08-21 10:37:34 +0000277};
278
Jens Arnold3e496e32006-02-20 00:31:10 +0000279#define ICON_VOLUME_POS 102
280#define ICON_VOLUME_SIZE 14
Mats Lidell0d79fa12002-10-31 17:34:07 +0000281#define ICON_VOLUME_X_SIZE 2
282
283static struct icon_info icons [] =
Mats Lidell89d22852002-08-21 10:37:34 +0000284{
Jens Arnold3e496e32006-02-20 00:31:10 +0000285
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000286 {icon_battery, 0, 0},
Jens Arnold3e496e32006-02-20 00:31:10 +0000287 {icon_battery_bit, 2, 0},
288 {icon_battery_bit, 8, 0},
289 {icon_battery_bit, 14, 0},
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000290 {icon_usb, 0, 1},
Jens Arnold3e496e32006-02-20 00:31:10 +0000291 {icon_play, 36, 0},
292 {icon_record, 48, 0},
293 {icon_pause, 60, 0},
294 {icon_audio, 37, 1},
295 {icon_repeat, 74, 0},
296 {icon_repeat2, 94, 0},
Mats Lidell0d79fa12002-10-31 17:34:07 +0000297 {icon_volume, ICON_VOLUME_POS, 0},
298 {icon_volume_1, ICON_VOLUME_POS+ICON_VOLUME_SIZE, 0},
299 {icon_volume_2, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(1*ICON_VOLUME_X_SIZE)+1, 0},
300 {icon_volume_3, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(2*ICON_VOLUME_X_SIZE)+2, 0},
301 {icon_volume_4, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(3*ICON_VOLUME_X_SIZE)+3, 0},
302 {icon_volume_5, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(4*ICON_VOLUME_X_SIZE)+4, 0},
Jens Arnold3e496e32006-02-20 00:31:10 +0000303 {icon_param, 90, 1}
Mats Lidell89d22852002-08-21 10:37:34 +0000304};
305
306void
Björn Stenberg86f9a842002-09-23 11:17:52 +0000307lcd_icon(int icon, bool enable)
Mats Lidell89d22852002-08-21 10:37:34 +0000308{
Kjell Ericsonfe10eb32002-10-21 20:17:47 +0000309 lcd_print_icon(icons[icon].xpos, icons[icon].row, enable,
Andree Buschmann5cebdcd2010-01-03 11:12:31 +0000310 icons[icon].bitmap);
Mats Lidell89d22852002-08-21 10:37:34 +0000311}
312