diff -urN --exclude=CVS orig/firmware/drivers/lcd.c firmware/drivers/lcd.c --- orig/firmware/drivers/lcd.c 2002-08-02 15:12:43.000000000 +0200 +++ firmware/drivers/lcd.c 2002-08-03 15:03:18.000000000 +0200 @@ -23,9 +23,15 @@ #include "thread.h" #include #include +#ifndef SIMULATOR +#include "sprintf.h" +#endif #include "file.h" #include "debug.h" #include "system.h" +#ifdef HAVE_RTC +#include "rtc.h" +#endif /*** definitions ***/ @@ -1189,6 +1195,133 @@ DRAW_PIXEL((x+i),(y+pos+j)); } +static unsigned char lcd_icon_5x8[][5] = +{ + {0x1c,0x3f,0x7c,0x3f,0x1c} /* plug */ +}; + +static unsigned char lcd_icon_7x8[][7] = +{ + {0x00,0x1c,0x1c,0x3e,0x7f,0x00,0x00}, /* speaker */ + {0x01,0x1e,0x1c,0x3e,0x7f,0x20,0x40}, /* speaker mute */ + {0x00,0x7f,0x7f,0x3e,0x1c,0x08,0x00}, /* play */ + {0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f}, /* stop */ + {0x00,0x7f,0x7f,0x00,0x7f,0x7f,0x00}, /* pause */ + {0x7f,0x3e,0x1c,0x7f,0x3e,0x1c,0x08}, /* fast forward */ + {0x08,0x1c,0x3e,0x7f,0x1c,0x3e,0x7f}, /* fast backward */ + {0x1c,0x3e,0x7f,0x7f,0x7f,0x3e,0x1c}, /* record */ + {0x1c,0x3e,0x7f,0x00,0x7f,0x3e,0x1c} /* record pause */ +}; + +/* Wipe statusbar */ +void lcd_clear_statusbar(void) +{ + int x; + + for (x = 0; x < LCD_WIDTH; x++) + display[x][0]=0x00; +} + +/* Update statusbar */ +#ifndef SIMULATOR +void lcd_update_statusbar(void) +{ + int x; + + /* Copy display bitmap to hardware */ + lcd_write (true, LCD_CNTL_PAGE); + lcd_write (true, LCD_CNTL_HIGHCOL); + lcd_write (true, LCD_CNTL_LOWCOL); + + for (x = 0; x < LCD_WIDTH; x++) + lcd_write (false, display[x][0]); +} +#endif + +void lcd_icon_battery(int percent) +{ + int i,j; + int fill; + + /* draw battery */ + for(i=0;i<12;i++) { + DRAW_PIXEL((LCD_ICON_BATTERY_POS+i),0); + DRAW_PIXEL((LCD_ICON_BATTERY_POS+i),6); + } + for(i=1;i<6;i++) { + DRAW_PIXEL(LCD_ICON_BATTERY_POS,i); + DRAW_PIXEL((LCD_ICON_BATTERY_POS+11),i); + } + for(i=2;i<5;i++) + DRAW_PIXEL((LCD_ICON_BATTERY_POS+12),i); + + /* fill battery */ + fill=percent; + if(fill<0) + fill=0; + if(fill>100) + fill=100; + fill/=10; + + for(i=1;i<=fill;i++) + for(j=1;j<6;j++) + DRAW_PIXEL((LCD_ICON_BATTERY_POS+i),j); +}; + +void lcd_icon_plug(void) +{ + + lcd_bitmap(lcd_icon_5x8[0], LCD_ICON_PLUG_POS, 0, 5, 8, false); +} + +void lcd_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(lcd_icon_7x8[BMP_ICON_MUTE], LCD_ICON_VOLUME_POS, 0, 7, 8, false); + else { + lcd_bitmap(lcd_icon_7x8[BMP_ICON_SPEAKER], LCD_ICON_VOLUME_POS, 0, 7, 8, false); + volume=volume*35/100; + for(i=0;i> 4, + hour & 0x0f, + (minute & 0xf0) >> 4, + minute & 0x0f); + lcd_putsxy(LCD_TIME_POS, 0, buffer, 0); +} +#endif #else /* no LCD defined, no code to use */ #endif diff -urN --exclude=CVS orig/firmware/drivers/lcd.h firmware/drivers/lcd.h --- orig/firmware/drivers/lcd.h 2002-08-02 15:12:43.000000000 +0200 +++ firmware/drivers/lcd.h 2002-08-03 15:15:34.000000000 +0200 @@ -74,6 +74,18 @@ #define LCD_WIDTH 112 /* Display width in pixels */ #define LCD_HEIGHT 64 /* Display height in pixels */ +#define LCD_STATUSBAR_HEIGHT 8 +#define LCD_STATUSBAR_WIDTH LCD_WIDTH +#define LCD_ICON_BATTERY_POS 0 +#define LCD_ICON_BATTERY_WIDTH 13 +#define LCD_ICON_PLUG_POS LCD_ICON_BATTERY_WIDTH+2 +#define LCD_ICON_PLUG_WIDTH 5 +#define LCD_ICON_VOLUME_POS LCD_ICON_BATTERY_WIDTH+LCD_ICON_PLUG_WIDTH+2+2 +#define LCD_ICON_VOLUME_WIDTH 43 +#define LCD_MODE_POS LCD_ICON_BATTERY_WIDTH+LCD_ICON_PLUG_WIDTH+LCD_ICON_VOLUME_WIDTH+2+2+2 +#define LCD_MODE_WIDTH 7 +#define LCD_TIME_POS LCD_ICON_BATTERY_WIDTH+LCD_ICON_PLUG_WIDTH+LCD_ICON_VOLUME_WIDTH+LCD_MODE_WIDTH+2+2+2+7 + /* Directions for progressbar and scrollbar */ enum { @@ -83,6 +95,20 @@ BAR_UP }; +/* Symbolic names for icons */ +enum +{ + BMP_ICON_SPEAKER = 0, + BMP_ICON_MUTE, + BMP_ICON_PLAY, + BMP_ICON_STOP, + BMP_ICON_PAUSE, + BMP_ICON_FASTFORWARD, + BMP_ICON_FASTBACKWARD, + BMP_ICON_RECORD, + BMP_ICON_RECPAUSE +}; + extern void lcd_putsxy(int x, int y, unsigned char *string, int font); extern void lcd_setfont(int font); extern void lcd_getfontsize(unsigned int font, int *width, int *height); @@ -99,6 +125,17 @@ extern void lcd_clearpixel(int x, int y); extern void lcd_progressbar(int x, int y, int width, int height, int percent, int direction); extern void lcd_slidebar(int x, int y, int width, int height, int percent, int direction); +extern void lcd_clear_statusbar(void); +#ifndef SIMULATOR +extern void lcd_update_statusbar(void); +#endif +extern void lcd_icon_battery(int percent); +extern void lcd_icon_plug(void); +extern void lcd_icon_volume(int percent); +extern void lcd_icon_mode(int mode); +#ifdef HAVE_RTC +extern void lcd_time(void); +#endif #endif /* CHARCELLS / BITMAP */ diff -urN --exclude=CVS orig/firmware/drivers/rtc.c firmware/drivers/rtc.c --- orig/firmware/drivers/rtc.c 2002-08-02 15:12:43.000000000 +0200 +++ firmware/drivers/rtc.c 2002-08-03 15:04:01.000000000 +0200 @@ -25,6 +25,14 @@ #define RTC_DEV_WRITE (RTC_ADR | 0x00) #define RTC_DEV_READ (RTC_ADR | 0x01) +void rtc_init(void) +{ + unsigned char data; + data = (unsigned int)rtc_read(0x0c); + data &= 0xbf; + rtc_write(0x0c,data); +} + int rtc_write(unsigned char address, unsigned char value) { int ret = 0; diff -urN --exclude=CVS orig/firmware/drivers/rtc.h firmware/drivers/rtc.h --- orig/firmware/drivers/rtc.h 2002-08-02 15:12:43.000000000 +0200 +++ firmware/drivers/rtc.h 2002-08-02 15:57:53.000000000 +0200 @@ -20,6 +20,7 @@ #define _RTC_H_ #ifdef HAVE_RTC +void rtc_init(void); int rtc_read(unsigned char address); int rtc_write(unsigned char address, unsigned char value); #endif diff -urN --exclude=CVS orig/apps/main.c apps/main.c --- orig/apps/main.c 2002-08-02 15:12:43.000000000 +0200 +++ apps/main.c 2002-08-03 15:07:02.000000000 +0200 @@ -97,7 +97,11 @@ set_irq_level(0); i2c_init(); - + +#ifdef HAVE_RTC + rtc_init(); +#endif + adc_init(); usb_init(); diff -urN --exclude=CVS orig/apps/playlist.c apps/playlist.c --- orig/apps/playlist.c 2002-08-02 17:02:54.000000000 +0200 +++ apps/playlist.c 2002-08-03 01:33:18.000000000 +0200 @@ -30,6 +30,13 @@ #include "lcd.h" #include "kernel.h" #include "settings.h" +#include "status.h" + +#ifdef HAVE_LCD_BITMAP +#define LINE_Y (global_settings.statusbar&&statusbar_enabled?1:0) /* Y position the entry-list starts at */ +#else /* HAVE_LCD_BITMAP */ +#define LINE_Y 0 /* Y position the entry-list starts at */ +#endif /* HAVE_LCD_BITMAP */ playlist_info_t playlist; @@ -120,7 +127,8 @@ char *sep=""; lcd_clear_display(); - lcd_puts(0,0,"Loading..."); + lcd_puts(0,LINE_Y,"Loading..."); + status_draw(); lcd_update(); empty_playlist(&playlist); @@ -137,12 +145,14 @@ add_indices_to_playlist(&playlist); if(global_settings.playlist_shuffle) { - lcd_puts(0,0,"Shuffling..."); + lcd_puts(0,LINE_Y,"Shuffling..."); + status_draw(); lcd_update(); randomise_playlist( &playlist, current_tick ); } - lcd_puts(0,0,"Playing... "); + lcd_puts(0,LINE_Y,"Playing... "); + status_draw(); lcd_update(); /* also make the first song get playing */ mpeg_play(playlist_next(0, dir)); @@ -214,7 +224,8 @@ if ( current_tick >= next_tick ) { next_tick = current_tick + HZ; snprintf(line, sizeof line, "%d files", playlist->amount); - lcd_puts(0,1,line); + lcd_puts(0,LINE_Y+1,line); + status_draw(); lcd_update(); } } @@ -223,7 +234,8 @@ i+= count; } snprintf(line, sizeof line, "%d files", playlist->amount); - lcd_puts(0,1,line); + lcd_puts(0,LINE_Y+1,line); + status_draw(); lcd_update(); close(fd); diff -urN --exclude=CVS orig/apps/settings.c apps/settings.c --- orig/apps/settings.c 2002-08-02 15:12:43.000000000 +0200 +++ apps/settings.c 2002-08-03 13:59:29.000000000 +0200 @@ -273,6 +273,9 @@ rtc_config_block[0x11] = (unsigned char)global_settings.avc; + rtc_config_block[0x12] = (unsigned char) + ((global_settings.statusbar & 1)); + memcpy(&rtc_config_block[0x24], &global_settings.total_uptime, 4); if(save_config_buffer()) @@ -344,6 +347,10 @@ if (rtc_config_block[0x11] != 0xFF) global_settings.avc = rtc_config_block[0x11]; + + if (rtc_config_block[0x12] != 0xFF) { + global_settings.statusbar = rtc_config_block[0x12] & 1; + } if (rtc_config_block[0x24] != 0xFF) memcpy(&global_settings.total_uptime, &rtc_config_block[0x24], 4); @@ -372,6 +379,7 @@ global_settings.wps_display = DEFAULT_WPS_DISPLAY; global_settings.mp3filter = true; global_settings.sort_case = false; + global_settings.statusbar = true; global_settings.playlist_shuffle = false; global_settings.total_uptime = 0; global_settings.scroll_speed = 8; diff -urN --exclude=CVS orig/apps/settings.h apps/settings.h --- orig/apps/settings.h 2002-08-02 15:12:43.000000000 +0200 +++ apps/settings.h 2002-08-03 13:59:11.000000000 +0200 @@ -61,6 +61,9 @@ /* while playing screen settings */ int wps_display; /* 0=id3, 1=file, 2=parse */ + + /* show status bar */ + bool statusbar; /* 0=hide, 1=show */ /* geeky persistent statistics */ unsigned int total_uptime; /* total uptime since rockbox was first booted */ diff -urN --exclude=CVS orig/apps/settings_menu.c apps/settings_menu.c --- orig/apps/settings_menu.c 2002-08-02 17:02:54.000000000 +0200 +++ apps/settings_menu.c 2002-08-03 14:29:11.000000000 +0200 @@ -67,6 +67,13 @@ set_option("[WPS display]", &global_settings.wps_display, names, 3 ); } +#ifdef HAVE_LCD_BITMAP +static void statusbar(void) +{ + set_bool( "[Show status bar]", &global_settings.statusbar ); +} +#endif + void settings_menu(void) { int m; @@ -76,7 +83,10 @@ { "Sort mode", sort_case }, { "Backlight Timer", backlight_timer }, { "Scroll speed", scroll_speed }, - { "While Playing", wps_set }, + { "While Playing", wps_set }, +#ifdef HAVE_LCD_BITMAP + { "Status bar", statusbar }, +#endif }; bool old_shuffle = global_settings.playlist_shuffle; diff -urN --exclude=CVS orig/apps/status.c apps/status.c --- orig/apps/status.c 2002-08-02 15:12:43.000000000 +0200 +++ apps/status.c 2002-08-03 15:17:15.000000000 +0200 @@ -24,10 +24,23 @@ #include "settings.h" #include "status.h" #include "mpeg.h" +//#include "power.h" + static enum playmode current_mode; +#ifdef HAVE_LCD_BITMAP +bool statusbar_enabled = true; +static void statusbar_thread(void); +static char statusbar_stack[DEFAULT_STACK_SIZE]; +static char statusbar_name[] = "statusbar"; +#endif + void status_init(void) { +#ifdef HAVE_LCD_BITMAP + create_thread(statusbar_thread, statusbar_stack, + sizeof(statusbar_stack), statusbar_name); +#endif status_set_playmode(STATUS_STOP); } @@ -36,6 +49,22 @@ 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 +126,32 @@ 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) { + lcd_clear_statusbar(); + lcd_icon_battery(battlevel); + //if(charger_enabled) lcd_icon_plug(); + lcd_icon_volume(volume); + lcd_icon_mode(current_mode+2); +#ifdef HAVE_RTC + lcd_time(); +#endif +#ifndef SIMULATOR + lcd_update_statusbar(); +#endif + } +#endif +} + +#ifdef HAVE_LCD_BITMAP +void statusbar_thread(void) +{ + if(global_settings.statusbar && statusbar_enabled) { + status_draw(); + } + sleep(HZ); } +#endif diff -urN --exclude=CVS orig/apps/status.h apps/status.h --- orig/apps/status.h 2002-08-02 15:12:43.000000000 +0200 +++ apps/status.h 2002-08-03 01:34:11.000000000 +0200 @@ -23,11 +23,20 @@ { STATUS_PLAY, STATUS_STOP, - STATUS_PAUSE + STATUS_PAUSE, + STATUS_FASTFORWARD, + STATUS_FASTBACKWARD, + STATUS_RECORD, + STATUS_RECORD_PAUSE }; void status_init(void); void status_set_playmode(enum playmode mode); +#ifdef HAVE_LCD_BITMAP +extern bool statusbar_enabled; +bool statusbar(bool state); +void statusbar_toggle(void); +#endif void status_draw(void); #endif diff -urN --exclude=CVS orig/apps/tree.c apps/tree.c --- orig/apps/tree.c 2002-08-02 15:12:43.000000000 +0200 +++ apps/tree.c 2002-08-03 15:10:51.000000000 +0200 @@ -65,12 +65,12 @@ #ifdef HAVE_LCD_BITMAP -#define TREE_MAX_ON_SCREEN ((LCD_HEIGHT-MARGIN_Y)/LINE_HEIGTH) +#define TREE_MAX_ON_SCREEN ((LCD_HEIGHT-MARGIN_Y)/LINE_HEIGTH-LINE_Y) #define TREE_MAX_LEN_DISPLAY 16 /* max length that fits on screen */ #define MARGIN_Y 0 /* Y pixel margin */ #define MARGIN_X 12 /* X pixel margin */ -#define LINE_Y 0 /* Y position the entry-list starts at */ +#define LINE_Y (global_settings.statusbar&&statusbar_enabled?1:0) /* Y position the entry-list starts at */ #define LINE_X 2 /* X position the entry-list starts at */ #define LINE_HEIGTH 8 /* pixels for each text line */ @@ -210,7 +210,7 @@ icon_type = File; } lcd_bitmap(bitmap_icons_6x8[icon_type], - 6, MARGIN_Y+(i-start)*LINE_HEIGTH, 6, 8, true); + 6, MARGIN_Y+(LINE_Y+i-start)*LINE_HEIGTH, 6, 8, true); #endif /* if MP3 filter is on, cut off the extension */ @@ -297,7 +297,7 @@ if (numentries == -1) return -1; /* root is not a directory */ - put_cursorxy(0, CURSOR_Y + dircursor, true); + put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); while(1) { bool restore = false; @@ -482,8 +482,14 @@ case TREE_MENU: { bool lastfilter = global_settings.mp3filter; bool lastsortcase = global_settings.sort_case; +#ifdef HAVE_LCD_BITMAP + bool laststate=statusbar(false); +#endif lcd_stop_scroll(); main_menu(); +#ifdef HAVE_LCD_BITMAP + statusbar(laststate); +#endif /* do we need to rescan dir? */ if ( lastfilter != global_settings.mp3filter || lastsortcase != global_settings.sort_case) @@ -515,23 +521,46 @@ } break; +#ifdef HAVE_RECORDER_KEYPAD + case BUTTON_F3: +#endif +#ifdef HAVE_LCD_BITMAP + if(global_settings.statusbar) { + statusbar_toggle(); + if(CURSOR_Y+LINE_Y+dircursor>TREE_MAX_ON_SCREEN) { + start++; + dircursor--; + } + restore = true; + } +#endif + break; + #ifndef SIMULATOR case SYS_USB_CONNECTED: - /* Tell the USB thread that we are safe */ - DEBUGF("dirbrowse got SYS_USB_CONNECTED\n"); - usb_acknowledge(SYS_USB_CONNECTED_ACK); - - /* Wait until the USB cable is extracted again */ - usb_wait_for_disconnect(&button_queue); - - /* Force a re-read of the root directory */ - restore = true; - strcpy(currdir, "/"); - lastdir[0] = 0; - dirlevel = 0; - dircursor = 0; - start = 0; - play_mode = 0; + { +#ifdef HAVE_LCD_BITMAP + bool laststate=statusbar(false); +#endif + /* Tell the USB thread that we are safe */ + DEBUGF("dirbrowse got SYS_USB_CONNECTED\n"); + usb_acknowledge(SYS_USB_CONNECTED_ACK); + + /* Wait until the USB cable is extracted again */ + usb_wait_for_disconnect(&button_queue); + + /* Force a re-read of the root directory */ + restore = true; + strcpy(currdir, "/"); + lastdir[0] = 0; + dirlevel = 0; + dircursor = 0; + start = 0; + play_mode = 0; +#ifdef HAVE_LCD_BITMAP + statusbar(laststate); +#endif + } break; #endif } diff -urN --exclude=CVS orig/apps/wps.c apps/wps.c --- orig/apps/wps.c 2002-08-02 15:12:43.000000000 +0200 +++ apps/wps.c 2002-08-03 15:12:34.000000000 +0200 @@ -35,11 +35,15 @@ #include "status.h" #include "main_menu.h" -#define LINE_Y 1 /* initial line */ - -#define PLAY_DISPLAY_DEFAULT 0 -#define PLAY_DISPLAY_FILENAME_SCROLL 1 -#define PLAY_DISPLAY_TRACK_TITLE 2 +#ifdef HAVE_LCD_BITMAP +#define LINE_Y (global_settings.statusbar&&statusbar_enabled?1:0) /* Y position the entry-list starts at */ +#else /* HAVE_LCD_BITMAP */ +#define LINE_Y 0 /* Y position the entry-list starts at */ +#endif /* HAVE_LCD_BITMAP */ + +#define PLAY_DISPLAY_DEFAULT 0 +#define PLAY_DISPLAY_FILENAME_SCROLL 1 +#define PLAY_DISPLAY_TRACK_TITLE 2 #ifdef HAVE_RECORDER_KEYPAD #define RELEASE_MASK (BUTTON_F1 | BUTTON_DOWN) @@ -99,14 +103,14 @@ char* szLast = strrchr(id3->path, ch); if (szLast) - lcd_puts_scroll(0,0, (++szLast)); + lcd_puts_scroll(0,LINE_Y, (++szLast)); else - lcd_puts_scroll(0,0, id3->path); + lcd_puts_scroll(0,LINE_Y, id3->path); break; } case PLAY_DISPLAY_DEFAULT: { - int l = 0; + int l = LINE_Y; #ifdef HAVE_LCD_BITMAP char buffer[64]; @@ -115,16 +119,28 @@ lcd_puts(0, l++, id3->album?id3->album:""); lcd_puts(0, l++, id3->artist?id3->artist:""); - if(id3->vbr) - snprintf(buffer, sizeof(buffer), "%d kbit (avg)", - id3->bitrate); - else - snprintf(buffer, sizeof(buffer), "%d kbit", id3->bitrate); + if(LINE_Y==0) { + if(id3->vbr) + snprintf(buffer, sizeof(buffer), "%d kbit (avg)", + id3->bitrate); + else + snprintf(buffer, sizeof(buffer), "%d kbit", id3->bitrate); - lcd_puts(0, l++, buffer); + lcd_puts(0, l++, buffer); - snprintf(buffer,sizeof(buffer), "%d Hz", id3->frequency); - lcd_puts(0, l++, buffer); + snprintf(buffer,sizeof(buffer), "%d Hz", id3->frequency); + lcd_puts(0, l++, buffer); + } + else { + if(id3->vbr) + snprintf(buffer, sizeof(buffer), "%dkbit(a) %dHz", + id3->bitrate, id3->frequency); + else + snprintf(buffer, sizeof(buffer), "%dkbit %dHz", + id3->bitrate, id3->frequency); + + lcd_puts(0, l++, buffer); + } #else lcd_puts(0, l++, id3->artist?id3->artist:""); @@ -195,7 +211,7 @@ if (mpeg_is_playing() && id3) { #ifdef HAVE_LCD_BITMAP - snprintf(buffer,sizeof(buffer), "Time: %d:%02d / %d:%02d", + snprintf(buffer,sizeof(buffer), "Time: %2d:%02d/%d:%02d", id3->elapsed / 60000, id3->elapsed % 60000 / 1000, id3->length / 60000, @@ -203,7 +219,7 @@ lcd_puts(0, 6, buffer); - lcd_slidebar(1, LCD_HEIGHT-7, LCD_WIDTH-2, 5, + lcd_slidebar(1, LCD_HEIGHT-6, LCD_WIDTH-2, 6, id3->elapsed*100/id3->length, BAR_RIGHT); @@ -213,7 +229,7 @@ the screen has room. */ if (global_settings.wps_display == PLAY_DISPLAY_FILENAME_SCROLL) { - snprintf(buffer,sizeof(buffer), "Time: %d:%02d / %d:%02d", + snprintf(buffer,sizeof(buffer), "Time: %2d:%02d/%d:%02d", id3->elapsed / 60000, id3->elapsed % 60000 / 1000, id3->length / 60000, @@ -226,12 +242,6 @@ } status_draw(); - -#ifdef HAVE_LCD_BITMAP - /* draw battery indicator line */ - lcd_clearline(0,LCD_HEIGHT-1,LCD_WIDTH-1, LCD_HEIGHT-1); - lcd_drawline(0,LCD_HEIGHT-1,battery_level() * (LCD_WIDTH-1) / 100, LCD_HEIGHT-1); -#endif for ( i=0;i<5;i++ ) { int button = button_get(false); @@ -407,9 +417,15 @@ #endif if(!keys_locked && !dont_go_to_menu && menu_button_is_down) { +#ifdef HAVE_LCD_BITMAP + bool laststate=statusbar(false); +#endif lcd_stop_scroll(); button_set_release(old_release_mask); main_menu(); +#ifdef HAVE_LCD_BITMAP + statusbar(laststate); +#endif old_release_mask = button_set_release(RELEASE_MASK); id3 = mpeg_current_track(); draw_screen(id3); @@ -422,6 +438,17 @@ break; #ifdef HAVE_RECORDER_KEYPAD + case BUTTON_F3: +#endif +#ifdef HAVE_LCD_BITMAP + if(global_settings.statusbar) { + statusbar_toggle(); + draw_screen(id3); + } +#endif + break; + +#ifdef HAVE_RECORDER_KEYPAD case BUTTON_OFF: #else case BUTTON_STOP: @@ -440,15 +467,23 @@ #ifndef SIMULATOR case SYS_USB_CONNECTED: - /* Tell the USB thread that we are safe */ - DEBUGF("wps got SYS_USB_CONNECTED\n"); - usb_acknowledge(SYS_USB_CONNECTED_ACK); - - /* Wait until the USB cable is extracted again */ - usb_wait_for_disconnect(&button_queue); + { +#ifdef HAVE_LCD_BITMAP + bool laststate=statusbar(false); +#endif + /* Tell the USB thread that we are safe */ + DEBUGF("wps got SYS_USB_CONNECTED\n"); + usb_acknowledge(SYS_USB_CONNECTED_ACK); + + /* Wait until the USB cable is extracted again */ + usb_wait_for_disconnect(&button_queue); - /* Signal to our caller that we have been in USB mode */ - return SYS_USB_CONNECTED; +#ifdef HAVE_LCD_BITMAP + statusbar(laststate); +#endif + /* Signal to our caller that we have been in USB mode */ + return SYS_USB_CONNECTED; + } break; #endif }