summaryrefslogtreecommitdiff
path: root/apps/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/status.c')
-rw-r--r--apps/status.c99
1 files changed, 99 insertions, 0 deletions
diff --git a/apps/status.c b/apps/status.c
new file mode 100644
index 0000000000..781fa90842
--- /dev/null
+++ b/apps/status.c
@@ -0,0 +1,99 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
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 ****************************************************************************/
19#include "lcd.h"
20#include "debug.h"
21#include "kernel.h"
22#include "power.h"
23#include "thread.h"
24#include "settings.h"
25#include "status.h"
26
27static enum playmode current_mode;
28
29void status_init(void)
30{
31 status_set_playmode(STATUS_STOP);
32}
33
34void status_set_playmode(enum playmode mode)
35{
36 current_mode = mode;
37}
38
39void status_draw(void)
40{
41 int battlevel = battery_level();
42
43#ifdef HAVE_LCD_CHARCELLS
44 lcd_icon(ICON_BATTERY, true);
45 if(battlevel > 25)
46 lcd_icon(ICON_BATTERY_1, true);
47 else
48 lcd_icon(ICON_BATTERY_1, false);
49 if(battlevel > 50)
50 lcd_icon(ICON_BATTERY_2, true);
51 else
52 lcd_icon(ICON_BATTERY_2, false);
53 if(battlevel > 75)
54 lcd_icon(ICON_BATTERY_3, true);
55 else
56 lcd_icon(ICON_BATTERY_3, false);
57
58
59 lcd_icon(ICON_VOLUME, true);
60 if(global_settings.volume > 10)
61 lcd_icon(ICON_VOLUME_1, true);
62 else
63 lcd_icon(ICON_VOLUME_1, false);
64 if(global_settings.volume > 30)
65 lcd_icon(ICON_VOLUME_2, true);
66 else
67 lcd_icon(ICON_VOLUME_2, false);
68 if(global_settings.volume > 50)
69 lcd_icon(ICON_VOLUME_3, true);
70 else
71 lcd_icon(ICON_VOLUME_3, false);
72 if(global_settings.volume > 70)
73 lcd_icon(ICON_VOLUME_4, true);
74 else
75 lcd_icon(ICON_VOLUME_4, false);
76 if(global_settings.volume > 90)
77 lcd_icon(ICON_VOLUME_5, true);
78 else
79 lcd_icon(ICON_VOLUME_5, false);
80
81 switch(current_mode)
82 {
83 case STATUS_PLAY:
84 lcd_icon(ICON_PLAY, true);
85 lcd_icon(ICON_PAUSE, false);
86 break;
87
88 case STATUS_STOP:
89 lcd_icon(ICON_PLAY, false);
90 lcd_icon(ICON_PAUSE, false);
91 break;
92
93 case STATUS_PAUSE:
94 lcd_icon(ICON_PLAY, false);
95 lcd_icon(ICON_PAUSE, true);
96 break;
97 }
98#endif
99}