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