blob: 46d628e78083a1ef269a072469834d84926d2691 [file] [log] [blame]
Daniel Stenberg1c0c8612002-05-17 12:22:24 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 Robert E. Hak
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 ****************************************************************************/
Markus Braunf150d992002-08-12 07:14:46 +000019#include <string.h>
Daniel Stenberg93b231c2002-09-12 13:33:59 +000020#include "lcd.h"
21#include "font.h"
Markus Braun9bf86f72002-08-09 11:57:31 +000022#include "kernel.h"
Björn Stenbergd23591d2002-08-10 07:45:35 +000023#include "sprintf.h"
Markus Braunf150d992002-08-12 07:14:46 +000024#include "rtc.h"
Uwe Freese012d1d52002-12-18 18:47:11 +000025#include "powermgmt.h"
Daniel Stenberg1c0c8612002-05-17 12:22:24 +000026
Markus Braun22a7a2d2002-10-14 12:50:20 +000027#include "settings.h"
28
Daniel Stenberg1c0c8612002-05-17 12:22:24 +000029#include "icons.h"
30
Jens Arnold638dd672004-07-19 21:46:37 +000031const unsigned char bitmap_icons_5x8[][5] =
Markus Braunde8fbf02002-08-07 10:35:26 +000032{
Kevin Ferraref57d0222005-11-22 21:55:05 +000033 [Icon_Lock_Main] ={0x78,0x7f,0x49,0x7f,0x78}, /* Lock Main */
Martin Scarratt617b67e2006-09-02 17:30:30 +000034 [Icon_Lock_Remote]={0x78,0x7f,0x49,0x7f,0x78}, /* Lock Remote */
Martin Scarratt183499a2006-09-26 11:56:59 +000035 [Icon_Stereo]={0x7f, 0x1c, 0x00, 0x1c, 0x7f}, /* Stereo recording */
36 [Icon_Mono]={0x00, 0x1c, 0x7f, 0x00, 0x00}, /* Mono recording */
37#if CONFIG_CODEC != SWCODEC
38 [Icon_q]={0x1e, 0x21, 0x31, 0x21, 0x5e} /* Q icon */
39#endif
Markus Braunde8fbf02002-08-07 10:35:26 +000040};
41
Kevin Ferraref57d0222005-11-22 21:55:05 +000042const unsigned char bitmap_icons_6x8[][6] =
Daniel Stenberg1c0c8612002-05-17 12:22:24 +000043{
Jörg Hohensohn1707fd92003-12-22 09:48:18 +000044 { 0x60, 0x7f, 0x03, 0x33, 0x3f, 0x00 }, /* Musical note */
Björn Stenbergb7638222002-10-08 10:10:16 +000045 { 0x7e, 0x41, 0x41, 0x42, 0x7e, 0x00 }, /* Folder */
Björn Stenbergb7638222002-10-08 10:10:16 +000046 { 0x55, 0x00, 0x55, 0x55, 0x55, 0x55 }, /* Playlist */
Linus Nielsen Feltzing6c2af7c2005-09-01 08:04:37 +000047 { 0x3e, 0x1c, 0x08, 0x00, 0x00, 0x00 }, /* Cursor / Marker */
Björn Stenbergb7638222002-10-08 10:10:16 +000048 { 0x58, 0x5f, 0x42, 0x50, 0x55, 0x55 }, /* WPS file */
49 { 0x63, 0x7f, 0x3a, 0x7f, 0x63, 0x00 }, /* Mod or ajz file */
50 { 0x60, 0x70, 0x38, 0x2c, 0x7e, 0x7e }, /* Font file */
51 { 0x3e, 0x2a, 0x3e, 0x2a, 0x2a, 0x3e }, /* Language file */
Björn Stenbergb7638222002-10-08 10:10:16 +000052 { 0x4e, 0x51, 0x51, 0x40, 0x55, 0x55 }, /* Config file */
Björn Stenbergba371fb2003-06-29 16:33:04 +000053 { 0x0a, 0x0a, 0x5f, 0x4e, 0x24, 0x18 }, /* Plugin file */
Björn Stenberga108ec22004-01-14 00:13:04 +000054 { 0xff, 0x81, 0xaf, 0xaa, 0x8c, 0xf8 }, /* Bookmark file */
Hristo Kovachev009853f2006-04-02 12:23:08 +000055 { 0x5f, 0x45, 0x5b, 0x40, 0x55, 0x55 }, /* Preset file */
Kevin Ferrare8517ed82005-11-16 02:12:25 +000056 { 0x77, 0x55, 0x55, 0x55, 0x55, 0x77 }, /* Queued Item */
57 { 0x3e, 0x41, 0x3e, 0x1c, 0x1c, 0x08 }, /* Moving Item */
Frank Dischner75c3d0b2006-03-29 16:21:42 +000058 { 0x7f, 0x7f, 0x1c, 0x3e, 0x77, 0x63 }, /* Keyboard file */
Michael Sevakis661c3402006-10-13 04:16:49 +000059 { 0x00, 0x00, 0x00, 0x08, 0x1c, 0x3e }, /* Reverse Cursor / Marker */
Daniel Stenberg1c0c8612002-05-17 12:22:24 +000060};
61
Jens Arnold638dd672004-07-19 21:46:37 +000062const unsigned char bitmap_icons_7x8[][7] =
Markus Braunde8fbf02002-08-07 10:35:26 +000063{
Björn Stenbergb7638222002-10-08 10:10:16 +000064 {0x08,0x1c,0x3e,0x3e,0x3e,0x14,0x14}, /* Power plug */
Jens Arnold97a80492005-06-23 02:18:29 +000065 {0x1c,0x14,0x3e,0x2a,0x22,0x1c,0x08}, /* USB plug */
Björn Stenbergb7638222002-10-08 10:10:16 +000066 {0x01,0x1e,0x1c,0x3e,0x7f,0x20,0x40}, /* Speaker mute */
67 {0x00,0x7f,0x7f,0x3e,0x1c,0x08,0x00}, /* Play */
68 {0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f}, /* Stop */
69 {0x00,0x7f,0x7f,0x00,0x7f,0x7f,0x00}, /* Pause */
70 {0x7f,0x3e,0x1c,0x7f,0x3e,0x1c,0x08}, /* Fast forward */
71 {0x08,0x1c,0x3e,0x7f,0x1c,0x3e,0x7f}, /* Fast backward */
72 {0x1c,0x3e,0x7f,0x7f,0x7f,0x3e,0x1c}, /* Record */
73 {0x1c,0x3e,0x7f,0x00,0x7f,0x3e,0x1c}, /* Record pause */
Anton Oleynikov2c836342005-11-19 20:45:32 +000074 {0x40,0xa0,0xa0,0xa0,0x7f,0x02,0x02}, /* Radio on */
75 {0x42,0xa4,0xa8,0xb0,0x7f,0x22,0x42}, /* Radio mute */
Linus Nielsen Feltzing0afe4ff2002-10-29 13:59:51 +000076 {0x44,0x4e,0x5f,0x44,0x44,0x44,0x38}, /* Repeat playmode */
77 {0x44,0x4e,0x5f,0x44,0x38,0x02,0x7f}, /* Repeat-one playmode */
Björn Stenbergb7638222002-10-08 10:10:16 +000078 {0x3e,0x41,0x51,0x41,0x45,0x41,0x3e}, /* Shuffle playmode (dice) */
79 {0x04,0x0c,0x1c,0x3c,0x1c,0x0c,0x04}, /* Down-arrow */
80 {0x20,0x30,0x38,0x3c,0x38,0x30,0x20}, /* Up-arrow */
Anton Oleynikov2c836342005-11-19 20:45:32 +000081 {0x7f,0x04,0x4e,0x5f,0x44,0x38,0x7f} /* Repeat-AB playmode */
Markus Braunde8fbf02002-08-07 10:35:26 +000082};
83
Magnus Holmgren1ecdbcc2006-09-12 20:32:06 +000084#if CONFIG_CODEC == SWCODEC
Martin Scarratt617b67e2006-09-02 17:30:30 +000085const unsigned char bitmap_icons_18x8[][18] =
86{
Martin Scarrattd7fa5692006-09-12 18:26:27 +000087 {0x00, 0x00, 0x00, 0x00,0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x3e, 0x2a,
88 0x3a, 0x00, 0x0e, 0x08, 0x3e, 0x00}, /* mp3 64kbps */
Michael Sevakis661c3402006-10-13 04:16:49 +000089 {0x00, 0x00, 0x00, 0x00,0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x0e, 0x0a,
Martin Scarrattd7fa5692006-09-12 18:26:27 +000090 0x3e, 0x00, 0x3e, 0x2a, 0x3a, 0x00}, /* mp3 96kbps */
Michael Sevakis661c3402006-10-13 04:16:49 +000091 {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3a, 0x2a,
Martin Scarrattd7fa5692006-09-12 18:26:27 +000092 0x2e, 0x00, 0x3e, 0x2a, 0x3e, 0x00}, /* mp3 128kbps */
Michael Sevakis661c3402006-10-13 04:16:49 +000093 {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3e, 0x2a,
Martin Scarrattd7fa5692006-09-12 18:26:27 +000094 0x3a, 0x00, 0x3e, 0x22, 0x3e, 0x00}, /* mp3 160kbps */
Michael Sevakis661c3402006-10-13 04:16:49 +000095 {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x0e, 0x0a,
Martin Scarrattd7fa5692006-09-12 18:26:27 +000096 0x3e, 0x00, 0x3a, 0x2a, 0x2e, 0x00}, /* mp3 192kbps */
Michael Sevakis661c3402006-10-13 04:16:49 +000097 {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3a, 0x2a,
Martin Scarrattd7fa5692006-09-12 18:26:27 +000098 0x2e, 0x00, 0x0e, 0x08, 0x3e, 0x00}, /* mp3 224kbps */
Michael Sevakis661c3402006-10-13 04:16:49 +000099 {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x22, 0x2a, 0x36, 0x00, 0x3a, 0x2a,
Martin Scarrattd7fa5692006-09-12 18:26:27 +0000100 0x2e, 0x00, 0x3e, 0x22, 0x3e, 0x00}, /* mp3 320kbps */
Michael Sevakis661c3402006-10-13 04:16:49 +0000101 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x1e, 0x20, 0x18, 0x20, 0x1e,
Martin Scarrattd7fa5692006-09-12 18:26:27 +0000102 0x00, 0x1e, 0x20, 0x18, 0x06, 0x00}, /* wv */
Michael Sevakis661c3402006-10-13 04:16:49 +0000103 {0x00, 0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x12, 0x12, 0x3c,
Martin Scarrattd7fa5692006-09-12 18:26:27 +0000104 0x00, 0x1e, 0x20, 0x18, 0x06, 0x00} /* wav */
Martin Scarratt617b67e2006-09-02 17:30:30 +0000105};
Martin Scarrattd7fa5692006-09-12 18:26:27 +0000106
Martin Scarrattd7fa5692006-09-12 18:26:27 +0000107const unsigned char bitmap_icons_12x8[][12] =
108{
Martin Scarratt84bd53e2006-09-26 19:28:19 +0000109 {0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x2a, 0x3e, 0x00, 0x3e, 0x10, 0x28}, /* 8khz */
110 {0x00, 0x24, 0x3e, 0x20, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3e, 0x10, 0x28}, /* 11khz */
111 {0x00, 0x24, 0x3e, 0x20, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3e, 0x10, 0x28}, /* 12khz */
112 {0x00, 0x24, 0x3e, 0x20, 0x00, 0x3e, 0x2a, 0x3a, 0x00, 0x3e, 0x10, 0x28}, /* 16khz */
113 {0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3e, 0x10, 0x28}, /* 22khz */
114 {0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x0e, 0x08, 0x3e, 0x00, 0x3e, 0x10, 0x28}, /* 24khz */
115 {0x00, 0x22, 0x2a, 0x36, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3e, 0x10, 0x28}, /* 32khz */
116 {0x00, 0x0e, 0x08, 0x3e, 0x00, 0x0e, 0x08, 0x3e, 0x00, 0x3e, 0x10, 0x28}, /* 44.1khz */
117 {0x00, 0x0e, 0x08, 0x3e, 0x00, 0x3e, 0x2a, 0x3e, 0x00, 0x3e, 0x10, 0x28}, /* 48khz */
118 {0x00, 0x3e, 0x2a, 0x3a, 0x00, 0x0e, 0x08, 0x3e, 0x00, 0x3e, 0x10, 0x28}, /* 64khz */
119 {0x00, 0x3e, 0x2a, 0x3e, 0x00, 0x3e, 0x2a, 0x3e, 0x00, 0x3e, 0x10, 0x28}, /* 88.2khz */
120 {0x00, 0x0e, 0x0a, 0x3e, 0x00, 0x3e, 0x2a, 0x3a, 0x00, 0x3e, 0x10, 0x28} /* 96khz */
Martin Scarrattd7fa5692006-09-12 18:26:27 +0000121};
122#endif
123
Jörg Hohensohnf5e7a762005-03-01 22:55:52 +0000124/* Disk/MMC activity */
Jens Arnold548755a2005-11-24 00:10:14 +0000125const unsigned char bitmap_icon_disk[12] =
126#ifdef HAVE_MMC
Jörg Hohensohnf5e7a762005-03-01 22:55:52 +0000127 {0x15,0x3f,0x7d,0x7B,0x77,0x67,0x79,0x7b,0x57,0x4f,0x47,0x7f};
Jens Arnold548755a2005-11-24 00:10:14 +0000128#else
Jens Arnold74a39772006-04-16 23:53:08 +0000129 {0x00,0x00,0x00,0x1c,0x2e,0x4f,0x77,0x79,0x3a,0x1c,0x00,0x00};
Jens Arnold548755a2005-11-24 00:10:14 +0000130#endif
Jörg Hohensohnf5e7a762005-03-01 22:55:52 +0000131
Markus Braunde8fbf02002-08-07 10:35:26 +0000132/*
Markus Braunde8fbf02002-08-07 10:35:26 +0000133 * Print play mode to status bar
134 */
135void statusbar_icon_play_mode(int mode)
136{
Jens Arnold6c00e382005-08-24 00:09:42 +0000137 lcd_mono_bitmap(bitmap_icons_7x8[mode], ICON_PLAY_MODE_X_POS,
138 STATUSBAR_Y_POS, ICON_PLAY_MODE_WIDTH, STATUSBAR_HEIGHT);
Markus Braunde8fbf02002-08-07 10:35:26 +0000139}
140
141/*
142 * Print shuffle mode to status bar
143 */
144void statusbar_icon_shuffle(void)
145{
Kevin Ferrare1a1abf22005-11-20 01:02:14 +0000146 lcd_mono_bitmap(bitmap_icons_7x8[Icon_Shuffle], ICON_SHUFFLE_X_POS,
Jens Arnoldf894a4c2005-07-06 22:58:02 +0000147 STATUSBAR_Y_POS, ICON_SHUFFLE_WIDTH, STATUSBAR_HEIGHT);
Markus Braunde8fbf02002-08-07 10:35:26 +0000148}