aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2014-09-22 17:16:26 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2014-09-22 17:16:26 +0000
commitb66a8c518cbaa660ca3b9d18a1d071b144e5a2ab (patch)
tree45c7f5c5f45f54636b60449b137aaee79fb1f8a9 /src
parent9f312260e06b7d3bc0a017e0dda4836d02f925e4 (diff)
downloadqmmp-b66a8c518cbaa660ca3b9d18a1d071b144e5a2ab.tar.gz
qmmp-b66a8c518cbaa660ca3b9d18a1d071b144e5a2ab.tar.bz2
qmmp-b66a8c518cbaa660ca3b9d18a1d071b144e5a2ab.zip
added 'album artist' field support (patch by Dmitry Misharov)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4509 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
-rw-r--r--src/plugins/CommandLineOptions/StatusOption/statusoption.cpp1
-rw-r--r--src/plugins/General/mpris/mpris1/playerobject.cpp1
-rw-r--r--src/plugins/General/mpris/mpris1/tracklistobject.cpp1
-rw-r--r--src/plugins/General/mpris/mpris2/player2object.cpp2
-rw-r--r--src/plugins/Input/flac/decoderflacfactory.cpp3
-rw-r--r--src/plugins/Input/flac/flacmetadatamodel.cpp10
-rw-r--r--src/plugins/Ui/skinned/playlist.cpp8
-rw-r--r--src/qmmp/qmmp.h1
-rw-r--r--src/qmmp/tagmodel.cpp1
-rw-r--r--src/qmmpui/detailsdialog.cpp1
-rw-r--r--src/qmmpui/forms/tageditor.ui170
-rw-r--r--src/qmmpui/mediaplayer.cpp3
-rw-r--r--src/qmmpui/metadataformatter.cpp1
-rw-r--r--src/qmmpui/playlistcontainer.cpp14
-rw-r--r--src/qmmpui/playlistmanager.cpp3
-rw-r--r--src/qmmpui/playlistmodel.h1
-rw-r--r--src/qmmpui/tageditor.cpp3
17 files changed, 143 insertions, 81 deletions
diff --git a/src/plugins/CommandLineOptions/StatusOption/statusoption.cpp b/src/plugins/CommandLineOptions/StatusOption/statusoption.cpp
index 99fef7adb..dc9ebc4b1 100644
--- a/src/plugins/CommandLineOptions/StatusOption/statusoption.cpp
+++ b/src/plugins/CommandLineOptions/StatusOption/statusoption.cpp
@@ -63,6 +63,7 @@ QString StatusOption::executeCommand(const QString &opt_str, const QStringList &
out += " ";
out += genProgressBar() + "\n";
out += "ARTIST = %p\n";
+ out += "ALBUMARTIST = %p\n";
out += "TITLE = %t\n";
out += "ALBUM = %a\n";
out += "COMMENT = %c\n";
diff --git a/src/plugins/General/mpris/mpris1/playerobject.cpp b/src/plugins/General/mpris/mpris1/playerobject.cpp
index 27c9ca9fa..ed1b499c3 100644
--- a/src/plugins/General/mpris/mpris1/playerobject.cpp
+++ b/src/plugins/General/mpris/mpris1/playerobject.cpp
@@ -135,6 +135,7 @@ QVariantMap PlayerObject::GetMetadata()
map.insert("arturl", MetaDataManager::instance()->getCoverPath(m_core->metaData(Qmmp::URL)));
map.insert("title", m_core->metaData(Qmmp::TITLE));
map.insert("artist", m_core->metaData(Qmmp::ARTIST));
+ map.insert("albumartist", m_core->metaData(Qmmp::ALBUMARTIST));
map.insert("album", m_core->metaData(Qmmp::ALBUM));
map.insert("tracknumber", m_core->metaData(Qmmp::TRACK));
map.insert("time", (quint32)m_core->totalTime()/1000);
diff --git a/src/plugins/General/mpris/mpris1/tracklistobject.cpp b/src/plugins/General/mpris/mpris1/tracklistobject.cpp
index 13c40c929..23740ff81 100644
--- a/src/plugins/General/mpris/mpris1/tracklistobject.cpp
+++ b/src/plugins/General/mpris/mpris1/tracklistobject.cpp
@@ -106,6 +106,7 @@ QVariantMap TrackListObject::GetMetadata(int in0)
map.insert("location", "file://" + track->url());
map.insert("title", track->value(Qmmp::TITLE));
map.insert("artist", track->value(Qmmp::ARTIST));
+ map.insert("albumartist", track->value(Qmmp::ALBUMARTIST));
map.insert("album", track->value(Qmmp::ALBUM));
map.insert("tracknumber", track->value(Qmmp::TRACK));
map.insert("time", (quint32)track->length());
diff --git a/src/plugins/General/mpris/mpris2/player2object.cpp b/src/plugins/General/mpris/mpris2/player2object.cpp
index e7fedac5e..9bf7e539e 100644
--- a/src/plugins/General/mpris/mpris2/player2object.cpp
+++ b/src/plugins/General/mpris/mpris2/player2object.cpp
@@ -136,6 +136,8 @@ QVariantMap Player2Object::metadata() const
map["xesam:album"] = m_core->metaData(Qmmp::ALBUM);
if(!m_core->metaData(Qmmp::ARTIST).isEmpty())
map["xesam:artist"] = QStringList() << m_core->metaData(Qmmp::ARTIST);
+ if(!m_core->metaData(Qmmp::ALBUMARTIST).isEmpty())
+ map["xesam:albumArtist"] = QStringList() << m_core->metaData(Qmmp::ALBUMARTIST);
if(!m_core->metaData(Qmmp::COMMENT).isEmpty())
map["xesam:comment"] = QStringList() << m_core->metaData(Qmmp::COMMENT);
if(!m_core->metaData(Qmmp::COMPOSER).isEmpty())
diff --git a/src/plugins/Input/flac/decoderflacfactory.cpp b/src/plugins/Input/flac/decoderflacfactory.cpp
index d45a8164c..7e2600b7d 100644
--- a/src/plugins/Input/flac/decoderflacfactory.cpp
+++ b/src/plugins/Input/flac/decoderflacfactory.cpp
@@ -152,6 +152,9 @@ QList<FileInfo *> DecoderFLACFactory::createPlayList(const QString &fileName, bo
//additional metadata
TagLib::StringList fld;
+ if(!(fld = tag->fieldListMap()["ALBUMARTIST"]).isEmpty())
+ info->setMetaData(Qmmp::ALBUMARTIST,
+ QString::fromUtf8(fld.toString().toCString(true)).trimmed());
if(!(fld = tag->fieldListMap()["COMPOSER"]).isEmpty())
info->setMetaData(Qmmp::COMPOSER,
QString::fromUtf8(fld.toString().toCString(true)).trimmed());
diff --git a/src/plugins/Input/flac/flacmetadatamodel.cpp b/src/plugins/Input/flac/flacmetadatamodel.cpp
index 3c0738819..9b700383f 100644
--- a/src/plugins/Input/flac/flacmetadatamodel.cpp
+++ b/src/plugins/Input/flac/flacmetadatamodel.cpp
@@ -160,6 +160,11 @@ const QString VorbisCommentModel::value(Qmmp::MetaData key)
return TStringToQString_qt4(m_tag->title());
case Qmmp::ARTIST:
return TStringToQString_qt4(m_tag->artist());
+ case Qmmp::ALBUMARTIST:
+ if(m_tag->fieldListMap()["ALBUMARTIST"].isEmpty())
+ return QString();
+ else
+ return TStringToQString_qt4(m_tag->fieldListMap()["ALBUMARTIST"].front());
case Qmmp::ALBUM:
return TStringToQString_qt4(m_tag->album());
case Qmmp::COMMENT:
@@ -199,6 +204,11 @@ void VorbisCommentModel::setValue(Qmmp::MetaData key, const QString &value)
case Qmmp::ARTIST:
m_tag->setArtist(str);
return;
+ case Qmmp::ALBUMARTIST:
+ value.isEmpty() ?
+ m_tag->removeField("ALBUMARTIST"):
+ m_tag->addField("ALBUMARTIST", str, true);
+ return;
case Qmmp::ALBUM:
m_tag->setAlbum(str);
return;
diff --git a/src/plugins/Ui/skinned/playlist.cpp b/src/plugins/Ui/skinned/playlist.cpp
index 4846388a9..bc58312d0 100644
--- a/src/plugins/Ui/skinned/playlist.cpp
+++ b/src/plugins/Ui/skinned/playlist.cpp
@@ -225,6 +225,10 @@ void PlayList::createActions()
connect (artistAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map()));
signalMapper->setMapping (artistAct, PlayListModel::ARTIST);
+ QAction* albumArtistAct = sort_mode_menu->addAction (tr ("By Album Artist"));
+ connect (albumArtistAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map()));
+ signalMapper->setMapping (albumArtistAct, PlayListModel::ALBUMARTIST);
+
QAction* nameAct = sort_mode_menu->addAction (tr ("By Filename"));
connect (nameAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map()));
signalMapper->setMapping (nameAct, PlayListModel::FILENAME);
@@ -272,6 +276,10 @@ void PlayList::createActions()
connect (artistAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map()));
signalMapper->setMapping (artistAct, PlayListModel::ARTIST);
+ albumArtistAct = sort_mode_menu->addAction (tr ("By Album Artist"));
+ connect (albumArtistAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map()));
+ signalMapper->setMapping (albumArtistAct, PlayListModel::ALBUMARTIST);
+
nameAct = sort_mode_menu->addAction (tr ("By Filename"));
connect (nameAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map()));
signalMapper->setMapping (nameAct, PlayListModel::FILENAME);
diff --git a/src/qmmp/qmmp.h b/src/qmmp/qmmp.h
index ac6106e10..9424d1948 100644
--- a/src/qmmp/qmmp.h
+++ b/src/qmmp/qmmp.h
@@ -55,6 +55,7 @@ public:
{
TITLE = 0, /*!< Title */
ARTIST, /*!< Artist */
+ ALBUMARTIST,/*!< Album artist */
ALBUM, /*!< Album */
COMMENT, /*!< Comment */
GENRE, /*!< Genre */
diff --git a/src/qmmp/tagmodel.cpp b/src/qmmp/tagmodel.cpp
index 8f0cc6139..dbc27c3fa 100644
--- a/src/qmmp/tagmodel.cpp
+++ b/src/qmmp/tagmodel.cpp
@@ -38,6 +38,7 @@ QList<Qmmp::MetaData> TagModel::keys()
QList<Qmmp::MetaData> list;
list << Qmmp::TITLE;
list << Qmmp::ARTIST;
+ list << Qmmp::ALBUMARTIST;
list << Qmmp::ALBUM;
list << Qmmp::COMMENT;
list << Qmmp::GENRE;
diff --git a/src/qmmpui/detailsdialog.cpp b/src/qmmpui/detailsdialog.cpp
index 93e02be2f..243fc4b63 100644
--- a/src/qmmpui/detailsdialog.cpp
+++ b/src/qmmpui/detailsdialog.cpp
@@ -164,6 +164,7 @@ void DetailsDialog::printInfo()
//tags
formattedText += formatRow(tr("Title"), m_metaData[Qmmp::TITLE]);
formattedText += formatRow(tr("Artist"), m_metaData[Qmmp::ARTIST]);
+ formattedText += formatRow(tr("ALbum artist"), m_metaData[Qmmp::ALBUMARTIST]);
formattedText += formatRow(tr("Album"), m_metaData[Qmmp::ALBUM]);
formattedText += formatRow(tr("Comment"), m_metaData[Qmmp::COMMENT]);
formattedText += formatRow(tr("Genre"), m_metaData[Qmmp::GENRE]);
diff --git a/src/qmmpui/forms/tageditor.ui b/src/qmmpui/forms/tageditor.ui
index 90d3c5aa2..5f5d721b5 100644
--- a/src/qmmpui/forms/tageditor.ui
+++ b/src/qmmpui/forms/tageditor.ui
@@ -26,8 +26,8 @@
<item>
<widget class="QWidget" name="tagWidget" native="true">
<layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label_47">
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_43">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -35,25 +35,22 @@
</sizepolicy>
</property>
<property name="text">
- <string>Title:</string>
+ <string>Artist:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="titleLineEdit">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <item row="5" column="1">
+ <widget class="QLineEdit" name="composerLineEdit">
+ <property name="enabled">
+ <bool>false</bool>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_43">
+ <item row="6" column="0">
+ <widget class="QLabel" name="label_46">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -61,24 +58,14 @@
</sizepolicy>
</property>
<property name="text">
- <string>Artist:</string>
+ <string>Genre:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="artistLineEdit">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
+ <item row="3" column="0">
<widget class="QLabel" name="label_45">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -94,50 +81,23 @@
</property>
</widget>
</item>
- <item row="2" column="1">
- <widget class="QLineEdit" name="albumLineEdit">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_8">
- <property name="text">
- <string>Composer:</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QLineEdit" name="composerLineEdit">
- <property name="enabled">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="label_46">
+ <item row="8" column="0">
+ <widget class="QLabel" name="label_48">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
- <string>Genre:</string>
+ <string>Comment:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="4" column="1">
+ <item row="6" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="genreLineEdit">
@@ -151,23 +111,7 @@
</item>
</layout>
</item>
- <item row="5" column="0">
- <widget class="QLabel" name="label_42">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Track:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="5" column="1">
+ <item row="7" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QSpinBox" name="trackSpinBox">
@@ -257,23 +201,69 @@
</item>
</layout>
</item>
- <item row="6" column="0">
- <widget class="QLabel" name="label_48">
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="artistLineEdit">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_47">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
- <string>Comment:</string>
+ <string>Title:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="6" column="1">
+ <item row="7" column="0">
+ <widget class="QLabel" name="label_42">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Track:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="albumLineEdit">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>Composer:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="1">
<widget class="QTextBrowser" name="commentBrowser">
<property name="enabled">
<bool>true</bool>
@@ -291,8 +281,28 @@
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Arial'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Arial'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="titleLineEdit">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="albumArtistLineEdit"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_49">
+ <property name="text">
+ <string>Album Artist</string>
</property>
</widget>
</item>
diff --git a/src/qmmpui/mediaplayer.cpp b/src/qmmpui/mediaplayer.cpp
index 487b974c9..402ed0e28 100644
--- a/src/qmmpui/mediaplayer.cpp
+++ b/src/qmmpui/mediaplayer.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008-2013 by Ilya Kotov *
+ * Copyright (C) 2008-2014 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -188,6 +188,7 @@ void MediaPlayer::updateMetaData()
qDebug("===== metadata ======");
qDebug("ARTIST = %s", qPrintable(m_core->metaData(Qmmp::ARTIST)));
qDebug("TITLE = %s", qPrintable(m_core->metaData(Qmmp::TITLE)));
+ qDebug("ALBUMARTIST = %s", qPrintable(m_core->metaData(Qmmp::ALBUMARTIST)));
qDebug("ALBUM = %s", qPrintable(m_core->metaData(Qmmp::ALBUM)));
qDebug("COMMENT = %s", qPrintable(m_core->metaData(Qmmp::COMMENT)));
qDebug("GENRE = %s", qPrintable(m_core->metaData(Qmmp::GENRE)));
diff --git a/src/qmmpui/metadataformatter.cpp b/src/qmmpui/metadataformatter.cpp
index d9699edb9..702c0acfe 100644
--- a/src/qmmpui/metadataformatter.cpp
+++ b/src/qmmpui/metadataformatter.cpp
@@ -61,6 +61,7 @@ QString MetaDataFormatter::parse(const QMap<Qmmp::MetaData, QString> &metaData,
title.replace("&", "%&");
title.replace(",", "%,");
title.replace("%p", metaData[Qmmp::ARTIST]);
+ title.replace("%aa", metaData[Qmmp::ALBUMARTIST]);
title.replace("%a", metaData[Qmmp::ALBUM]);
title.replace("%t", metaData[Qmmp::TITLE]);
title.replace("%n", metaData[Qmmp::TRACK]);
diff --git a/src/qmmpui/playlistcontainer.cpp b/src/qmmpui/playlistcontainer.cpp
index 1ca4d79dc..a717f9677 100644
--- a/src/qmmpui/playlistcontainer.cpp
+++ b/src/qmmpui/playlistcontainer.cpp
@@ -75,6 +75,16 @@ static bool _artistGreaterComparator(PlayListTrack* s1,PlayListTrack* s2)
{
return QString::localeAwareCompare (s1->value(Qmmp::ARTIST), s2->value(Qmmp::ARTIST)) > 0;
}
+//by album artist
+static bool _albumArtistLessComparator(PlayListTrack* s1,PlayListTrack* s2)
+{
+ return QString::localeAwareCompare (s1->value(Qmmp::ALBUMARTIST), s2->value(Qmmp::ALBUMARTIST)) < 0;
+}
+
+static bool _albumArtistGreaterComparator(PlayListTrack* s1,PlayListTrack* s2)
+{
+ return QString::localeAwareCompare (s1->value(Qmmp::ALBUMARTIST), s2->value(Qmmp::ALBUMARTIST)) > 0;
+}
//by path
static bool _pathAndFilenameLessComparator(PlayListTrack* s1,PlayListTrack* s2)
{
@@ -180,6 +190,10 @@ void PlayListContainer::doSort(int sort_mode, QList<PlayListTrack*>& list_to_sor
compareLessFunc = _artistLessComparator;
compareGreaterFunc = _artistGreaterComparator;
break;
+ case PlayListModel::ALBUMARTIST:
+ compareLessFunc = _albumArtistLessComparator;
+ compareGreaterFunc = _albumArtistGreaterComparator;
+ break;
case PlayListModel::FILENAME:
compareLessFunc = _filenameLessComparator;
compareGreaterFunc = _filenameGreaterComparator;
diff --git a/src/qmmpui/playlistmanager.cpp b/src/qmmpui/playlistmanager.cpp
index 64517fbbc..e99a49a81 100644
--- a/src/qmmpui/playlistmanager.cpp
+++ b/src/qmmpui/playlistmanager.cpp
@@ -278,6 +278,8 @@ void PlayListManager::readPlayLists()
tracks.last()->insert(Qmmp::TITLE, value);
else if (param == "artist")
tracks.last()->insert(Qmmp::ARTIST, value);
+ else if (param == "albumartist")
+ tracks.last()->insert(Qmmp::ALBUMARTIST, value);
else if (param == "album")
tracks.last()->insert(Qmmp::ALBUM, value);
else if (param == "comment")
@@ -341,6 +343,7 @@ void PlayListManager::writePlayLists()
tmpFile.write(QString("file=%1\n").arg(t->url()).toUtf8());
tmpFile.write(QString("title=%1\n").arg(t->value(Qmmp::TITLE)).toUtf8());
tmpFile.write(QString("artist=%1\n").arg(t->value(Qmmp::ARTIST)).toUtf8());
+ tmpFile.write(QString("albumartist=%1\n").arg(t->value(Qmmp::ALBUMARTIST)).toUtf8());
tmpFile.write(QString("album=%1\n").arg(t->value(Qmmp::ALBUM)).toUtf8());
tmpFile.write(QString("comment=%1\n").arg(t->value(Qmmp::COMMENT)).toUtf8());
tmpFile.write(QString("genre=%1\n").arg(t->value(Qmmp::GENRE)).toUtf8());
diff --git a/src/qmmpui/playlistmodel.h b/src/qmmpui/playlistmodel.h
index 77ad9c50a..49c3e0a6b 100644
--- a/src/qmmpui/playlistmodel.h
+++ b/src/qmmpui/playlistmodel.h
@@ -287,6 +287,7 @@ public:
ALBUM, /*!< by album */
DISCNUMBER, /*!< by discnumber */
ARTIST, /*!< by artist */
+ ALBUMARTIST, /*!< by album artist */
FILENAME, /*!< by file name */
PATH_AND_FILENAME, /*!< by path and file name */
DATE, /*!< by date */
diff --git a/src/qmmpui/tageditor.cpp b/src/qmmpui/tageditor.cpp
index 7306d0981..1323c046e 100644
--- a/src/qmmpui/tageditor.cpp
+++ b/src/qmmpui/tageditor.cpp
@@ -29,6 +29,7 @@ TagEditor::TagEditor(TagModel *tagModel, QWidget *parent) : QWidget(parent), m_u
//check available keys
m_ui->titleLineEdit->setEnabled(m_tagModel->keys().contains(Qmmp::TITLE));
m_ui->artistLineEdit->setEnabled(m_tagModel->keys().contains(Qmmp::ARTIST));
+ m_ui->albumArtistLineEdit->setEnabled(m_tagModel->keys().contains(Qmmp::ALBUMARTIST));
m_ui->albumLineEdit->setEnabled(m_tagModel->keys().contains(Qmmp::ALBUM));
m_ui->composerLineEdit->setEnabled(m_tagModel->keys().contains(Qmmp::COMPOSER));
m_ui->genreLineEdit->setEnabled(m_tagModel->keys().contains(Qmmp::GENRE));
@@ -53,6 +54,7 @@ void TagEditor::save()
m_tagModel->create();
m_tagModel->setValue(Qmmp::TITLE, m_ui->titleLineEdit->text());
m_tagModel->setValue(Qmmp::ARTIST, m_ui->artistLineEdit->text());
+ m_tagModel->setValue(Qmmp::ALBUMARTIST, m_ui->albumArtistLineEdit->text());
m_tagModel->setValue(Qmmp::ALBUM, m_ui->albumLineEdit->text());
m_tagModel->setValue(Qmmp::COMPOSER, m_ui->composerLineEdit->text());
m_tagModel->setValue(Qmmp::GENRE, m_ui->genreLineEdit->text());
@@ -74,6 +76,7 @@ void TagEditor::readTag()
m_ui->useCheckBox->setVisible(m_tagModel->caps() & TagModel::CreateRemove);
m_ui->titleLineEdit->setText(m_tagModel->value(Qmmp::TITLE));
m_ui->artistLineEdit->setText(m_tagModel->value(Qmmp::ARTIST));
+ m_ui->albumArtistLineEdit->setText(m_tagModel->value(Qmmp::ALBUMARTIST));
m_ui->albumLineEdit->setText(m_tagModel->value(Qmmp::ALBUM));
m_ui->composerLineEdit->setText(m_tagModel->value(Qmmp::COMPOSER));
m_ui->genreLineEdit->setText(m_tagModel->value(Qmmp::GENRE));