tag: new tag "Mood"

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1435
This commit is contained in:
Max Kellermann 2022-02-12 07:46:45 +01:00
parent 4f3828237a
commit ad4cf79cc9
6 changed files with 13 additions and 0 deletions

2
NEWS
View File

@ -1,6 +1,8 @@
ver 0.24 (not yet released)
* player
- add option "mixramp_analyzer" to scan MixRamp tags on-the-fly
* tags
- new tag "Mood"
ver 0.23.6 (not yet released)
* decoder

View File

@ -283,6 +283,7 @@ The following tags are supported by :program:`MPD`:
* **track**: the decimal track number within the album.
* **name**: a name for this song. This is not the song title. The exact meaning of this tag is not well-defined. It is often used by badly configured internet radio stations with broken tags to squeeze both the artist name and the song title in one tag.
* **genre**: the music genre.
* **mood**: the mood of the audio with a few keywords.
* **date**: the song's release date. This is usually a 4-digit year.
* **originaldate**: the song's original release date.
* **composer**: the artist who composed the song.

View File

@ -201,6 +201,9 @@ static constexpr struct {
{ TAG_MOVEMENT, MPD_TAG_MOVEMENT },
{ TAG_MOVEMENTNUMBER, MPD_TAG_MOVEMENTNUMBER },
{ TAG_LOCATION, MPD_TAG_LOCATION },
#endif
#if LIBMPDCLIENT_CHECK_VERSION(2,21,0)
{ TAG_MOOD, MPD_TAG_MOOD },
#endif
{ TAG_NUM_OF_ITEM_TYPES, MPD_TAG_COUNT }
};

View File

@ -60,6 +60,10 @@
#define ID3_FRAME_LABEL "TPUB"
#endif
#ifndef ID3_FRAME_MOOD
#define ID3_FRAME_MOOD "TMOO"
#endif
gcc_pure
static Id3String
tag_id3_getstring(const struct id3_frame *frame, unsigned i) noexcept
@ -346,6 +350,7 @@ scan_id3_tag(const struct id3_tag *tag, TagHandler &handler) noexcept
handler);
tag_id3_import_text(tag, ID3_FRAME_LABEL, TAG_LABEL,
handler);
tag_id3_import_text(tag, ID3_FRAME_MOOD, TAG_MOOD, handler);
tag_id3_import_musicbrainz(tag, handler);
tag_id3_import_ufid(tag, handler);

View File

@ -30,6 +30,7 @@ const char *const tag_item_names[TAG_NUM_OF_ITEM_TYPES] = {
[TAG_TRACK] = "Track",
[TAG_NAME] = "Name",
[TAG_GENRE] = "Genre",
[TAG_MOOD] = "Mood",
[TAG_DATE] = "Date",
[TAG_ORIGINAL_DATE] = "OriginalDate",
[TAG_COMPOSER] = "Composer",

View File

@ -45,6 +45,7 @@ enum TagType
TAG_TRACK,
TAG_NAME,
TAG_GENRE,
TAG_MOOD,
TAG_DATE,
TAG_ORIGINAL_DATE,
TAG_COMPOSER,