From 3505278aa5d4766bb84a95ded6c10f7811e33ceb Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Thu, 13 Jun 2002 21:27:42 +0000 Subject: Cosmetic change to playlist loader progress display git-svn-id: svn://svn.rockbox.org/rockbox/trunk@988 a1c6a512-1295-4272-9138-f99709370657 --- apps/playlist.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/apps/playlist.c b/apps/playlist.c index 5a6ccb0532..e46a7faa9e 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -92,7 +92,7 @@ void play_list(char *dir, char *file) /* if shuffle is wanted, this is where to do that */ - lcd_puts(0,0,"Playing..."); + lcd_puts(0,0,"Complete. "); lcd_update(); /* also make the first song get playing */ mpeg_play(playlist_next(0)); @@ -119,6 +119,11 @@ void add_indices_to_playlist( playlist_info_t *playlist ) int i = 0; int store_index = 0; int count = 0; +#ifdef SIMULATOR + int next_tick = time(NULL); +#else + int next_tick = current_tick + HZ; +#endif unsigned char *p; unsigned char buf[512]; @@ -152,8 +157,14 @@ void add_indices_to_playlist( playlist_info_t *playlist ) } store_index = 0; - if ( playlist->amount % 200 == 0 ) { - snprintf(line, sizeof line, "%d", playlist->amount); +#ifdef SIMULATOR + if ( time(NULL) >= next_tick ) { + next_tick = time(NULL) + 1; +#else + if ( current_tick >= next_tick ) { + next_tick = current_tick + HZ; +#endif + snprintf(line, sizeof line, "%d files", playlist->amount); lcd_puts(0,1,line); lcd_update(); } @@ -162,7 +173,7 @@ void add_indices_to_playlist( playlist_info_t *playlist ) i+= count; } - snprintf(line, sizeof line, "%d", playlist->amount); + snprintf(line, sizeof line, "%d files", playlist->amount); lcd_puts(0,1,line); lcd_update(); -- cgit v1.2.3