Skip to content

Commit

Permalink
Support album artist and vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
Martchus committed Jan 1, 2019
1 parent 8ad22fa commit dbc1c79
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 33 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ if(WIDGETS_GUI OR QUICK_GUI)
endif()

# find tagparser
find_package(tagparser 8.0.0 REQUIRED)
find_package(tagparser 8.1.0 REQUIRED)
use_tag_parser()
list(APPEND TEST_LIBRARIES ${TAG_PARSER_SHARED_LIB})

Expand Down
67 changes: 36 additions & 31 deletions application/knownfieldmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ const char *KnownFieldModel::fieldName(KnownField field)
return QT_TR_NOOP("Description");
case KnownField::Vendor:
return QT_TR_NOOP("Vendor");
case KnownField::AlbumArtist:
return QT_TR_NOOP("Album artist");
default:
return "";
}
Expand All @@ -95,37 +97,40 @@ QString KnownFieldModel::labelForId(const QVariant &id) const
KnownFieldModel::KnownFieldModel(QObject *parent, DefaultSelection defaultSelection)
: ChecklistModel(parent)
{
QList<ChecklistItem> items;
items.reserve(27);
Qt::CheckState defaultSelected = defaultSelection == DefaultSelection::CommonFields ? Qt::Checked : Qt::Unchecked;
items << mkItem(KnownField::Title, defaultSelected);
items << mkItem(KnownField::Album, defaultSelected);
items << mkItem(KnownField::Artist, defaultSelected);
items << mkItem(KnownField::Genre, defaultSelected);
items << mkItem(KnownField::Year, defaultSelected);
items << mkItem(KnownField::Comment, defaultSelected);
items << mkItem(KnownField::Bpm, Qt::Unchecked);
items << mkItem(KnownField::Bps, Qt::Unchecked);
items << mkItem(KnownField::Lyricist, defaultSelected);
items << mkItem(KnownField::TrackPosition, defaultSelected);
items << mkItem(KnownField::DiskPosition, defaultSelected);
items << mkItem(KnownField::PartNumber, defaultSelected);
items << mkItem(KnownField::TotalParts, defaultSelected);
items << mkItem(KnownField::Encoder, defaultSelected);
items << mkItem(KnownField::RecordDate, defaultSelected);
items << mkItem(KnownField::Performers, defaultSelected);
items << mkItem(KnownField::Length, Qt::Unchecked);
items << mkItem(KnownField::Language, Qt::Unchecked);
items << mkItem(KnownField::EncoderSettings, Qt::Unchecked);
items << mkItem(KnownField::Lyrics, defaultSelected);
items << mkItem(KnownField::SynchronizedLyrics, Qt::Unchecked);
items << mkItem(KnownField::Grouping, Qt::Unchecked);
items << mkItem(KnownField::RecordLabel, Qt::Unchecked);
items << mkItem(KnownField::Cover, defaultSelected);
items << mkItem(KnownField::Composer, Qt::Unchecked);
items << mkItem(KnownField::Rating, Qt::Unchecked);
items << mkItem(KnownField::Description, Qt::Unchecked);
setItems(std::move(items));
const auto defaultSelected = defaultSelection == DefaultSelection::CommonFields ? Qt::Checked : Qt::Unchecked;
// clang-format off
setItems({
mkItem(KnownField::Title, defaultSelected),
mkItem(KnownField::Album, defaultSelected),
mkItem(KnownField::Artist, defaultSelected),
mkItem(KnownField::Genre, defaultSelected),
mkItem(KnownField::Year, defaultSelected),
mkItem(KnownField::Comment, defaultSelected),
mkItem(KnownField::AlbumArtist, defaultSelected),
mkItem(KnownField::Bpm, Qt::Unchecked),
mkItem(KnownField::Bps, Qt::Unchecked),
mkItem(KnownField::Lyricist, defaultSelected),
mkItem(KnownField::TrackPosition, defaultSelected),
mkItem(KnownField::DiskPosition, defaultSelected),
mkItem(KnownField::PartNumber, defaultSelected),
mkItem(KnownField::TotalParts, defaultSelected),
mkItem(KnownField::Encoder, defaultSelected),
mkItem(KnownField::RecordDate, defaultSelected),
mkItem(KnownField::Performers, defaultSelected),
mkItem(KnownField::Length, Qt::Unchecked),
mkItem(KnownField::Language, Qt::Unchecked),
mkItem(KnownField::EncoderSettings, Qt::Unchecked),
mkItem(KnownField::Lyrics, defaultSelected),
mkItem(KnownField::SynchronizedLyrics, Qt::Unchecked),
mkItem(KnownField::Grouping, Qt::Unchecked),
mkItem(KnownField::RecordLabel, Qt::Unchecked),
mkItem(KnownField::Cover, defaultSelected),
mkItem(KnownField::Composer, Qt::Unchecked),
mkItem(KnownField::Rating, Qt::Unchecked),
mkItem(KnownField::Description, Qt::Unchecked),
mkItem(KnownField::Vendor, Qt::Unchecked),
});
// clang-format on
}

KnownFieldModel::KnownFieldModel(const QList<Models::ChecklistItem> &items, QObject *parent)
Expand Down
2 changes: 2 additions & 0 deletions cli/fieldmapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ static constexpr struct {
{ "composer", KnownField::Composer },
{ "rating", KnownField::Rating },
{ "description", KnownField::Description },
{ "vendor", KnownField::Vendor },
{ "albumartist", KnownField::AlbumArtist },
};

const char *fieldDenotation(TagParser::KnownField knownField)
Expand Down
2 changes: 1 addition & 1 deletion cli/mainfeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace Cli {
#define FIELD_NAMES \
"title album artist genre year comment bpm bps lyricist disk part totalparts encoder\n" \
" recorddate performers duration language encodersettings lyrics synchronizedlyrics grouping\n" \
" recordlabel cover composer rating description"
" recordlabel cover composer rating description vendor albumartist"

#define TRACK_ATTRIBUTE_NAMES "name tracknumber enabled=yes enabled=no forced=yes forced=no default=yes default=no"

Expand Down

0 comments on commit dbc1c79

Please sign in to comment.