Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 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 Stenberg | 8b69504 | 2004-09-16 14:36:08 +0000 | [diff] [blame] | 19 | #include "config.h" |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 20 | #ifdef HAVE_LCD_CHARCELLS |
| 21 | |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 22 | #include <lcd.h> |
| 23 | #include <kernel.h> |
| 24 | #include <sprintf.h> |
| 25 | #include <string.h> |
| 26 | #include <debug.h> |
| 27 | |
Kjell Ericson | a901c3a | 2002-10-21 20:46:10 +0000 | [diff] [blame] | 28 | extern void lcd_print_icon(int x, int icon_line, bool enable, char **icon); |
| 29 | |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 30 | static char* icon_battery_bit[]= |
| 31 | { |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 32 | "-----", |
| 33 | " ", |
| 34 | "*****", |
| 35 | "*****", |
| 36 | "*****", |
| 37 | "*****", |
| 38 | "*****", |
| 39 | "*****", |
| 40 | " ", |
| 41 | "-----", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 42 | NULL |
| 43 | }; |
| 44 | |
Kjell Ericson | fe10eb3 | 2002-10-21 20:17:47 +0000 | [diff] [blame] | 45 | static char* icon_battery[]= |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 46 | { |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 47 | "********************* ", |
| 48 | "* * ", |
Jens Arnold | 6f3c600 | 2007-04-02 19:31:11 +0000 | [diff] [blame] | 49 | "* ----- ----- ----- * ", |
| 50 | "* ----- ----- ----- ***", |
| 51 | "* ----- ----- ----- * *", |
| 52 | "* ----- ----- ----- * *", |
| 53 | "* ----- ----- ----- ***", |
| 54 | "* ----- ----- ----- * ", |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 55 | "* * ", |
| 56 | "********************* ", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 57 | NULL |
| 58 | }; |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 59 | |
Kjell Ericson | fe10eb3 | 2002-10-21 20:17:47 +0000 | [diff] [blame] | 60 | static char* icon_volume[]= |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 61 | { |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 62 | " ", |
| 63 | " ", |
| 64 | " ", |
| 65 | " ", |
| 66 | "* * * ", |
| 67 | "* * * ", |
| 68 | " * * *** * ", |
| 69 | " * * * * * ", |
| 70 | " * * * * ", |
| 71 | " * *** * ", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 72 | NULL |
| 73 | }; |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 74 | |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 75 | static char* icon_volume_1[]= |
| 76 | { |
| 77 | " ", |
| 78 | " ", |
| 79 | " ", |
| 80 | " ", |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 81 | "**", |
| 82 | "**", |
| 83 | "**", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 84 | "**", |
| 85 | "**", |
| 86 | "**", |
| 87 | NULL |
| 88 | }; |
| 89 | |
| 90 | static char* icon_volume_2[]= |
| 91 | { |
| 92 | " ", |
| 93 | " ", |
| 94 | " ", |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 95 | "**", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 96 | "**", |
| 97 | "**", |
| 98 | "**", |
| 99 | "**", |
| 100 | "**", |
| 101 | "**", |
| 102 | NULL |
| 103 | }; |
| 104 | |
| 105 | static char* icon_volume_3[]= |
| 106 | { |
| 107 | " ", |
| 108 | " ", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 109 | "**", |
| 110 | "**", |
| 111 | "**", |
| 112 | "**", |
| 113 | "**", |
| 114 | "**", |
| 115 | "**", |
| 116 | "**", |
| 117 | NULL |
| 118 | }; |
| 119 | |
| 120 | static char* icon_volume_4[]= |
| 121 | { |
| 122 | " ", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 123 | "**", |
| 124 | "**", |
| 125 | "**", |
| 126 | "**", |
| 127 | "**", |
| 128 | "**", |
| 129 | "**", |
| 130 | "**", |
| 131 | "**", |
| 132 | NULL |
| 133 | }; |
| 134 | |
| 135 | static char* icon_volume_5[]= |
| 136 | { |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 137 | "**", |
| 138 | "**", |
| 139 | "**", |
| 140 | "**", |
| 141 | "**", |
| 142 | "**", |
| 143 | "**", |
| 144 | "**", |
| 145 | "**", |
| 146 | "**", |
| 147 | NULL |
| 148 | }; |
| 149 | |
| 150 | static char* icon_pause[]= |
| 151 | { |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 152 | " **** **** ", |
| 153 | " **** **** ", |
| 154 | " **** **** ", |
| 155 | " **** **** ", |
| 156 | " **** **** ", |
| 157 | " **** **** ", |
| 158 | " **** **** ", |
| 159 | " **** **** ", |
| 160 | " **** **** ", |
| 161 | " **** **** ", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 162 | NULL |
| 163 | }; |
| 164 | |
| 165 | static char* icon_play[]= |
| 166 | { |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 167 | "** ", |
| 168 | "***** ", |
| 169 | "******* ", |
| 170 | "********* ", |
| 171 | "*********** ", |
| 172 | "********* ", |
| 173 | "******* ", |
| 174 | "***** ", |
| 175 | "** ", |
| 176 | " ", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 177 | NULL |
| 178 | }; |
| 179 | |
| 180 | static char* icon_record[]= |
| 181 | { |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 182 | " *** ", |
| 183 | " ***** ", |
| 184 | " ******* ", |
| 185 | " ********* ", |
| 186 | " ********* ", |
| 187 | " ********* ", |
| 188 | " ******* ", |
| 189 | " ***** ", |
| 190 | " *** ", |
| 191 | " ", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 192 | NULL |
| 193 | }; |
| 194 | |
| 195 | static char* icon_usb[]= |
| 196 | { |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 197 | " ********* ", |
| 198 | " ** ** ", |
| 199 | " * ", |
| 200 | " ** * ** ", |
| 201 | "***********************", |
| 202 | " ** * ** ", |
| 203 | " * ", |
| 204 | " ** ** ", |
| 205 | " ******** ", |
| 206 | " ** ", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 207 | NULL |
| 208 | }; |
| 209 | |
| 210 | static char* icon_audio[]= |
| 211 | { |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 212 | " *************************** ", |
| 213 | " ** ** ", |
| 214 | "* ** * * **** * *** *", |
| 215 | "* * * * * * * * * * *", |
| 216 | "* * * * * * * * * * *", |
| 217 | "* ****** * * * * * * * *", |
| 218 | "* * * * * * * * * * *", |
| 219 | "* * * *** **** * *** *", |
| 220 | " ** ** ", |
| 221 | " *************************** ", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 222 | NULL |
| 223 | }; |
| 224 | |
| 225 | static char* icon_param[]= |
| 226 | { |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 227 | " ********************************* ", |
| 228 | " ** ** ", |
| 229 | "* **** ** **** ** ** ** *", |
| 230 | "* * * * * * * * * ** ** *", |
| 231 | "* * * * * * * * * * * * * *", |
| 232 | "* **** ****** **** ****** * * * * *", |
| 233 | "* * * * * * * * * * * *", |
| 234 | "* * * * * * * * * * * *", |
| 235 | " ** ** ", |
| 236 | " ********************************* ", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 237 | NULL |
| 238 | }; |
| 239 | |
| 240 | static char* icon_repeat[]= |
| 241 | { |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 242 | " ", |
| 243 | " *************", |
| 244 | " * ", |
| 245 | " * ", |
| 246 | "* ", |
| 247 | "* ", |
| 248 | "* ** ", |
| 249 | " * **** ", |
| 250 | " * ****** ", |
| 251 | " *************", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 252 | NULL |
| 253 | }; |
| 254 | |
| 255 | static char* icon_repeat2[]= |
| 256 | { |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 257 | " ", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 258 | " *", |
| 259 | " **", |
| 260 | "***", |
| 261 | " *", |
| 262 | " *", |
| 263 | " *", |
| 264 | " *", |
| 265 | " *", |
| 266 | " *", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 267 | NULL |
| 268 | }; |
| 269 | |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 270 | |
| 271 | struct icon_info |
| 272 | { |
Kjell Ericson | fe10eb3 | 2002-10-21 20:17:47 +0000 | [diff] [blame] | 273 | char** bitmap; |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 274 | int xpos; |
Kjell Ericson | fe10eb3 | 2002-10-21 20:17:47 +0000 | [diff] [blame] | 275 | int row; |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 276 | }; |
| 277 | |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 278 | #define ICON_VOLUME_POS 102 |
| 279 | #define ICON_VOLUME_SIZE 14 |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 280 | #define ICON_VOLUME_X_SIZE 2 |
| 281 | |
| 282 | static struct icon_info icons [] = |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 283 | { |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 284 | |
Kjell Ericson | fe10eb3 | 2002-10-21 20:17:47 +0000 | [diff] [blame] | 285 | {icon_battery, 0, 0}, |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 286 | {icon_battery_bit, 2, 0}, |
| 287 | {icon_battery_bit, 8, 0}, |
| 288 | {icon_battery_bit, 14, 0}, |
Kjell Ericson | fe10eb3 | 2002-10-21 20:17:47 +0000 | [diff] [blame] | 289 | {icon_usb, 0, 1}, |
Jens Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 290 | {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 Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 296 | {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 Arnold | 3e496e3 | 2006-02-20 00:31:10 +0000 | [diff] [blame] | 302 | {icon_param, 90, 1} |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 303 | }; |
| 304 | |
| 305 | void |
Björn Stenberg | 86f9a84 | 2002-09-23 11:17:52 +0000 | [diff] [blame] | 306 | lcd_icon(int icon, bool enable) |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 307 | { |
Kjell Ericson | fe10eb3 | 2002-10-21 20:17:47 +0000 | [diff] [blame] | 308 | lcd_print_icon(icons[icon].xpos, icons[icon].row, enable, |
| 309 | icons[icon].bitmap); |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 310 | } |
| 311 | |
| 312 | #endif /* HAVE_LCD_CHARCELLS */ |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 313 | |
| 314 | |