From c0ea4a7d1d6931b6ff034b5dae99add400b97eee Mon Sep 17 00:00:00 2001 From: Justin Heiner Date: Mon, 19 Aug 2002 08:11:23 +0000 Subject: 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 --- apps/wps.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'apps/wps.c') 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:"", - id3->title?id3->title:""); - + if(id3->artist && id3->title) + { + snprintf(buffer, sizeof(buffer), "%d/%d: %s - %s", + id3->index + 1, + playlist.amount, + id3->artist?id3->artist:"", + id3->title?id3->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; } -- cgit v1.2.3