Redo my previous segfault fix in a better way.
[Rockbox.git] / apps / recorder / icons.c
blob007cd07b7dbf492b87992c7ca8611b28b7cb4250
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 Robert E. Hak
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.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
19 #include <string.h>
20 #include "lcd.h"
21 #include "font.h"
22 #include "kernel.h"
23 #include "sprintf.h"
24 #include "rtc.h"
25 #include "powermgmt.h"
27 #include "settings.h"
29 #include "icons.h"
31 const unsigned char bitmap_icons_5x8[][5] =
33 [Icon_Lock_Main] =
34 {0x78, 0x7f, 0x49, 0x7f, 0x78}, /* Lock Main */
35 [Icon_Lock_Remote] =
36 {0x78, 0x7f, 0x49, 0x7f, 0x78}, /* Lock Remote */
37 [Icon_Stereo] =
38 {0x7f, 0x22, 0x1c, 0x22, 0x7f}, /* Stereo recording */
39 [Icon_Mono] =
40 {0x00, 0x1c, 0x22, 0x7f, 0x00}, /* Mono recording */
41 #if CONFIG_CODEC != SWCODEC
42 [Icon_q] =
43 {0x1e, 0x21, 0x31, 0x21, 0x5e} /* Q icon */
44 #endif
47 const unsigned char bitmap_icons_7x8[][7] =
49 {0x08,0x1c,0x3e,0x3e,0x3e,0x14,0x14}, /* Power plug */
50 {0x1c,0x14,0x3e,0x2a,0x22,0x1c,0x08}, /* USB plug */
51 {0x01,0x1e,0x1c,0x3e,0x7f,0x20,0x40}, /* Speaker mute */
52 {0x00,0x7f,0x7f,0x3e,0x1c,0x08,0x00}, /* Play */
53 {0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f}, /* Stop */
54 {0x00,0x7f,0x7f,0x00,0x7f,0x7f,0x00}, /* Pause */
55 {0x7f,0x3e,0x1c,0x7f,0x3e,0x1c,0x08}, /* Fast forward */
56 {0x08,0x1c,0x3e,0x7f,0x1c,0x3e,0x7f}, /* Fast backward */
57 {0x1c,0x3e,0x7f,0x7f,0x7f,0x3e,0x1c}, /* Record */
58 {0x1c,0x3e,0x7f,0x00,0x7f,0x3e,0x1c}, /* Record pause */
59 {0x40,0xa0,0xa0,0xa0,0x7f,0x02,0x02}, /* Radio on */
60 {0x42,0xa4,0xa8,0xb0,0x7f,0x22,0x42}, /* Radio mute */
61 {0x44,0x4e,0x5f,0x44,0x44,0x44,0x38}, /* Repeat playmode */
62 {0x44,0x4e,0x5f,0x44,0x38,0x02,0x7f}, /* Repeat-one playmode */
63 {0x3e,0x41,0x51,0x41,0x45,0x41,0x3e}, /* Shuffle playmode (dice) */
64 {0x04,0x0c,0x1c,0x3c,0x1c,0x0c,0x04}, /* Down-arrow */
65 {0x20,0x30,0x38,0x3c,0x38,0x30,0x20}, /* Up-arrow */
66 {0x7f,0x04,0x4e,0x5f,0x44,0x38,0x7f} /* Repeat-AB playmode */
69 #if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING)
70 const unsigned char bitmap_glyphs_4x8[][4] =
72 /* Keep digits together and first! */
73 [0] =
74 {0x00, 0x3e, 0x22, 0x3e}, /* 0 */
75 [1] =
76 {0x00, 0x24, 0x3e, 0x20}, /* 1 */
77 [2] =
78 {0x00, 0x3a, 0x2a, 0x2e}, /* 2 */
79 [3] =
80 {0x00, 0x22, 0x2a, 0x36}, /* 3 */
81 [4] =
82 {0x00, 0x0e, 0x08, 0x3e}, /* 4 */
83 [5] =
84 {0x00, 0x2e, 0x2a, 0x3a}, /* 5 */
85 [6] =
86 {0x00, 0x3e, 0x2a, 0x3a}, /* 6 */
87 [7] =
88 {0x00, 0x02, 0x02, 0x3e}, /* 7 */
89 [8] =
90 {0x00, 0x3e, 0x2a, 0x3e}, /* 8 */
91 [9] =
92 {0x00, 0x0e, 0x0a, 0x3e}, /* 9 */
93 [10 ... Glyph_4x8Last-1] =
94 {0x00, 0x00, 0x00, 0x00}, /* auto-blank */
95 [Glyph_4x8_k] =
96 {0x00, 0x3e, 0x10, 0x28}, /* k */
99 const unsigned char bitmap_formats_18x8[Format_18x8Last][18]=
101 [0 ... Format_18x8Last-1] = /* auto-blank */
102 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
103 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* ___ */
104 [Format_18x8_AIFF] =
105 {0x00, 0x3c, 0x0a, 0x0a, 0x0a, 0x3c, 0x00, 0x3e, 0x00,
106 0x3e, 0x0a, 0x02, 0x02, 0x00, 0x3e, 0x0a, 0x02, 0x02}, /* AIFF */
107 [Format_18x8_MPA_L3] =
108 {0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x00,
109 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* M__ */
110 [Format_18x8_WAVPACK] =
111 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x20,
112 0x18, 0x20, 0x1e, 0x00, 0x0e, 0x10, 0x20, 0x10, 0x0e}, /* _WV */
113 [Format_18x8_PCM_WAV] =
114 {0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x0a,
115 0x0a, 0x0a, 0x3c, 0x00, 0x0e, 0x10, 0x20, 0x10, 0x0e}, /* WAV */
117 #endif /* CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) */
119 /* Disk/MMC activity */
120 const unsigned char bitmap_icon_disk[12] =
121 #ifdef HAVE_MMC
122 {0x15,0x3f,0x7d,0x7B,0x77,0x67,0x79,0x7b,0x57,0x4f,0x47,0x7f};
123 #else
124 {0x00,0x00,0x00,0x1c,0x2e,0x4f,0x77,0x79,0x3a,0x1c,0x00,0x00};
125 #endif
128 * Print play mode to status bar
130 void statusbar_icon_play_mode(int mode)
132 lcd_mono_bitmap(bitmap_icons_7x8[mode], ICON_PLAY_MODE_X_POS,
133 STATUSBAR_Y_POS, ICON_PLAY_MODE_WIDTH, STATUSBAR_HEIGHT);
137 * Print shuffle mode to status bar
139 void statusbar_icon_shuffle(void)
141 lcd_mono_bitmap(bitmap_icons_7x8[Icon_Shuffle], ICON_SHUFFLE_X_POS,
142 STATUSBAR_Y_POS, ICON_SHUFFLE_WIDTH, STATUSBAR_HEIGHT);