From 4f00450f7665ea7912050aa172dbf794848819b6 Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Thu, 13 Jun 2002 15:16:41 +0000 Subject: 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 --- apps/playlist.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/apps/playlist.c b/apps/playlist.c index 339964182b..5a6ccb0532 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); } -- cgit v1.2.3