From 8f3eae59f176ed9373d4524648dc7f946d0175e0 Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 22 Apr 2020 19:14:34 +0200 Subject: [PATCH] Add more time-related ID3v2 IDs --- CMakeLists.txt | 4 ++-- id3/id3v2frameids.cpp | 20 ++++++++++++++++++-- id3/id3v2frameids.h | 14 +++++++++++++- id3/id3v2tag.cpp | 4 ++-- 4 files changed, 35 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05c2d1b..928334c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,8 @@ set(META_APP_AUTHOR "Martchus") set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}") set(META_APP_DESCRIPTION "C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags") set(META_VERSION_MAJOR 9) -set(META_VERSION_MINOR 1) -set(META_VERSION_PATCH 4) +set(META_VERSION_MINOR 2) +set(META_VERSION_PATCH 0) set(META_REQUIRED_CPP_UNIT_VERSION 1.14.0) set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON) diff --git a/id3/id3v2frameids.cpp b/id3/id3v2frameids.cpp index 446767b..0dc7780 100644 --- a/id3/id3v2frameids.cpp +++ b/id3/id3v2frameids.cpp @@ -35,8 +35,16 @@ std::uint32_t convertToShortId(std::uint32_t id) return sComment; case lYear: return sYear; - case lRecordDate: + case lOriginalYear: + return sOriginalYear; + case lRecordingDates: + return sRecordingDates; + case lRecordingTime: return sRecordDate; + case lDate: + return sDate; + case lTime: + return sTime; case lTitle: return sTitle; case lGenre: @@ -89,8 +97,16 @@ std::uint32_t convertToLongId(std::uint32_t id) return lComment; case sYear: return lYear; + case sOriginalYear: + return lOriginalYear; case sRecordDate: - return lRecordDate; + return lRecordingTime; + case sRecordingDates: + return lRecordingDates; + case sDate: + return lDate; + case sTime: + return lTime; case sTitle: return lTitle; case sGenre: diff --git a/id3/id3v2frameids.h b/id3/id3v2frameids.h index af6848e..c6884cc 100644 --- a/id3/id3v2frameids.h +++ b/id3/id3v2frameids.h @@ -13,7 +13,15 @@ enum KnownValue : std::uint32_t { lArtist = 0x54504531, lComment = 0x434f4d4d, lYear = 0x54594552, - lRecordDate = 0x54445243, + lOriginalYear = 0x544F5259, + lRecordingDates = 0x54524441, + lDate = 0x54444154, + lTime = 0x54494D45, + lRecordDate = 0x54445243, // FIXME v10: remove in favor of lRecordingTime + lRecordingTime = 0x54445243, + lReleaseTime = 0x5444524C, + lOriginalReleaseTime = 0x54444F52, + lTaggingTime = 0x54445447, lTitle = 0x54495432, lGenre = 0x54434f4e, lTrackPosition = 0x5452434b, @@ -39,7 +47,11 @@ enum KnownValue : std::uint32_t { sArtist = 0x545031, sComment = 0x434f4d, sYear = 0x545945, + sOriginalYear = 0x544F5259, + sRecordingDates = 0x545244, sRecordDate = 0x545243, + sDate = 0x544441, + sTime = 0x54494D, sTitle = 0x545432, sGenre = 0x54434f, sTrackPosition = 0x54524b, diff --git a/id3/id3v2tag.cpp b/id3/id3v2tag.cpp index 52b6259..9feebfb 100644 --- a/id3/id3v2tag.cpp +++ b/id3/id3v2tag.cpp @@ -148,7 +148,7 @@ Id3v2Tag::IdentifierType Id3v2Tag::internallyGetFieldId(KnownField field) const case KnownField::Year: return lYear; case KnownField::RecordDate: - return lRecordDate; + return lRecordingTime; case KnownField::Title: return lTitle; case KnownField::Genre: @@ -253,7 +253,7 @@ KnownField Id3v2Tag::internallyGetKnownField(const IdentifierType &id) const return KnownField::Comment; case lYear: return KnownField::Year; - case lRecordDate: + case lRecordingTime: return KnownField::RecordDate; case lTitle: return KnownField::Title;