2002-08-21 10:37:34 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 Mats Lidell <matsl@contactor.se>
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-21 10:37:34 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2010-05-06 22:33:57 +00:00
|
|
|
#include <stdio.h>
|
2004-09-16 14:36:08 +00:00
|
|
|
#include "config.h"
|
2002-08-21 10:37:34 +00:00
|
|
|
|
|
|
|
#include <lcd.h>
|
|
|
|
#include <kernel.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <debug.h>
|
|
|
|
|
2002-10-21 20:46:10 +00:00
|
|
|
extern void lcd_print_icon(int x, int icon_line, bool enable, char **icon);
|
|
|
|
|
2002-10-31 17:34:07 +00:00
|
|
|
static char* icon_battery_bit[]=
|
|
|
|
{
|
2006-02-20 00:31:10 +00:00
|
|
|
"-----",
|
|
|
|
" ",
|
|
|
|
"*****",
|
|
|
|
"*****",
|
|
|
|
"*****",
|
|
|
|
"*****",
|
|
|
|
"*****",
|
|
|
|
"*****",
|
|
|
|
" ",
|
|
|
|
"-----",
|
2002-10-31 17:34:07 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2002-10-21 20:17:47 +00:00
|
|
|
static char* icon_battery[]=
|
2002-10-31 17:34:07 +00:00
|
|
|
{
|
2006-02-20 00:31:10 +00:00
|
|
|
"********************* ",
|
|
|
|
"* * ",
|
2007-04-02 19:31:11 +00:00
|
|
|
"* ----- ----- ----- * ",
|
|
|
|
"* ----- ----- ----- ***",
|
|
|
|
"* ----- ----- ----- * *",
|
|
|
|
"* ----- ----- ----- * *",
|
|
|
|
"* ----- ----- ----- ***",
|
|
|
|
"* ----- ----- ----- * ",
|
2006-02-20 00:31:10 +00:00
|
|
|
"* * ",
|
|
|
|
"********************* ",
|
2002-10-31 17:34:07 +00:00
|
|
|
NULL
|
|
|
|
};
|
2002-10-21 20:17:47 +00:00
|
|
|
|
|
|
|
static char* icon_volume[]=
|
2002-10-31 17:34:07 +00:00
|
|
|
{
|
2006-02-20 00:31:10 +00:00
|
|
|
" ",
|
|
|
|
" ",
|
|
|
|
" ",
|
|
|
|
" ",
|
|
|
|
"* * * ",
|
|
|
|
"* * * ",
|
|
|
|
" * * *** * ",
|
|
|
|
" * * * * * ",
|
|
|
|
" * * * * ",
|
|
|
|
" * *** * ",
|
2002-10-31 17:34:07 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static char* icon_volume_1[]=
|
|
|
|
{
|
|
|
|
" ",
|
|
|
|
" ",
|
|
|
|
" ",
|
|
|
|
" ",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
2006-02-20 00:31:10 +00:00
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
2002-10-31 17:34:07 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static char* icon_volume_2[]=
|
|
|
|
{
|
|
|
|
" ",
|
|
|
|
" ",
|
|
|
|
" ",
|
2006-02-20 00:31:10 +00:00
|
|
|
"**",
|
2002-10-31 17:34:07 +00:00
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static char* icon_volume_3[]=
|
|
|
|
{
|
|
|
|
" ",
|
|
|
|
" ",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static char* icon_volume_4[]=
|
|
|
|
{
|
|
|
|
" ",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static char* icon_volume_5[]=
|
|
|
|
{
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
"**",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static char* icon_pause[]=
|
|
|
|
{
|
2006-02-20 00:31:10 +00:00
|
|
|
" **** **** ",
|
|
|
|
" **** **** ",
|
|
|
|
" **** **** ",
|
|
|
|
" **** **** ",
|
|
|
|
" **** **** ",
|
|
|
|
" **** **** ",
|
|
|
|
" **** **** ",
|
|
|
|
" **** **** ",
|
|
|
|
" **** **** ",
|
|
|
|
" **** **** ",
|
2002-10-31 17:34:07 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static char* icon_play[]=
|
|
|
|
{
|
2006-02-20 00:31:10 +00:00
|
|
|
"** ",
|
|
|
|
"***** ",
|
|
|
|
"******* ",
|
|
|
|
"********* ",
|
|
|
|
"*********** ",
|
|
|
|
"********* ",
|
|
|
|
"******* ",
|
|
|
|
"***** ",
|
|
|
|
"** ",
|
|
|
|
" ",
|
2002-10-31 17:34:07 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static char* icon_record[]=
|
|
|
|
{
|
2006-02-20 00:31:10 +00:00
|
|
|
" *** ",
|
|
|
|
" ***** ",
|
|
|
|
" ******* ",
|
|
|
|
" ********* ",
|
|
|
|
" ********* ",
|
|
|
|
" ********* ",
|
|
|
|
" ******* ",
|
|
|
|
" ***** ",
|
|
|
|
" *** ",
|
|
|
|
" ",
|
2002-10-31 17:34:07 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static char* icon_usb[]=
|
|
|
|
{
|
2006-02-20 00:31:10 +00:00
|
|
|
" ********* ",
|
|
|
|
" ** ** ",
|
|
|
|
" * ",
|
|
|
|
" ** * ** ",
|
|
|
|
"***********************",
|
|
|
|
" ** * ** ",
|
|
|
|
" * ",
|
|
|
|
" ** ** ",
|
|
|
|
" ******** ",
|
|
|
|
" ** ",
|
2002-10-31 17:34:07 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static char* icon_audio[]=
|
|
|
|
{
|
2006-02-20 00:31:10 +00:00
|
|
|
" *************************** ",
|
|
|
|
" ** ** ",
|
|
|
|
"* ** * * **** * *** *",
|
|
|
|
"* * * * * * * * * * *",
|
|
|
|
"* * * * * * * * * * *",
|
|
|
|
"* ****** * * * * * * * *",
|
|
|
|
"* * * * * * * * * * *",
|
|
|
|
"* * * *** **** * *** *",
|
|
|
|
" ** ** ",
|
|
|
|
" *************************** ",
|
2002-10-31 17:34:07 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static char* icon_param[]=
|
|
|
|
{
|
2006-02-20 00:31:10 +00:00
|
|
|
" ********************************* ",
|
|
|
|
" ** ** ",
|
|
|
|
"* **** ** **** ** ** ** *",
|
|
|
|
"* * * * * * * * * ** ** *",
|
|
|
|
"* * * * * * * * * * * * * *",
|
|
|
|
"* **** ****** **** ****** * * * * *",
|
|
|
|
"* * * * * * * * * * * *",
|
|
|
|
"* * * * * * * * * * * *",
|
|
|
|
" ** ** ",
|
|
|
|
" ********************************* ",
|
2002-10-31 17:34:07 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static char* icon_repeat[]=
|
|
|
|
{
|
2006-02-20 00:31:10 +00:00
|
|
|
" ",
|
|
|
|
" *************",
|
|
|
|
" * ",
|
|
|
|
" * ",
|
|
|
|
"* ",
|
|
|
|
"* ",
|
|
|
|
"* ** ",
|
|
|
|
" * **** ",
|
|
|
|
" * ****** ",
|
|
|
|
" *************",
|
2002-10-31 17:34:07 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static char* icon_repeat2[]=
|
|
|
|
{
|
2006-02-20 00:31:10 +00:00
|
|
|
" ",
|
2002-10-31 17:34:07 +00:00
|
|
|
" *",
|
|
|
|
" **",
|
|
|
|
"***",
|
|
|
|
" *",
|
|
|
|
" *",
|
|
|
|
" *",
|
|
|
|
" *",
|
|
|
|
" *",
|
|
|
|
" *",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2002-08-21 10:37:34 +00:00
|
|
|
|
|
|
|
struct icon_info
|
|
|
|
{
|
2002-10-21 20:17:47 +00:00
|
|
|
char** bitmap;
|
2002-08-21 10:37:34 +00:00
|
|
|
int xpos;
|
2002-10-21 20:17:47 +00:00
|
|
|
int row;
|
2002-08-21 10:37:34 +00:00
|
|
|
};
|
|
|
|
|
2006-02-20 00:31:10 +00:00
|
|
|
#define ICON_VOLUME_POS 102
|
|
|
|
#define ICON_VOLUME_SIZE 14
|
2002-10-31 17:34:07 +00:00
|
|
|
#define ICON_VOLUME_X_SIZE 2
|
|
|
|
|
|
|
|
static struct icon_info icons [] =
|
2002-08-21 10:37:34 +00:00
|
|
|
{
|
2006-02-20 00:31:10 +00:00
|
|
|
|
2002-10-21 20:17:47 +00:00
|
|
|
{icon_battery, 0, 0},
|
2006-02-20 00:31:10 +00:00
|
|
|
{icon_battery_bit, 2, 0},
|
|
|
|
{icon_battery_bit, 8, 0},
|
|
|
|
{icon_battery_bit, 14, 0},
|
2002-10-21 20:17:47 +00:00
|
|
|
{icon_usb, 0, 1},
|
2006-02-20 00:31:10 +00:00
|
|
|
{icon_play, 36, 0},
|
|
|
|
{icon_record, 48, 0},
|
|
|
|
{icon_pause, 60, 0},
|
|
|
|
{icon_audio, 37, 1},
|
|
|
|
{icon_repeat, 74, 0},
|
|
|
|
{icon_repeat2, 94, 0},
|
2002-10-31 17:34:07 +00:00
|
|
|
{icon_volume, ICON_VOLUME_POS, 0},
|
|
|
|
{icon_volume_1, ICON_VOLUME_POS+ICON_VOLUME_SIZE, 0},
|
|
|
|
{icon_volume_2, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(1*ICON_VOLUME_X_SIZE)+1, 0},
|
|
|
|
{icon_volume_3, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(2*ICON_VOLUME_X_SIZE)+2, 0},
|
|
|
|
{icon_volume_4, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(3*ICON_VOLUME_X_SIZE)+3, 0},
|
|
|
|
{icon_volume_5, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(4*ICON_VOLUME_X_SIZE)+4, 0},
|
2006-02-20 00:31:10 +00:00
|
|
|
{icon_param, 90, 1}
|
2002-08-21 10:37:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void
|
2002-09-23 11:17:52 +00:00
|
|
|
lcd_icon(int icon, bool enable)
|
2002-08-21 10:37:34 +00:00
|
|
|
{
|
2002-10-21 20:17:47 +00:00
|
|
|
lcd_print_icon(icons[icon].xpos, icons[icon].row, enable,
|
2010-01-03 11:12:31 +00:00
|
|
|
icons[icon].bitmap);
|
2002-08-21 10:37:34 +00:00
|
|
|
}
|
|
|
|
|