From 70a203341f6f6c691e9c4abecbe7096d29995807 Mon Sep 17 00:00:00 2001 From: Justin Heiner Date: Thu, 22 Aug 2002 04:03:57 +0000 Subject: [PATCH] Added conditional Title-Artist to appease PsycoXul :-) It's bound to %h git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1913 a1c6a512-1295-4272-9138-f99709370657 --- apps/wps.c | 9 +++++++++ docs/CUSTOM_WPS_FORMAT | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/apps/wps.c b/apps/wps.c index f601865bcd..c4b027cbc3 100644 --- a/apps/wps.c +++ b/apps/wps.c @@ -282,6 +282,15 @@ int wps_load_custom_config(void) snprintf(tmpbuf, sizeof(tmpbuf), "%s", szLast?++szLast:id3->path); break; + case 'h': /* Conditional Filename \ ID3 Title-Artist */ + if(id3->artist && id3->title) + snprintf(tmpbuf, sizeof(tmpbuf), "%s - %s", + id3->title?id3->title:""); + id3->artist?id3->artist:"", + else + snprintf(tmpbuf, sizeof(tmpbuf), "%s", + szLast?++szLast:id3->path); + break; case 'b': /* File Bitrate */ snprintf(tmpbuf, sizeof(tmpbuf), "%d", id3->bitrate); break; diff --git a/docs/CUSTOM_WPS_FORMAT b/docs/CUSTOM_WPS_FORMAT index 16549f389c..d9461f969e 100644 --- a/docs/CUSTOM_WPS_FORMAT +++ b/docs/CUSTOM_WPS_FORMAT @@ -24,6 +24,9 @@ Tags %c : Conditional Title/Filename Displays "Artist - Title" *or* Displays Filename if no ID3 Artist/Title +%h : Conditional Title/Filename + Displays "Title - Artist" *or* + Displays Filename if no ID3 Artist/Title %b : File Bitrate %f : File Frequency %p : File Path @@ -33,6 +36,7 @@ Tags %l : Playlist Total Entries %e : Elapsed Track Time %o : Total Track Time +%% : Displays a % Example wps.config File -----------------------