summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-06-27 16:31:51 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-06-27 16:31:51 +0000
commit86487815beb5f6df65e598a1eb79b5fe1d060714 (patch)
tree56166f597f0fee02705ac597cbfa4d1b046e8ba1
parent6a6f6364a4c0234e8c37ead72a5ba57c263b456e (diff)
downloadrockbox-86487815beb5f6df65e598a1eb79b5fe1d060714.zip
rockbox-86487815beb5f6df65e598a1eb79b5fe1d060714.tar.gz
rockbox-86487815beb5f6df65e598a1eb79b5fe1d060714.tar.bz2
rockbox-86487815beb5f6df65e598a1eb79b5fe1d060714.tar.xz
Added more id3 update checks. Added %02d format to time string. Added title scrolling for player.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1235 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/wps.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/wps.c b/apps/wps.c
index 5ea0c12..8a20adf 100644
--- a/apps/wps.c
+++ b/apps/wps.c
@@ -95,7 +95,7 @@ static void draw_screen(struct mp3entry* id3)
lcd_puts(0, l++, id3->album?id3->album:"");
lcd_puts(0, l++, id3->artist?id3->artist:"");
- snprintf(buffer,sizeof(buffer), "Time: %d:%d",
+ snprintf(buffer,sizeof(buffer), "Time: %d:%02d",
id3->length / 60000,
id3->length % 60000 / 1000 );
lcd_puts(0, l++, buffer);
@@ -123,17 +123,25 @@ void wps_show(void)
static bool playing = true;
struct mp3entry* id3 = mpeg_current_track();
int lastlength=0, lastsize=0, lastrate=0;
+ int lastartist=0, lastalbum=0, lasttitle=0;
while ( 1 ) {
int i;
if ( ( id3->length != lastlength ) ||
( id3->filesize != lastsize ) ||
- ( id3->bitrate != lastrate ) ) {
+ ( id3->bitrate != lastrate ) ||
+ ( id3->artist[0] != lastartist ) ||
+ ( id3->album[0] != lastalbum ) ||
+ ( id3->title[0] != lasttitle ) )
+ {
draw_screen(id3);
lastlength = id3->length;
lastsize = id3->filesize;
lastrate = id3->bitrate;
+ lastartist = id3->artist[0];
+ lastalbum = id3->album[0];
+ lasttitle = id3->title[0];
}
for ( i=0;i<20;i++ ) {