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/recorder/icons.c | 169 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) (limited to 'apps/recorder/icons.c') diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index 50475eb8c9..482c764b52 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c @@ -19,6 +19,12 @@ #include #include "icons.h" +#ifndef SIMULATOR +#include "sprintf.h" +#endif +#ifdef HAVE_RTC +#include "rtc.h" +#endif #ifdef HAVE_LCD_BITMAP @@ -34,6 +40,12 @@ unsigned char slider_bar[] = 0x7c, 0x28, 0x28, 0x28, 0x28, 0x38 }; +static unsigned char bitmap_icon_5x8[][5] = +{ + /* Lock */ + {0x78,0x7f,0x49,0x7f,0x78} +}; + unsigned char bitmap_icons_6x8[LastIcon][6] = { /* Box_Filled */ @@ -58,6 +70,36 @@ unsigned char bitmap_icons_6x8[LastIcon][6] = { 0x7f, 0x3e, 0x1c, 0x08, 0x00, 0x00 }, }; +static unsigned char bitmap_icon_7x8[][7] = +{ + /* Power plug */ + {0x08,0x1c,0x1c,0x3e,0x3e,0x14,0x14}, + /* Speaker */ + {0x00,0x1c,0x1c,0x3e,0x7f,0x00,0x00}, + /* Speaker mute */ + {0x01,0x1e,0x1c,0x3e,0x7f,0x20,0x40}, + /* Play */ + {0x00,0x7f,0x7f,0x3e,0x1c,0x08,0x00}, + /* Stop */ + {0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f}, + /* Pause */ + {0x00,0x7f,0x7f,0x00,0x7f,0x7f,0x00}, + /* Fast forward */ + {0x7f,0x3e,0x1c,0x7f,0x3e,0x1c,0x08}, + /* Fast backward */ + {0x08,0x1c,0x3e,0x7f,0x1c,0x3e,0x7f}, + /* Record */ + {0x1c,0x3e,0x7f,0x7f,0x7f,0x3e,0x1c}, + /* Record pause */ + {0x1c,0x3e,0x7f,0x00,0x7f,0x3e,0x1c}, + /* Normal playmode */ + {0x08,0x08,0x08,0x08,0x3e,0x1c,0x08}, + /* Repeat playmode */ + {0x38,0x44,0x44,0x4e,0x5f,0x44,0x38}, + /* Shuffle playmode (dice) */ + {0x3e,0x41,0x51,0x41,0x45,0x41,0x3e} +}; + unsigned char rockbox112x37[]={ 0x00, 0x00, 0x02, 0xff, 0x02, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xf8, 0xf8, 0xf0, 0xe0, 0x80, 0x00, 0x00, 0x80, 0xe0, 0xf0, 0xf8, 0xf8, 0xfc, @@ -111,4 +153,131 @@ unsigned char rockbox112x37[]={ }; +/* + * Wipe statusbar + */ +void statusbar_wipe(void) +{ + int x; + + for (x = 0; x < LCD_WIDTH; x++) + lcd_framebuffer[x][STATUSBAR_Y_POS/8]=0x00; +} + +/* + * Print battery icon to status bar + */ +void statusbar_icon_battery(int percent, bool charging) +{ + int i,j; + int fill; + + /* draw battery */ + for(i=0;i<17;i++) { + DRAW_PIXEL((ICON_BATTERY_X_POS+i),STATUSBAR_Y_POS); + DRAW_PIXEL((ICON_BATTERY_X_POS+i),(STATUSBAR_Y_POS+6)); + } + for(i=1;i<6;i++) { + DRAW_PIXEL(ICON_BATTERY_X_POS,(STATUSBAR_Y_POS+i)); + DRAW_PIXEL((ICON_BATTERY_X_POS+16),(STATUSBAR_Y_POS+i)); + } + for(i=2;i<5;i++) + DRAW_PIXEL((ICON_BATTERY_X_POS+17),(STATUSBAR_Y_POS+i)); + + /* fill battery */ + fill=percent; + if(fill<0) + fill=0; + if(fill>100) + fill=100; + fill=fill*15/100; + + for(i=1;i<=fill;i++) + for(j=1;j<6;j++) + DRAW_PIXEL((ICON_BATTERY_X_POS+i),(STATUSBAR_Y_POS+j)); + + if(charging) + lcd_bitmap(bitmap_icon_7x8[Icon_Plug], ICON_PLUG_X_POS, STATUSBAR_Y_POS, ICON_PLUG_WIDTH, STATUSBAR_HEIGHT, false); +}; + +/* + * Print volume gauge to status bar + */ +void statusbar_icon_volume(int percent) +{ + int i,j; + int volume; + int step=0; + + volume=percent; + if(volume<0) + volume=0; + if(volume>100) + volume=100; + + if(volume==0) + lcd_bitmap(bitmap_icon_7x8[Icon_Mute], ICON_VOLUME_X_POS+ICON_VOLUME_WIDTH/2-4, STATUSBAR_Y_POS, 7, STATUSBAR_HEIGHT, false); + else { + volume=volume*14/100; + for(i=0;i> 4, + hour & 0x0f, + (minute & 0xf0) >> 4, + minute & 0x0f); + lcd_putsxy(TIME_X_POS, STATUSBAR_Y_POS, buffer, 0); +} +#endif #endif -- cgit v1.2.3