Support publisher webpage in Vorbis comments

This commit is contained in:
Martchus 2023-12-29 16:50:41 +01:00
parent 0f669c88a7
commit b1bca85ef4
3 changed files with 9 additions and 1 deletions

3
tag.h
View File

@ -126,6 +126,7 @@ enum class KnownField : unsigned int {
ProductionCopyright, /** production copyright */
License, /** license */
TermsOfUse, /** terms of use */
PublisherWebpage, /** the publisher's official webpage */
};
/*!
@ -136,7 +137,7 @@ constexpr KnownField firstKnownField = KnownField::Title;
/*!
* \brief The last valid entry in the TagParser::KnownField enum.
*/
constexpr KnownField lastKnownField = KnownField::TermsOfUse;
constexpr KnownField lastKnownField = KnownField::PublisherWebpage;
/*!
* \brief The number of valid entries in the TagParser::KnownField enum.

View File

@ -109,6 +109,8 @@ VorbisComment::IdentifierType VorbisComment::internallyGetFieldId(KnownField fie
return std::string(bpm());
case KnownField::Publisher:
return std::string(publisher());
case KnownField::PublisherWebpage:
return std::string(publisherWebpage());
default:
return std::string();
}
@ -149,6 +151,7 @@ KnownField VorbisComment::internallyGetKnownField(const IdentifierType &id) cons
{ rating(), KnownField::Rating },
{ bpm(), KnownField::Bpm },
{ publisher(), KnownField::Publisher },
{ publisherWebpage(), KnownField::PublisherWebpage },
});
// clang-format on
const auto knownField(fieldMap.find(id));

View File

@ -189,6 +189,10 @@ constexpr TAG_PARSER_EXPORT std::string_view bpm()
{
return "BPM";
}
constexpr TAG_PARSER_EXPORT std::string_view publisherWebpage()
{
return "WWWPUBLISHER";
}
} // namespace VorbisCommentIds