diff options
Diffstat (limited to 'apps/status.c')
-rw-r--r-- | apps/status.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/apps/status.c b/apps/status.c index fde7146a88..c4bd958964 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 } |