diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-08-08 18:44:28 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-08-08 18:44:28 +0000 |
| commit | 784841ed5063005e9029246075546102f4e71f47 (patch) | |
| tree | 1cd5d7ca0d4c45e86dde25b0befa48f02009f5fe /src/plugins/Input/mpc/decodermpcfactory.cpp | |
| parent | b4acea47086ea5c6b7853c462b33e204e1ee5510 (diff) | |
| download | qmmp-784841ed5063005e9029246075546102f4e71f47.tar.gz qmmp-784841ed5063005e9029246075546102f4e71f47.tar.bz2 qmmp-784841ed5063005e9029246075546102f4e71f47.zip | |
mpc plugin: added composer tag support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1127 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/mpc/decodermpcfactory.cpp')
| -rw-r--r-- | src/plugins/Input/mpc/decodermpcfactory.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/Input/mpc/decodermpcfactory.cpp b/src/plugins/Input/mpc/decodermpcfactory.cpp index a5d8efb5b..323637c8b 100644 --- a/src/plugins/Input/mpc/decodermpcfactory.cpp +++ b/src/plugins/Input/mpc/decodermpcfactory.cpp @@ -21,6 +21,8 @@ #include <QtGui> #include <taglib/tag.h> #include <taglib/fileref.h> +#include <taglib/mpcfile.h> +#include <taglib/apetag.h> #include "detailsdialog.h" #include "decoder_mpc.h" @@ -63,8 +65,8 @@ QList<FileInfo *> DecoderMPCFactory::createPlayList(const QString &fileName, boo { FileInfo *info = new FileInfo(fileName); - TagLib::FileRef fileRef(fileName.toLocal8Bit ()); - TagLib::Tag *tag = useMetaData ? fileRef.tag() : 0; + TagLib::MPC::File fileRef(fileName.toLocal8Bit ()); + TagLib::APE::Tag *tag = useMetaData ? fileRef.APETag() : 0; if (tag && !tag->isEmpty()) { info->setMetaData(Qmmp::ALBUM, @@ -82,6 +84,14 @@ QList<FileInfo *> DecoderMPCFactory::createPlayList(const QString &fileName, boo } if (fileRef.audioProperties()) info->setLength(fileRef.audioProperties()->length()); + //additional metadata + if(tag) + { + TagLib::APE::Item fld; + if(!(fld = tag->itemListMap()["COMPOSER"]).isEmpty()) + info->setMetaData(Qmmp::COMPOSER, + QString::fromUtf8(fld.toString().toCString(TRUE)).trimmed()); + } QList <FileInfo*> list; list << info; |
