1
0
Fork 0
forked from len0rd/rockbox

Added filename scrolling

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@937 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2002-06-10 13:24:27 +00:00
parent 76caee8358
commit 42770ea88e

View file

@ -154,14 +154,7 @@ static int showdir(char *path, int start)
6, MARGIN_Y+(i-start)*LINE_HEIGTH, 6, 8, true); 6, MARGIN_Y+(i-start)*LINE_HEIGTH, 6, 8, true);
#endif #endif
if(len < TREE_MAX_LEN_DISPLAY)
lcd_puts(LINE_X, LINE_Y+i-start, dircacheptr[i]->name); lcd_puts(LINE_X, LINE_Y+i-start, dircacheptr[i]->name);
else {
char storage = dircacheptr[i]->name[TREE_MAX_LEN_DISPLAY];
dircacheptr[i]->name[TREE_MAX_LEN_DISPLAY]=0;
lcd_puts(LINE_X, LINE_Y+i-start, dircacheptr[i]->name);
dircacheptr[i]->name[TREE_MAX_LEN_DISPLAY]=storage;
}
} }
return filesindir; return filesindir;
@ -235,6 +228,8 @@ bool dirbrowse(char *root)
return -1; /* root is not a directory */ return -1; /* root is not a directory */
lcd_puts(0, dircursor, CURSOR_CHAR); lcd_puts(0, dircursor, CURSOR_CHAR);
lcd_puts_scroll(LINE_X, LINE_Y+dircursor,
dircacheptr[start+dircursor]->name);
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
lcd_update(); lcd_update();
#endif #endif
@ -298,8 +293,8 @@ bool dirbrowse(char *root)
dircursor=0; dircursor=0;
start=0; start=0;
} else { } else {
int len= int len=strlen(dircacheptr[dircursor+start]->name);
strlen(dircacheptr[dircursor+start]->name); lcd_stop_scroll();
if((len > 4) && if((len > 4) &&
!strcmp(&dircacheptr[dircursor+start]->name[len-4], !strcmp(&dircacheptr[dircursor+start]->name[len-4],
".m3u")) { ".m3u")) {
@ -369,6 +364,7 @@ bool dirbrowse(char *root)
#else #else
case BUTTON_MENU: case BUTTON_MENU:
#endif #endif
lcd_stop_scroll();
main_menu(); main_menu();
/* restore display */ /* restore display */
@ -384,6 +380,11 @@ bool dirbrowse(char *root)
break; break;
} }
lcd_stop_scroll();
lcd_puts_scroll(LINE_X, LINE_Y+dircursor,
dircacheptr[start+dircursor]->name);
lcd_update(); lcd_update();
} }