diff options
| author | Björn Stenberg <bjorn@haxx.se> | 2002-06-13 15:16:41 +0000 |
|---|---|---|
| committer | Björn Stenberg <bjorn@haxx.se> | 2002-06-13 15:16:41 +0000 |
| commit | 4f00450f7665ea7912050aa172dbf794848819b6 (patch) | |
| tree | 05ce13711246de993cfe5b4a17c5bb8e0149a138 | |
| parent | aa26b5cbe3642a747da2c1c1583d69299299805d (diff) | |
| download | rockbox-4f00450f7665ea7912050aa172dbf794848819b6.zip rockbox-4f00450f7665ea7912050aa172dbf794848819b6.tar.gz rockbox-4f00450f7665ea7912050aa172dbf794848819b6.tar.bz2 rockbox-4f00450f7665ea7912050aa172dbf794848819b6.tar.xz | |
Loading playlists using 512 byte buffer. Added feedback display during load.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@987 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/playlist.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 3399641..5a6ccb0 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -27,6 +27,8 @@ #include "sprintf.h" #include "debug.h" #include "mpeg.h" +#include "lcd.h" +#include "kernel.h" playlist_info_t playlist; @@ -70,6 +72,10 @@ char* playlist_next(int type) void play_list(char *dir, char *file) { char *sep=""; + + lcd_clear_display(); + lcd_puts(0,0,"Loading..."); + lcd_update(); empty_playlist(&playlist); /* If the dir does not end in trailing new line, we use a separator. @@ -86,9 +92,11 @@ void play_list(char *dir, char *file) /* if shuffle is wanted, this is where to do that */ + lcd_puts(0,0,"Playing..."); + lcd_update(); /* also make the first song get playing */ mpeg_play(playlist_next(0)); - + sleep(HZ); } /* @@ -113,8 +121,8 @@ void add_indices_to_playlist( playlist_info_t *playlist ) int count = 0; unsigned char *p; - unsigned char buf[255]; - + unsigned char buf[512]; + char line[16]; fd = open(playlist->filename, O_RDONLY); if(-1 == fd) @@ -144,12 +152,19 @@ void add_indices_to_playlist( playlist_info_t *playlist ) } store_index = 0; + if ( playlist->amount % 200 == 0 ) { + snprintf(line, sizeof line, "%d", playlist->amount); + lcd_puts(0,1,line); + lcd_update(); + } } } i+= count; } - + snprintf(line, sizeof line, "%d", playlist->amount); + lcd_puts(0,1,line); + lcd_update(); close(fd); } |