From e3809bd4f07db1a1922e74756e603120430bc82f Mon Sep 17 00:00:00 2001 From: "Miguel A. Arroyo" Date: Sun, 21 Jul 2024 14:46:36 -0700 Subject: [PATCH] feat: Add ShowMovement Tag This commit adds the `SHOWMOVEMENT` [tag](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html#show-work-movement-4). Historically, this tag originates from iTunes' MP4, but has since become widely used. It is created by Picard's Classical music [plugins](https://picard-docs.musicbrainz.org/en/variables/variables_classical.html) (such as "Classical Extras" or "Work & Movement"). The reasoning behind this tag is to display Work & Movement titles without redundant information and in a more uniform way. Moreover, it additionally serves as an implicit marker denoting classical music tracks (genre tags aren't sufficient). If the client so chooses to support this tag, they can display `Work` and `Movement` instead of the track title allowing for cleaner display. Other clients can continue to display the `%title%` as before without any fuss. --- NEWS | 2 +- doc/protocol.rst | 1 + src/db/plugins/ProxyDatabasePlugin.cxx | 3 +++ src/tag/Names.cxx | 1 + src/tag/Type.hxx | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 8eb412698..95e81b8c7 100644 --- a/NEWS +++ b/NEWS @@ -48,7 +48,7 @@ ver 0.24 (not yet released) - add option "mixramp_analyzer" to scan MixRamp tags on-the-fly - "one-shot" consume mode * tags - - new tags "TitleSort", "Mood" + - new tags "TitleSort", "Mood", "ShowMovement" * output - add option "always_off" - alsa: require alsa-lib 1.1 or later diff --git a/doc/protocol.rst b/doc/protocol.rst index 285383ce0..d46c4d9a2 100644 --- a/doc/protocol.rst +++ b/doc/protocol.rst @@ -344,6 +344,7 @@ The following tags are supported by :program:`MPD`: * **ensemble**: the ensemble performing this song, e.g. "Wiener Philharmoniker". * **movement**: name of the movement, e.g. "Andante con moto". * **movementnumber**: movement number, e.g. "2" or "II". +* **showmovement**: If this tag is set to "1" players supporting this tag will display the `work`, `movement`, and `movementnumber`` instead of the track title. * **location**: location of the recording, e.g. "Royal Albert Hall". * **grouping**: "used if the sound belongs to a larger category of sounds/music" (`from the IDv2.4.0 TIT1 description diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx index c9330366f..f3f739b13 100644 --- a/src/db/plugins/ProxyDatabasePlugin.cxx +++ b/src/db/plugins/ProxyDatabasePlugin.cxx @@ -184,6 +184,9 @@ static constexpr struct { { TAG_MOOD, MPD_TAG_MOOD }, { TAG_MUSICBRAINZ_RELEASEGROUPID, MPD_TAG_MUSICBRAINZ_RELEASEGROUPID }, +#endif +#if LIBMPDCLIENT_CHECK_VERSION(2,23,0) + { TAG_SHOWMOVEMENT, MPD_TAG_SHOWMOVEMENT }, #endif { TAG_NUM_OF_ITEM_TYPES, MPD_TAG_COUNT } }; diff --git a/src/tag/Names.cxx b/src/tag/Names.cxx index 7ed9f210c..eb6d9c920 100644 --- a/src/tag/Names.cxx +++ b/src/tag/Names.cxx @@ -28,6 +28,7 @@ static constexpr struct tag_table tag_item_names_init[] = { {"Work", TAG_WORK}, {"Movement", TAG_MOVEMENT}, {"MovementNumber", TAG_MOVEMENTNUMBER}, + {"ShowMovement", TAG_SHOWMOVEMENT}, {"Ensemble", TAG_ENSEMBLE}, {"Location", TAG_LOCATION}, {"Grouping", TAG_GROUPING}, diff --git a/src/tag/Type.hxx b/src/tag/Type.hxx index d9dcdd470..59e845ab2 100644 --- a/src/tag/Type.hxx +++ b/src/tag/Type.hxx @@ -30,6 +30,7 @@ enum TagType : uint8_t { TAG_WORK, TAG_MOVEMENT, TAG_MOVEMENTNUMBER, + TAG_SHOWMOVEMENT, TAG_ENSEMBLE, TAG_LOCATION, TAG_GROUPING,