diff options
author | Björn Stenberg <bjorn@haxx.se> | 2003-06-04 15:09:35 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2003-06-04 15:09:35 +0000 |
commit | 8498a48496579aecc1645604f49d931d4f35ff7f (patch) | |
tree | 6caebfc5fe29e6c155d236cab5ceff17e1a05bf6 /apps | |
parent | 7bc69aa084fe3d0577303fbf6cf1569a19cde390 (diff) |
Generalized id3v2 parsing code. Added support for the composer frame and free-form genre and tracknum frames. (Patch #706111 by Thomas Paul Diffenbach)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3727 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/wps-display.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/apps/wps-display.c b/apps/wps-display.c index cc8009ec5c..71ba4c5433 100644 --- a/apps/wps-display.c +++ b/apps/wps-display.c @@ -285,34 +285,38 @@ static char* get_tag(struct mp3entry* id3, return id3->artist; case 'n': /* ID3 Track Number */ - if (id3->tracknum) - { + if (id3->track_string) + return id3->track_string; + + if (id3->tracknum) { snprintf(buf, buf_size, "%d", id3->tracknum); return buf; } - else - { - return NULL; - } - + return NULL; + case 'd': /* ID3 Album/Disc */ return id3->album; + case 'c': /* ID3 Composer */ + return id3->composer; + case 'y': /* year */ + if( id3->year_string ) + return id3->year_string; + if (id3->year) { snprintf(buf, buf_size, "%d", id3->year); return buf; } - else - return NULL; - break; + return NULL; case 'g': /* genre */ + if( id3->genre_string ) + return id3->genre_string ; + if (id3->genre < sizeof(genres)/sizeof(char*)) return (char*)genres[id3->genre]; - else - return NULL; - break; + return NULL; case 'v': /* id3 version */ switch (id3->id3version) { |