diff options
author | Justin Heiner <jheiner@rockbox.org> | 2002-08-19 08:11:23 +0000 |
---|---|---|
committer | Justin Heiner <jheiner@rockbox.org> | 2002-08-19 08:11:23 +0000 |
commit | c0ea4a7d1d6931b6ff034b5dae99add400b97eee (patch) | |
tree | 230eac6a046ab3419a1e70ac7b0a2fbd2eb5a590 /apps/wps.c | |
parent | 8c789753008408f05983b33c6df836cce842f40b (diff) |
Added Smart(tm) ID3 displaying to the new 1 Line ID3. If no ID3 is available, it will display the filename instead
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1796 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/wps.c')
-rw-r--r-- | apps/wps.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/apps/wps.c b/apps/wps.c index d2c3676d6f..e2c091fa81 100644 --- a/apps/wps.c +++ b/apps/wps.c @@ -191,13 +191,24 @@ static void draw_screen(struct mp3entry* id3) case PLAY_DISPLAY_1LINEID3: { char buffer[64]; + char ch = '/'; + char* szLast = strrchr(id3->path, ch); - snprintf(buffer, sizeof(buffer), "%d/%d: %s - %s", - id3->index + 1, - playlist.amount, - id3->artist?id3->artist:"<no artist>", - id3->title?id3->title:"<no title>"); - + if(id3->artist && id3->title) + { + snprintf(buffer, sizeof(buffer), "%d/%d: %s - %s", + id3->index + 1, + playlist.amount, + id3->artist?id3->artist:"<no artist>", + id3->title?id3->title:"<no title>"); + } + else + { + snprintf(buffer, sizeof(buffer), "%d/%d: %s", + id3->index + 1, + playlist.amount, + szLast?++szLast:id3->path); + } lcd_puts_scroll(0, 0, buffer); break; } |