summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-07-22 22:41:32 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-07-22 22:41:32 +0000
commit7c648303172e27fdeac62e12abd8ef7dc82c9489 (patch)
tree2a86b2d9ec2477aaf18ac21a16fec954d74742c7 /apps
parentcc22cd0736e465f47f4017bd6f4a4729c767456a (diff)
downloadrockbox-7c648303172e27fdeac62e12abd8ef7dc82c9489.tar.gz
rockbox-7c648303172e27fdeac62e12abd8ef7dc82c9489.zip
First version
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1405 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/status.c99
-rw-r--r--apps/status.h33
2 files changed, 132 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 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2002 by Linus Nielsen Feltzing
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+#include "lcd.h"
+#include "debug.h"
+#include "kernel.h"
+#include "power.h"
+#include "thread.h"
+#include "settings.h"
+#include "status.h"
+
+static enum playmode current_mode;
+
+void status_init(void)
+{
+ status_set_playmode(STATUS_STOP);
+}
+
+void status_set_playmode(enum playmode mode)
+{
+ current_mode = mode;
+}
+
+void status_draw(void)
+{
+ int battlevel = battery_level();
+
+#ifdef HAVE_LCD_CHARCELLS
+ lcd_icon(ICON_BATTERY, true);
+ if(battlevel > 25)
+ lcd_icon(ICON_BATTERY_1, true);
+ else
+ lcd_icon(ICON_BATTERY_1, false);
+ if(battlevel > 50)
+ lcd_icon(ICON_BATTERY_2, true);
+ else
+ lcd_icon(ICON_BATTERY_2, false);
+ if(battlevel > 75)
+ lcd_icon(ICON_BATTERY_3, true);
+ else
+ lcd_icon(ICON_BATTERY_3, false);
+
+
+ lcd_icon(ICON_VOLUME, true);
+ if(global_settings.volume > 10)
+ lcd_icon(ICON_VOLUME_1, true);
+ else
+ lcd_icon(ICON_VOLUME_1, false);
+ if(global_settings.volume > 30)
+ lcd_icon(ICON_VOLUME_2, true);
+ else
+ lcd_icon(ICON_VOLUME_2, false);
+ if(global_settings.volume > 50)
+ lcd_icon(ICON_VOLUME_3, true);
+ else
+ lcd_icon(ICON_VOLUME_3, false);
+ if(global_settings.volume > 70)
+ lcd_icon(ICON_VOLUME_4, true);
+ else
+ lcd_icon(ICON_VOLUME_4, false);
+ if(global_settings.volume > 90)
+ lcd_icon(ICON_VOLUME_5, true);
+ else
+ lcd_icon(ICON_VOLUME_5, false);
+
+ switch(current_mode)
+ {
+ case STATUS_PLAY:
+ lcd_icon(ICON_PLAY, true);
+ lcd_icon(ICON_PAUSE, false);
+ break;
+
+ case STATUS_STOP:
+ lcd_icon(ICON_PLAY, false);
+ lcd_icon(ICON_PAUSE, false);
+ break;
+
+ case STATUS_PAUSE:
+ lcd_icon(ICON_PLAY, false);
+ lcd_icon(ICON_PAUSE, true);
+ break;
+ }
+#endif
+}
diff --git a/apps/status.h b/apps/status.h
new file mode 100644
index 0000000000..344d12f91b
--- /dev/null
+++ b/apps/status.h
@@ -0,0 +1,33 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2002 Linus Nielsen Feltzing
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+#ifndef _STATUS_H
+#define _STATUS_H
+
+enum playmode
+{
+ STATUS_PLAY,
+ STATUS_STOP,
+ STATUS_PAUSE
+};
+
+void status_init(void);
+void status_set_playmode(enum playmode mode);
+void status_draw(void);
+
+#endif