From de8fbf00a8a4a2c85fc9ee4b2758881f4ec435d9 Mon Sep 17 00:00:00 2001 From: Markus Braun Date: Wed, 7 Aug 2002 10:35:26 +0000 Subject: Added status bar to file browser and wps git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1582 a1c6a512-1295-4272-9138-f99709370657 --- apps/status.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'apps/status.c') diff --git a/apps/status.c b/apps/status.c index fde7146..c4bd958 100644 --- a/apps/status.c +++ b/apps/status.c @@ -24,8 +24,18 @@ #include "settings.h" #include "status.h" #include "mpeg.h" +#include "wps.h" +#ifdef HAVE_LCD_BITMAP +#include "icons.h" +#endif +#include "power.h" + static enum playmode current_mode; +#ifdef HAVE_LCD_BITMAP +bool statusbar_enabled = true; +#endif + void status_init(void) { status_set_playmode(STATUS_STOP); @@ -36,6 +46,22 @@ void status_set_playmode(enum playmode mode) current_mode = mode; } +#ifdef HAVE_LCD_BITMAP +bool statusbar(bool state) +{ + bool laststate=statusbar_enabled; + + statusbar_enabled=state; + + return(laststate); +} + +void statusbar_toggle(void) +{ + statusbar_enabled=!statusbar_enabled; +} +#endif + void status_draw(void) { #if defined(HAVE_LCD_CHARCELLS) && !defined(SIMULATOR) @@ -97,4 +123,28 @@ void status_draw(void) break; } #endif +#ifdef HAVE_LCD_BITMAP + int battlevel = battery_level(); + int volume = mpeg_val2phys(SOUND_VOLUME, global_settings.volume); + + if(global_settings.statusbar && statusbar_enabled) { + statusbar_wipe(); +#ifdef HAVE_CHARGE_CTRL + statusbar_icon_battery(battlevel,charger_enabled); +#else + statusbar_icon_battery(battlevel,false); +#endif + statusbar_icon_volume(volume); + statusbar_icon_play_state(current_mode+Icon_Play); + if (global_settings.loop_playlist) + statusbar_icon_play_mode(Icon_Repeat); + else + statusbar_icon_play_mode(Icon_Normal); + if(global_settings.playlist_shuffle) statusbar_icon_shuffle(); + if (keys_locked) statusbar_icon_lock(); +#ifdef HAVE_RTC + statusbar_time(); +#endif + } +#endif } -- cgit v1.1