From 767d604bcd839ef996aad8b9ab1e394aca26a95c Mon Sep 17 00:00:00 2001 From: Kjell Ericson Date: Thu, 23 Jan 2003 14:28:16 +0000 Subject: Removed unnecessary calls to lcd_stop_scroll(). Changed all lcd_scroll_pause() to lcd_stop_scroll(). Updated the tree system for new scroll-behaviour. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3154 a1c6a512-1295-4272-9138-f99709370657 --- apps/menu.c | 7 ++---- apps/recorder/recording.c | 2 -- apps/screens.c | 4 ---- apps/tree.c | 9 ++++++-- apps/wps-display.c | 55 ++++++++++++++++++++++------------------------- apps/wps.c | 4 ---- 6 files changed, 35 insertions(+), 46 deletions(-) (limited to 'apps') diff --git a/apps/menu.c b/apps/menu.c index b38821e9e9..9cedbebed8 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -134,7 +134,6 @@ static void menu_draw(int m) int menu_lines = MENU_LINES; #endif - lcd_scroll_pause(); /* halt scroll first... */ lcd_clear_display(); /* ...then clean the screen */ #ifdef HAVE_LCD_BITMAP lcd_setmargins(MARGIN_X,MARGIN_Y); /* leave room for cursor and icon */ @@ -289,14 +288,12 @@ bool menu_run(int m) #endif case BUTTON_PLAY: /* Erase current display state */ - lcd_scroll_pause(); /* pause is better than stop when - are gonna clear the screen anyway */ lcd_clear_display(); /* if a child returns that USB was used, we return immediately */ if (menus[m].items[menus[m].cursor].function()) { - lcd_scroll_pause(); /* just in case */ + lcd_stop_scroll(); /* just in case */ return true; } @@ -311,7 +308,7 @@ bool menu_run(int m) case BUTTON_STOP: case BUTTON_MENU: #endif - lcd_scroll_pause(); + lcd_stop_scroll(); exit = true; break; diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 15915d22f7..73b2773e44 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -458,7 +458,6 @@ bool f2_rec_screen(void) lcd_setfont(FONT_SYSFIXED); lcd_getstringsize("A",&w,&h); - lcd_stop_scroll(); while (!exit) { char* ptr=NULL; @@ -573,7 +572,6 @@ bool f3_rec_screen(void) lcd_setfont(FONT_SYSFIXED); lcd_getstringsize("A",&w,&h); - lcd_stop_scroll(); while (!exit) { char* ptr=NULL; diff --git a/apps/screens.c b/apps/screens.c index b4e23ccf57..71ab419261 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -72,7 +72,6 @@ static unsigned char usb_logo[] = { void usb_display_info(void) { - lcd_stop_scroll(); lcd_clear_display(); #ifdef HAVE_LCD_BITMAP @@ -132,7 +131,6 @@ int on_screen(void) char buf[32]; int w, h; - lcd_scroll_pause(); lcd_clear_display(); lcd_setfont(FONT_SYSFIXED); @@ -265,7 +263,6 @@ bool f2_screen(void) lcd_setfont(FONT_SYSFIXED); lcd_getstringsize("A",&w,&h); - lcd_stop_scroll(); while (!exit) { char* ptr=NULL; @@ -390,7 +387,6 @@ bool f3_screen(void) bool exit = false; bool used = false; - lcd_stop_scroll(); lcd_setfont(FONT_SYSFIXED); while (!exit) { diff --git a/apps/tree.c b/apps/tree.c index 0cb958447f..e732794d2a 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -636,7 +636,6 @@ static int onplay_screen(char* dir, char* file) else snprintf(buf, sizeof buf, "%s/%s", dir, file); - lcd_stop_scroll(); lcd_clear_display(); #ifdef HAVE_LCD_BITMAP { @@ -770,6 +769,8 @@ static int onplay_screen(char* dir, char* file) return false; } + + static bool handle_on(int* ds, int* dc, int numentries, int tree_max_on_screen) { bool exit = false; @@ -864,6 +865,7 @@ bool dirbrowse(char *root) bool reload_root = false; int lastfilter = global_settings.dirfilter; bool lastsortcase = global_settings.sort_case; + int lastdircursor=-1; #ifdef HAVE_LCD_BITMAP int fw, fh; lcd_getstringsize("A", &fw, &fh); @@ -1275,8 +1277,11 @@ bool dirbrowse(char *root) /* if MP3 filter is on, cut off the extension */ if(lasti!=i || restore) { - lasti=i; lcd_stop_scroll(); + if (lastdircursor!=-1) + lcd_puts(LINE_X, lastdircursor, dircache[lasti].name); + lasti=i; + lastdircursor=dircursor; if (global_settings.dirfilter == SHOW_MUSIC && (dircache[i].attr & (TREE_ATTR_M3U|TREE_ATTR_MPA))) { diff --git a/apps/wps-display.c b/apps/wps-display.c index 4ea2a0bed2..dfbc6d2cb6 100644 --- a/apps/wps-display.c +++ b/apps/wps-display.c @@ -670,29 +670,25 @@ bool wps_refresh(struct mp3entry* id3, int ffwd_offset, unsigned char refresh_mo (id3->elapsed + ff_rewind_count) * 100 / id3->length, Grow_Right); update_line = true; - } else if (flags & refresh_mode & WPS_REFRESH_PEAK_METER) { - /* peak meter */ - int peak_meter_y; - int offset = global_settings.statusbar ? STATUSBAR_HEIGHT : 0; - - update_line = true; - peak_meter_y = i * h + offset; - - /* The user might decide to have the peak meter in the last - line so that it is only displayed if no status bar is - visible. If so we neither want do draw nor enable the - peak meter. */ - if (peak_meter_y + h <= LCD_HEIGHT) { - /* found a line with a peak meter -> remember that we must - enable it later */ - enable_pm = true; - peak_meter_draw(0, peak_meter_y, LCD_WIDTH, - MIN(h, LCD_HEIGHT - peak_meter_y)); - } - } else if (flags & WPS_REFRESH_SCROLL) { - /* scroll line */ - if (refresh_mode & WPS_REFRESH_SCROLL) { - lcd_puts_scroll(0, i, buf); + } + if (flags & refresh_mode & WPS_REFRESH_PEAK_METER) { + /* peak meter */ + int peak_meter_y; + int offset = global_settings.statusbar ? STATUSBAR_HEIGHT : 0; + + update_line = true; + peak_meter_y = i * h + offset; + + /* The user might decide to have the peak meter in the last + line so that it is only displayed if no status bar is + visible. If so we neither want do draw nor enable the + peak meter. */ + if (peak_meter_y + h <= LCD_HEIGHT) { + /* found a line with a peak meter -> remember that we must + enable it later */ + enable_pm = true; + peak_meter_draw(0, peak_meter_y, LCD_WIDTH, + MIN(h, LCD_HEIGHT - peak_meter_y)); } } #else @@ -700,14 +696,14 @@ bool wps_refresh(struct mp3entry* id3, int ffwd_offset, unsigned char refresh_mo if (flags & refresh_mode & WPS_REFRESH_PLAYER_PROGRESS) { draw_player_progress(id3, ff_rewind_count); } +#endif if (flags & WPS_REFRESH_SCROLL) { - /* scroll line */ - if (refresh_mode & WPS_REFRESH_SCROLL) { - lcd_puts_scroll(0, i, buf); - } - flags=0; + /* scroll line */ + if (refresh_mode & WPS_REFRESH_SCROLL) { + lcd_puts_scroll(0, i, buf); + } + flags=0; } -#endif /* dynamic / static line */ if ((flags & refresh_mode & WPS_REFRESH_DYNAMIC) || @@ -767,6 +763,7 @@ bool wps_display(struct mp3entry* id3) } } } + yield(); wps_refresh(id3, 0, WPS_REFRESH_ALL); status_draw(); lcd_update(); diff --git a/apps/wps.c b/apps/wps.c index b297b3a89a..14ed88e8eb 100644 --- a/apps/wps.c +++ b/apps/wps.c @@ -110,7 +110,6 @@ void player_change_volume(int button) void display_keylock_text(bool locked) { - lcd_stop_scroll(); lcd_clear_display(); #ifdef HAVE_LCD_CHARCELLS @@ -131,7 +130,6 @@ void display_keylock_text(bool locked) void display_mute_text(bool muted) { - lcd_stop_scroll(); lcd_clear_display(); #ifdef HAVE_LCD_CHARCELLS @@ -158,7 +156,6 @@ static int browse_id3(void) bool exit = false; char scroll_text[MAX_PATH]; - lcd_stop_scroll(); lcd_clear_display(); lcd_puts(0, 0, str(LANG_ID3_INFO)); lcd_puts(0, 1, str(LANG_ID3_SCREEN)); @@ -167,7 +164,6 @@ static int browse_id3(void) while (!exit) { - lcd_stop_scroll(); lcd_clear_display(); switch (menu_pos) -- cgit v1.2.3