diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-04-30 20:01:48 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-04-30 20:01:48 +0000 |
| commit | 744da239bb6fa7a332da181ab0a65221c0de9978 (patch) | |
| tree | 93d123fa5dde08bffb06c45ee0e700700d258f47 /src/plugins | |
| parent | 5a0075ed95704f293829d9f7671bbc39e777b924 (diff) | |
| download | qmmp-744da239bb6fa7a332da181ab0a65221c0de9978.tar.gz qmmp-744da239bb6fa7a332da181ab0a65221c0de9978.tar.bz2 qmmp-744da239bb6fa7a332da181ab0a65221c0de9978.zip | |
improved album artist tag support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4884 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins')
| -rw-r--r-- | src/plugins/Input/mad/decodermadfactory.cpp | 7 | ||||
| -rw-r--r-- | src/plugins/Input/mad/mpegmetadatamodel.cpp | 11 | ||||
| -rw-r--r-- | src/plugins/Input/mpc/decodermpcfactory.cpp | 3 |
3 files changed, 19 insertions, 2 deletions
diff --git a/src/plugins/Input/mad/decodermadfactory.cpp b/src/plugins/Input/mad/decodermadfactory.cpp index 265ced841..a55627b60 100644 --- a/src/plugins/Input/mad/decodermadfactory.cpp +++ b/src/plugins/Input/mad/decodermadfactory.cpp @@ -208,6 +208,13 @@ QList<FileInfo *> DecoderMADFactory::createPlayList(const QString &fileName, boo if(tag == fileRef.ID3v2Tag()) { + if(!fileRef.ID3v2Tag()->frameListMap()["TPE2"].isEmpty()) + { + TagLib::String albumArtist; + albumArtist = fileRef.ID3v2Tag()->frameListMap()["TPE2"].front()->toString(); + info->setMetaData(Qmmp::ALBUMARTIST, + codec->toUnicode(albumArtist.toCString(utf)).trimmed()); + } if(!fileRef.ID3v2Tag()->frameListMap()["TCOM"].isEmpty()) { TagLib::String composer; diff --git a/src/plugins/Input/mad/mpegmetadatamodel.cpp b/src/plugins/Input/mad/mpegmetadatamodel.cpp index 49defe84f..5d040f013 100644 --- a/src/plugins/Input/mad/mpegmetadatamodel.cpp +++ b/src/plugins/Input/mad/mpegmetadatamodel.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2014 by Ilya Kotov * + * Copyright (C) 2009-2015 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -206,6 +206,11 @@ const QString MpegFileTagModel::value(Qmmp::MetaData key) case Qmmp::ARTIST: str = m_tag->artist(); break; + case Qmmp::ALBUMARTIST: + if(m_tagType == TagLib::MPEG::File::ID3v2 + && !m_file->ID3v2Tag()->frameListMap()["TPE2"].isEmpty()) + str = m_file->ID3v2Tag()->frameListMap()["TPE2"].front()->toString(); + break; case Qmmp::ALBUM: str = m_tag->album(); break; @@ -265,7 +270,9 @@ void MpegFileTagModel::setValue(Qmmp::MetaData key, const QString &value) } //save additional tags TagLib::ByteVector id3v2_key; - if (key == Qmmp::COMPOSER) + if(key == Qmmp::ALBUMARTIST) + id3v2_key = "TPE2"; //album artist + else if (key == Qmmp::COMPOSER) id3v2_key = "TCOM"; //composer else if (key == Qmmp::DISCNUMBER) id3v2_key = "TPOS"; //disc number diff --git a/src/plugins/Input/mpc/decodermpcfactory.cpp b/src/plugins/Input/mpc/decodermpcfactory.cpp index cdbc4dcd4..663daa0b2 100644 --- a/src/plugins/Input/mpc/decodermpcfactory.cpp +++ b/src/plugins/Input/mpc/decodermpcfactory.cpp @@ -107,6 +107,9 @@ QList<FileInfo *> DecoderMPCFactory::createPlayList(const QString &fileName, boo if(tag) { TagLib::APE::Item fld; + if(!(fld = tag->itemListMap()["ALBUM ARTIST"]).isEmpty()) + info->setMetaData(Qmmp::ALBUMARTIST, + QString::fromUtf8(fld.toString().toCString(true)).trimmed()); if(!(fld = tag->itemListMap()["COMPOSER"]).isEmpty()) info->setMetaData(Qmmp::COMPOSER, QString::fromUtf8(fld.toString().toCString(true)).trimmed()); |
