Daniel Stenberg | 1c0c861 | 2002-05-17 12:22:24 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 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 Braun | f150d99 | 2002-08-12 07:14:46 +0000 | [diff] [blame] | 19 | #include <string.h> |
Daniel Stenberg | 93b231c | 2002-09-12 13:33:59 +0000 | [diff] [blame] | 20 | #include "lcd.h" |
| 21 | #include "font.h" |
Markus Braun | 9bf86f7 | 2002-08-09 11:57:31 +0000 | [diff] [blame] | 22 | #include "kernel.h" |
Björn Stenberg | d23591d | 2002-08-10 07:45:35 +0000 | [diff] [blame] | 23 | #include "sprintf.h" |
Markus Braun | f150d99 | 2002-08-12 07:14:46 +0000 | [diff] [blame] | 24 | #include "rtc.h" |
Uwe Freese | 012d1d5 | 2002-12-18 18:47:11 +0000 | [diff] [blame] | 25 | #include "powermgmt.h" |
Daniel Stenberg | 1c0c861 | 2002-05-17 12:22:24 +0000 | [diff] [blame] | 26 | |
Markus Braun | 22a7a2d | 2002-10-14 12:50:20 +0000 | [diff] [blame] | 27 | #include "settings.h" |
| 28 | |
Daniel Stenberg | 1c0c861 | 2002-05-17 12:22:24 +0000 | [diff] [blame] | 29 | #include "icons.h" |
| 30 | |
Jens Arnold | 638dd67 | 2004-07-19 21:46:37 +0000 | [diff] [blame] | 31 | const unsigned char bitmap_icons_5x8[][5] = |
Markus Braun | de8fbf0 | 2002-08-07 10:35:26 +0000 | [diff] [blame] | 32 | { |
Kevin Ferrare | f57d022 | 2005-11-22 21:55:05 +0000 | [diff] [blame] | 33 | [Icon_Lock_Main] ={0x78,0x7f,0x49,0x7f,0x78}, /* Lock Main */ |
Martin Scarratt | 617b67e | 2006-09-02 17:30:30 +0000 | [diff] [blame] | 34 | [Icon_Lock_Remote]={0x78,0x7f,0x49,0x7f,0x78}, /* Lock Remote */ |
Martin Scarratt | 183499a | 2006-09-26 11:56:59 +0000 | [diff] [blame] | 35 | [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 Braun | de8fbf0 | 2002-08-07 10:35:26 +0000 | [diff] [blame] | 40 | }; |
| 41 | |
Kevin Ferrare | f57d022 | 2005-11-22 21:55:05 +0000 | [diff] [blame] | 42 | const unsigned char bitmap_icons_6x8[][6] = |
Daniel Stenberg | 1c0c861 | 2002-05-17 12:22:24 +0000 | [diff] [blame] | 43 | { |
Jörg Hohensohn | 1707fd9 | 2003-12-22 09:48:18 +0000 | [diff] [blame] | 44 | { 0x60, 0x7f, 0x03, 0x33, 0x3f, 0x00 }, /* Musical note */ |
Björn Stenberg | b763822 | 2002-10-08 10:10:16 +0000 | [diff] [blame] | 45 | { 0x7e, 0x41, 0x41, 0x42, 0x7e, 0x00 }, /* Folder */ |
Björn Stenberg | b763822 | 2002-10-08 10:10:16 +0000 | [diff] [blame] | 46 | { 0x55, 0x00, 0x55, 0x55, 0x55, 0x55 }, /* Playlist */ |
Linus Nielsen Feltzing | 6c2af7c | 2005-09-01 08:04:37 +0000 | [diff] [blame] | 47 | { 0x3e, 0x1c, 0x08, 0x00, 0x00, 0x00 }, /* Cursor / Marker */ |
Björn Stenberg | b763822 | 2002-10-08 10:10:16 +0000 | [diff] [blame] | 48 | { 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 Stenberg | b763822 | 2002-10-08 10:10:16 +0000 | [diff] [blame] | 52 | { 0x4e, 0x51, 0x51, 0x40, 0x55, 0x55 }, /* Config file */ |
Björn Stenberg | ba371fb | 2003-06-29 16:33:04 +0000 | [diff] [blame] | 53 | { 0x0a, 0x0a, 0x5f, 0x4e, 0x24, 0x18 }, /* Plugin file */ |
Björn Stenberg | a108ec2 | 2004-01-14 00:13:04 +0000 | [diff] [blame] | 54 | { 0xff, 0x81, 0xaf, 0xaa, 0x8c, 0xf8 }, /* Bookmark file */ |
Hristo Kovachev | 009853f | 2006-04-02 12:23:08 +0000 | [diff] [blame] | 55 | { 0x5f, 0x45, 0x5b, 0x40, 0x55, 0x55 }, /* Preset file */ |
Kevin Ferrare | 8517ed8 | 2005-11-16 02:12:25 +0000 | [diff] [blame] | 56 | { 0x77, 0x55, 0x55, 0x55, 0x55, 0x77 }, /* Queued Item */ |
| 57 | { 0x3e, 0x41, 0x3e, 0x1c, 0x1c, 0x08 }, /* Moving Item */ |
Frank Dischner | 75c3d0b | 2006-03-29 16:21:42 +0000 | [diff] [blame] | 58 | { 0x7f, 0x7f, 0x1c, 0x3e, 0x77, 0x63 }, /* Keyboard file */ |
Michael Sevakis | 661c340 | 2006-10-13 04:16:49 +0000 | [diff] [blame^] | 59 | { 0x00, 0x00, 0x00, 0x08, 0x1c, 0x3e }, /* Reverse Cursor / Marker */ |
Daniel Stenberg | 1c0c861 | 2002-05-17 12:22:24 +0000 | [diff] [blame] | 60 | }; |
| 61 | |
Jens Arnold | 638dd67 | 2004-07-19 21:46:37 +0000 | [diff] [blame] | 62 | const unsigned char bitmap_icons_7x8[][7] = |
Markus Braun | de8fbf0 | 2002-08-07 10:35:26 +0000 | [diff] [blame] | 63 | { |
Björn Stenberg | b763822 | 2002-10-08 10:10:16 +0000 | [diff] [blame] | 64 | {0x08,0x1c,0x3e,0x3e,0x3e,0x14,0x14}, /* Power plug */ |
Jens Arnold | 97a8049 | 2005-06-23 02:18:29 +0000 | [diff] [blame] | 65 | {0x1c,0x14,0x3e,0x2a,0x22,0x1c,0x08}, /* USB plug */ |
Björn Stenberg | b763822 | 2002-10-08 10:10:16 +0000 | [diff] [blame] | 66 | {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 Oleynikov | 2c83634 | 2005-11-19 20:45:32 +0000 | [diff] [blame] | 74 | {0x40,0xa0,0xa0,0xa0,0x7f,0x02,0x02}, /* Radio on */ |
| 75 | {0x42,0xa4,0xa8,0xb0,0x7f,0x22,0x42}, /* Radio mute */ |
Linus Nielsen Feltzing | 0afe4ff | 2002-10-29 13:59:51 +0000 | [diff] [blame] | 76 | {0x44,0x4e,0x5f,0x44,0x44,0x44,0x38}, /* Repeat playmode */ |
| 77 | {0x44,0x4e,0x5f,0x44,0x38,0x02,0x7f}, /* Repeat-one playmode */ |
Björn Stenberg | b763822 | 2002-10-08 10:10:16 +0000 | [diff] [blame] | 78 | {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 Oleynikov | 2c83634 | 2005-11-19 20:45:32 +0000 | [diff] [blame] | 81 | {0x7f,0x04,0x4e,0x5f,0x44,0x38,0x7f} /* Repeat-AB playmode */ |
Markus Braun | de8fbf0 | 2002-08-07 10:35:26 +0000 | [diff] [blame] | 82 | }; |
| 83 | |
Magnus Holmgren | 1ecdbcc | 2006-09-12 20:32:06 +0000 | [diff] [blame] | 84 | #if CONFIG_CODEC == SWCODEC |
Martin Scarratt | 617b67e | 2006-09-02 17:30:30 +0000 | [diff] [blame] | 85 | const unsigned char bitmap_icons_18x8[][18] = |
| 86 | { |
Martin Scarratt | d7fa569 | 2006-09-12 18:26:27 +0000 | [diff] [blame] | 87 | {0x00, 0x00, 0x00, 0x00,0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x3e, 0x2a, |
| 88 | 0x3a, 0x00, 0x0e, 0x08, 0x3e, 0x00}, /* mp3 64kbps */ |
Michael Sevakis | 661c340 | 2006-10-13 04:16:49 +0000 | [diff] [blame^] | 89 | {0x00, 0x00, 0x00, 0x00,0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x0e, 0x0a, |
Martin Scarratt | d7fa569 | 2006-09-12 18:26:27 +0000 | [diff] [blame] | 90 | 0x3e, 0x00, 0x3e, 0x2a, 0x3a, 0x00}, /* mp3 96kbps */ |
Michael Sevakis | 661c340 | 2006-10-13 04:16:49 +0000 | [diff] [blame^] | 91 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3a, 0x2a, |
Martin Scarratt | d7fa569 | 2006-09-12 18:26:27 +0000 | [diff] [blame] | 92 | 0x2e, 0x00, 0x3e, 0x2a, 0x3e, 0x00}, /* mp3 128kbps */ |
Michael Sevakis | 661c340 | 2006-10-13 04:16:49 +0000 | [diff] [blame^] | 93 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3e, 0x2a, |
Martin Scarratt | d7fa569 | 2006-09-12 18:26:27 +0000 | [diff] [blame] | 94 | 0x3a, 0x00, 0x3e, 0x22, 0x3e, 0x00}, /* mp3 160kbps */ |
Michael Sevakis | 661c340 | 2006-10-13 04:16:49 +0000 | [diff] [blame^] | 95 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x0e, 0x0a, |
Martin Scarratt | d7fa569 | 2006-09-12 18:26:27 +0000 | [diff] [blame] | 96 | 0x3e, 0x00, 0x3a, 0x2a, 0x2e, 0x00}, /* mp3 192kbps */ |
Michael Sevakis | 661c340 | 2006-10-13 04:16:49 +0000 | [diff] [blame^] | 97 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3a, 0x2a, |
Martin Scarratt | d7fa569 | 2006-09-12 18:26:27 +0000 | [diff] [blame] | 98 | 0x2e, 0x00, 0x0e, 0x08, 0x3e, 0x00}, /* mp3 224kbps */ |
Michael Sevakis | 661c340 | 2006-10-13 04:16:49 +0000 | [diff] [blame^] | 99 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x22, 0x2a, 0x36, 0x00, 0x3a, 0x2a, |
Martin Scarratt | d7fa569 | 2006-09-12 18:26:27 +0000 | [diff] [blame] | 100 | 0x2e, 0x00, 0x3e, 0x22, 0x3e, 0x00}, /* mp3 320kbps */ |
Michael Sevakis | 661c340 | 2006-10-13 04:16:49 +0000 | [diff] [blame^] | 101 | {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x1e, 0x20, 0x18, 0x20, 0x1e, |
Martin Scarratt | d7fa569 | 2006-09-12 18:26:27 +0000 | [diff] [blame] | 102 | 0x00, 0x1e, 0x20, 0x18, 0x06, 0x00}, /* wv */ |
Michael Sevakis | 661c340 | 2006-10-13 04:16:49 +0000 | [diff] [blame^] | 103 | {0x00, 0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x12, 0x12, 0x3c, |
Martin Scarratt | d7fa569 | 2006-09-12 18:26:27 +0000 | [diff] [blame] | 104 | 0x00, 0x1e, 0x20, 0x18, 0x06, 0x00} /* wav */ |
Martin Scarratt | 617b67e | 2006-09-02 17:30:30 +0000 | [diff] [blame] | 105 | }; |
Martin Scarratt | d7fa569 | 2006-09-12 18:26:27 +0000 | [diff] [blame] | 106 | |
Martin Scarratt | d7fa569 | 2006-09-12 18:26:27 +0000 | [diff] [blame] | 107 | const unsigned char bitmap_icons_12x8[][12] = |
| 108 | { |
Martin Scarratt | 84bd53e | 2006-09-26 19:28:19 +0000 | [diff] [blame] | 109 | {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 Scarratt | d7fa569 | 2006-09-12 18:26:27 +0000 | [diff] [blame] | 121 | }; |
| 122 | #endif |
| 123 | |
Jörg Hohensohn | f5e7a76 | 2005-03-01 22:55:52 +0000 | [diff] [blame] | 124 | /* Disk/MMC activity */ |
Jens Arnold | 548755a | 2005-11-24 00:10:14 +0000 | [diff] [blame] | 125 | const unsigned char bitmap_icon_disk[12] = |
| 126 | #ifdef HAVE_MMC |
Jörg Hohensohn | f5e7a76 | 2005-03-01 22:55:52 +0000 | [diff] [blame] | 127 | {0x15,0x3f,0x7d,0x7B,0x77,0x67,0x79,0x7b,0x57,0x4f,0x47,0x7f}; |
Jens Arnold | 548755a | 2005-11-24 00:10:14 +0000 | [diff] [blame] | 128 | #else |
Jens Arnold | 74a3977 | 2006-04-16 23:53:08 +0000 | [diff] [blame] | 129 | {0x00,0x00,0x00,0x1c,0x2e,0x4f,0x77,0x79,0x3a,0x1c,0x00,0x00}; |
Jens Arnold | 548755a | 2005-11-24 00:10:14 +0000 | [diff] [blame] | 130 | #endif |
Jörg Hohensohn | f5e7a76 | 2005-03-01 22:55:52 +0000 | [diff] [blame] | 131 | |
Markus Braun | de8fbf0 | 2002-08-07 10:35:26 +0000 | [diff] [blame] | 132 | /* |
Markus Braun | de8fbf0 | 2002-08-07 10:35:26 +0000 | [diff] [blame] | 133 | * Print play mode to status bar |
| 134 | */ |
| 135 | void statusbar_icon_play_mode(int mode) |
| 136 | { |
Jens Arnold | 6c00e38 | 2005-08-24 00:09:42 +0000 | [diff] [blame] | 137 | lcd_mono_bitmap(bitmap_icons_7x8[mode], ICON_PLAY_MODE_X_POS, |
| 138 | STATUSBAR_Y_POS, ICON_PLAY_MODE_WIDTH, STATUSBAR_HEIGHT); |
Markus Braun | de8fbf0 | 2002-08-07 10:35:26 +0000 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | /* |
| 142 | * Print shuffle mode to status bar |
| 143 | */ |
| 144 | void statusbar_icon_shuffle(void) |
| 145 | { |
Kevin Ferrare | 1a1abf2 | 2005-11-20 01:02:14 +0000 | [diff] [blame] | 146 | lcd_mono_bitmap(bitmap_icons_7x8[Icon_Shuffle], ICON_SHUFFLE_X_POS, |
Jens Arnold | f894a4c | 2005-07-06 22:58:02 +0000 | [diff] [blame] | 147 | STATUSBAR_Y_POS, ICON_SHUFFLE_WIDTH, STATUSBAR_HEIGHT); |
Markus Braun | de8fbf0 | 2002-08-07 10:35:26 +0000 | [diff] [blame] | 148 | } |