aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/mad
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2015-04-30 20:01:48 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2015-04-30 20:01:48 +0000
commit744da239bb6fa7a332da181ab0a65221c0de9978 (patch)
tree93d123fa5dde08bffb06c45ee0e700700d258f47 /src/plugins/Input/mad
parent5a0075ed95704f293829d9f7671bbc39e777b924 (diff)
downloadqmmp-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/Input/mad')
-rw-r--r--src/plugins/Input/mad/decodermadfactory.cpp7
-rw-r--r--src/plugins/Input/mad/mpegmetadatamodel.cpp11
2 files changed, 16 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