Tag Parser: id3/id3v2frameids.h Source File

Tag Parser 12.5.3 C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags

Loading...
Searching...
No Matches
id3v2frameids.h
Go to the documentation of this file.
1#ifndef TAG_PARSER_ID3V2FRAMEIDS_H
2#define TAG_PARSER_ID3V2FRAMEIDS_H
3
4#include "../global.h"
5
6#include <cstdint>
7
8#include <string>
9
10namespace TagParser {
11
12 namespace Id3v2FrameIds {
13 enum KnownValue : std::uint32_t {
14 lAlbum = 0x54414c42,
15 lArtist = 0x54504531,
16 lComment = 0x434f4d4d,
17 lYear = 0x54594552,
18 lOriginalYear = 0x544F5259,
19 lRecordingDates = 0x54524441,
20 lDate = 0x54444154,
21 lTime = 0x54494D45,
22 lRecordingTime = 0x54445243,
23 lReleaseTime = 0x5444524C,
24 lOriginalReleaseTime = 0x54444F52,
25 lOriginalMediaType = 0x544D4544,
26 lTaggingTime = 0x54445447,
27 lGenre = 0x54434f4e,
28 lTrackPosition = 0x5452434b,
29 lDiskPosition = 0x54504f53,
30 lEncoder = 0x54454e43,
31 lBpm = 0x5442504d,
32 lCover = 0x41504943,
33 lWriter = 0x54455854,
34 lLength = 0x544c454e,
35 lLanguage = 0x544c414e,
36 lEncoderSettings = 0x54535345,
37 lUnsynchronizedLyrics = 0x55534c54,
38 lSynchronizedLyrics = 0x53594C54,
39 lAlbumArtist = 0x54504532,
40 lContentGroupDescription = 0x54495431,
41 lTitle = 0x54495432,
42 lSubtitleOrDescriptionRefinement = 0x54495433,
43 lLongDescription = 0x54444553,
44 lRecordLabel = 0x54505542,
45 lUniqueFileId = 0x55464944,
46 lComposer = 0x54434f4d,
47 lPlayCounter = 0x50434E54,
48 lRating = 0x504f504d,
49 lRemixedBy = 0x54504534,
50 lCopyright = 0x54434F50,
51 lEncodingTime = 0x5444454E,
52 lMood = 0x544D4F4F,
53 lISRC = 0x54535243,
54 lKey = 0x544B4559,
55 lUserDefinedText = 0x54585858,
56 lCommericalInfoWebpage = 0x57434F4D,
57 lCopyrightInfoWebpage = 0x57434F50,
58 lAudioFileWebpage = 0x574F4146,
59 lAudioSourceWebpage = 0x574F4153,
60 lInternetRadioStationWebpage = 0x574F5253,
61 lPaymentWebpage = 0x57504159,
62 lPublisherWebpage = 0x57505542,
63 lPerformerWebpage = 0x574F4152,
64 lUserDefinedURL = 0x57585858,
65
66 sAlbum = 0x54414c,
67 sArtist = 0x545031,
68 sComment = 0x434f4d,
69 sYear = 0x545945,
70 sOriginalYear = 0x544F52,
71 sOriginalMediaType = 0x544D54,
72 sRecordingDates = 0x545244,
73 sDate = 0x544441,
74 sTime = 0x54494D,
75 sGenre = 0x54434f,
76 sTrackPosition = 0x54524b,
77 sDiskPosition = 0x545041,
78 sEncoder = 0x54454e,
79 sBpm = 0x544250,
80 sCover = 0x504943,
81 sWriter = 0x545854,
82 sLength = 0x544c45,
83 sLanguage = 0x544c41,
84 sEncoderSettings = 0x545353,
85 sUnsynchronizedLyrics = 0x554C54,
86 sSynchronizedLyrics = 0x534C54,
87 sAlbumArtist = 0x545032,
88 sContentGroupDescription = 0x545431,
89 sTitle = 0x545432,
90 sSubtitleOrDescriptionRefinement = 0x545433,
91 sRecordLabel = 0x545042,
92 sUniqueFileId = 0x554649,
93 sComposer = 0x54434d,
94 sPlayCounter = 0x434E54,
95 sRating = 0x504f50,
96 sRemixedBy = 0x545034,
97 sCopyright = 0x544352,
98 sISRC = 0x545243,
99 sKey = 0x544B45,
100 sUserDefinedText = 0x545858,
101 sCommericalInfoWebpage = 0x57434D,
102 sCopyrightInfoWebpage = 0x574350,
103 sAudioFileWebpage = 0x574146,
104 sAudioSourceWebpage = 0x574153,
105 sPublisherWebpage = 0x575042,
106 sPerformerWebpage = 0x574152,
107 sUserDefinedURL = 0x575858,
108};
109
110 TAG_PARSER_EXPORT std::uint32_t convertToShortId(std::uint32_t id);
111 TAG_PARSER_EXPORT std::uint32_t convertToLongId(std::uint32_t id);
112 TAG_PARSER_EXPORT bool isPreId3v24Id(std::uint32_t id);
113 TAG_PARSER_EXPORT bool isOnlyId3v24Id(std::uint32_t id);
114
118 constexpr bool isLongId(std::uint32_t id)
119{
120 return (id & 0x00ffffff) != id;
121}
122
126 constexpr bool isShortId(std::uint32_t id)
127{
128 return (id & 0x00ffffff) == id;
129}
130
134 constexpr bool isTextFrame(std::uint32_t id)
135{
136 if (isShortId(id)) {
137 return ((id & 0x00FF0000u) == 0x00540000u) && (id != Id3v2FrameIds::sUserDefinedText);
138 } else {
139 return (id & 0xFF000000u) == 0x54000000u && (id != Id3v2FrameIds::lUserDefinedText);
140 }
141}
142
146 constexpr bool isUrlFrame(std::uint32_t id)
147{
148 if (isShortId(id)) {
149 return ((id & 0x00FF0000u) == 0x00570000u) && (id != Id3v2FrameIds::sUserDefinedURL);
150 } else {
151 return (id & 0xFF000000u) == 0x57000000u && (id != Id3v2FrameIds::lUserDefinedURL);
152 }
153}
154
155} // namespace Id3v2FrameIds
156
157} // namespace TagParser
158#endif // TAG_PARSER_ID3V2FRAMEIDS_H
global.h
TAG_PARSER_EXPORT
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Definition global.h:14
TagParser::Id3v2FrameIds
Encapsulates the most common ID3v2 frame IDs and related functions.
Definition id3v2frameids.h:12
TagParser::Id3v2FrameIds::isPreId3v24Id
TAG_PARSER_EXPORT bool isPreId3v24Id(std::uint32_t id)
TagParser::Id3v2FrameIds::convertToShortId
TAG_PARSER_EXPORT std::uint32_t convertToShortId(std::uint32_t id)
Converts the specified long frame ID to the equivalent short frame ID.
Definition id3v2frameids.cpp:27
TagParser::Id3v2FrameIds::isLongId
constexpr bool isLongId(std::uint32_t id)
Returns an indication whether the specified id is a long frame id.
Definition id3v2frameids.h:118
TagParser::Id3v2FrameIds::KnownValue
KnownValue
Definition id3v2frameids.h:13
TagParser::Id3v2FrameIds::lComposer
@ lComposer
Definition id3v2frameids.h:46
TagParser::Id3v2FrameIds::sSubtitleOrDescriptionRefinement
@ sSubtitleOrDescriptionRefinement
Definition id3v2frameids.h:90
TagParser::Id3v2FrameIds::lRating
@ lRating
Definition id3v2frameids.h:48
TagParser::Id3v2FrameIds::sRecordLabel
@ sRecordLabel
Definition id3v2frameids.h:91
TagParser::Id3v2FrameIds::sISRC
@ sISRC
Definition id3v2frameids.h:98
TagParser::Id3v2FrameIds::sPerformerWebpage
@ sPerformerWebpage
Definition id3v2frameids.h:106
TagParser::Id3v2FrameIds::lPublisherWebpage
@ lPublisherWebpage
Definition id3v2frameids.h:62
TagParser::Id3v2FrameIds::sRating
@ sRating
Definition id3v2frameids.h:95
TagParser::Id3v2FrameIds::sEncoder
@ sEncoder
Definition id3v2frameids.h:78
TagParser::Id3v2FrameIds::lWriter
@ lWriter
Definition id3v2frameids.h:33
TagParser::Id3v2FrameIds::lISRC
@ lISRC
Definition id3v2frameids.h:53
TagParser::Id3v2FrameIds::lYear
@ lYear
Definition id3v2frameids.h:17
TagParser::Id3v2FrameIds::lArtist
@ lArtist
Definition id3v2frameids.h:15
TagParser::Id3v2FrameIds::lTrackPosition
@ lTrackPosition
Definition id3v2frameids.h:28
TagParser::Id3v2FrameIds::lInternetRadioStationWebpage
@ lInternetRadioStationWebpage
Definition id3v2frameids.h:60
TagParser::Id3v2FrameIds::lLanguage
@ lLanguage
Definition id3v2frameids.h:35
TagParser::Id3v2FrameIds::lContentGroupDescription
@ lContentGroupDescription
Definition id3v2frameids.h:40
TagParser::Id3v2FrameIds::sTime
@ sTime
Definition id3v2frameids.h:74
TagParser::Id3v2FrameIds::lAlbumArtist
@ lAlbumArtist
Definition id3v2frameids.h:39
TagParser::Id3v2FrameIds::sEncoderSettings
@ sEncoderSettings
Definition id3v2frameids.h:84
TagParser::Id3v2FrameIds::lEncoderSettings
@ lEncoderSettings
Definition id3v2frameids.h:36
TagParser::Id3v2FrameIds::sUserDefinedText
@ sUserDefinedText
Definition id3v2frameids.h:100
TagParser::Id3v2FrameIds::sComment
@ sComment
Definition id3v2frameids.h:68
TagParser::Id3v2FrameIds::lDate
@ lDate
Definition id3v2frameids.h:20
TagParser::Id3v2FrameIds::lSubtitleOrDescriptionRefinement
@ lSubtitleOrDescriptionRefinement
Definition id3v2frameids.h:42
TagParser::Id3v2FrameIds::lUserDefinedText
@ lUserDefinedText
Definition id3v2frameids.h:55
TagParser::Id3v2FrameIds::lSynchronizedLyrics
@ lSynchronizedLyrics
Definition id3v2frameids.h:38
TagParser::Id3v2FrameIds::sPublisherWebpage
@ sPublisherWebpage
Definition id3v2frameids.h:105
TagParser::Id3v2FrameIds::lReleaseTime
@ lReleaseTime
Definition id3v2frameids.h:23
TagParser::Id3v2FrameIds::lTime
@ lTime
Definition id3v2frameids.h:21
TagParser::Id3v2FrameIds::sAudioFileWebpage
@ sAudioFileWebpage
Definition id3v2frameids.h:103
TagParser::Id3v2FrameIds::sCopyrightInfoWebpage
@ sCopyrightInfoWebpage
Definition id3v2frameids.h:102
TagParser::Id3v2FrameIds::sArtist
@ sArtist
Definition id3v2frameids.h:67
TagParser::Id3v2FrameIds::lEncoder
@ lEncoder
Definition id3v2frameids.h:30
TagParser::Id3v2FrameIds::sLength
@ sLength
Definition id3v2frameids.h:82
TagParser::Id3v2FrameIds::lOriginalReleaseTime
@ lOriginalReleaseTime
Definition id3v2frameids.h:24
TagParser::Id3v2FrameIds::lCover
@ lCover
Definition id3v2frameids.h:32
TagParser::Id3v2FrameIds::lTaggingTime
@ lTaggingTime
Definition id3v2frameids.h:26
TagParser::Id3v2FrameIds::sYear
@ sYear
Definition id3v2frameids.h:69
TagParser::Id3v2FrameIds::sContentGroupDescription
@ sContentGroupDescription
Definition id3v2frameids.h:88
TagParser::Id3v2FrameIds::sUniqueFileId
@ sUniqueFileId
Definition id3v2frameids.h:92
TagParser::Id3v2FrameIds::lRecordingTime
@ lRecordingTime
Definition id3v2frameids.h:22
TagParser::Id3v2FrameIds::lOriginalMediaType
@ lOriginalMediaType
Definition id3v2frameids.h:25
TagParser::Id3v2FrameIds::lAudioFileWebpage
@ lAudioFileWebpage
Definition id3v2frameids.h:58
TagParser::Id3v2FrameIds::lPerformerWebpage
@ lPerformerWebpage
Definition id3v2frameids.h:63
TagParser::Id3v2FrameIds::lLongDescription
@ lLongDescription
Definition id3v2frameids.h:43
TagParser::Id3v2FrameIds::lKey
@ lKey
Definition id3v2frameids.h:54
TagParser::Id3v2FrameIds::lAudioSourceWebpage
@ lAudioSourceWebpage
Definition id3v2frameids.h:59
TagParser::Id3v2FrameIds::sRemixedBy
@ sRemixedBy
Definition id3v2frameids.h:96
TagParser::Id3v2FrameIds::sBpm
@ sBpm
Definition id3v2frameids.h:79
TagParser::Id3v2FrameIds::sCopyright
@ sCopyright
Definition id3v2frameids.h:97
TagParser::Id3v2FrameIds::lRecordingDates
@ lRecordingDates
Definition id3v2frameids.h:19
TagParser::Id3v2FrameIds::sCommericalInfoWebpage
@ sCommericalInfoWebpage
Definition id3v2frameids.h:101
TagParser::Id3v2FrameIds::sSynchronizedLyrics
@ sSynchronizedLyrics
Definition id3v2frameids.h:86
TagParser::Id3v2FrameIds::lUniqueFileId
@ lUniqueFileId
Definition id3v2frameids.h:45
TagParser::Id3v2FrameIds::sAlbumArtist
@ sAlbumArtist
Definition id3v2frameids.h:87
TagParser::Id3v2FrameIds::lCopyright
@ lCopyright
Definition id3v2frameids.h:50
TagParser::Id3v2FrameIds::sOriginalMediaType
@ sOriginalMediaType
Definition id3v2frameids.h:71
TagParser::Id3v2FrameIds::sRecordingDates
@ sRecordingDates
Definition id3v2frameids.h:72
TagParser::Id3v2FrameIds::sGenre
@ sGenre
Definition id3v2frameids.h:75
TagParser::Id3v2FrameIds::lUserDefinedURL
@ lUserDefinedURL
Definition id3v2frameids.h:64
TagParser::Id3v2FrameIds::lPlayCounter
@ lPlayCounter
Definition id3v2frameids.h:47
TagParser::Id3v2FrameIds::sDiskPosition
@ sDiskPosition
Definition id3v2frameids.h:77
TagParser::Id3v2FrameIds::lAlbum
@ lAlbum
Definition id3v2frameids.h:14
TagParser::Id3v2FrameIds::lComment
@ lComment
Definition id3v2frameids.h:16
TagParser::Id3v2FrameIds::lCopyrightInfoWebpage
@ lCopyrightInfoWebpage
Definition id3v2frameids.h:57
TagParser::Id3v2FrameIds::lUnsynchronizedLyrics
@ lUnsynchronizedLyrics
Definition id3v2frameids.h:37
TagParser::Id3v2FrameIds::lPaymentWebpage
@ lPaymentWebpage
Definition id3v2frameids.h:61
TagParser::Id3v2FrameIds::lMood
@ lMood
Definition id3v2frameids.h:52
TagParser::Id3v2FrameIds::sTitle
@ sTitle
Definition id3v2frameids.h:89
TagParser::Id3v2FrameIds::lDiskPosition
@ lDiskPosition
Definition id3v2frameids.h:29
TagParser::Id3v2FrameIds::sUnsynchronizedLyrics
@ sUnsynchronizedLyrics
Definition id3v2frameids.h:85
TagParser::Id3v2FrameIds::lTitle
@ lTitle
Definition id3v2frameids.h:41
TagParser::Id3v2FrameIds::sLanguage
@ sLanguage
Definition id3v2frameids.h:83
TagParser::Id3v2FrameIds::lOriginalYear
@ lOriginalYear
Definition id3v2frameids.h:18
TagParser::Id3v2FrameIds::lRecordLabel
@ lRecordLabel
Definition id3v2frameids.h:44
TagParser::Id3v2FrameIds::sAudioSourceWebpage
@ sAudioSourceWebpage
Definition id3v2frameids.h:104
TagParser::Id3v2FrameIds::sAlbum
@ sAlbum
Definition id3v2frameids.h:66
TagParser::Id3v2FrameIds::lCommericalInfoWebpage
@ lCommericalInfoWebpage
Definition id3v2frameids.h:56
TagParser::Id3v2FrameIds::sPlayCounter
@ sPlayCounter
Definition id3v2frameids.h:94
TagParser::Id3v2FrameIds::sDate
@ sDate
Definition id3v2frameids.h:73
TagParser::Id3v2FrameIds::lGenre
@ lGenre
Definition id3v2frameids.h:27
TagParser::Id3v2FrameIds::sWriter
@ sWriter
Definition id3v2frameids.h:81
TagParser::Id3v2FrameIds::sComposer
@ sComposer
Definition id3v2frameids.h:93
TagParser::Id3v2FrameIds::sUserDefinedURL
@ sUserDefinedURL
Definition id3v2frameids.h:107
TagParser::Id3v2FrameIds::sCover
@ sCover
Definition id3v2frameids.h:80
TagParser::Id3v2FrameIds::lEncodingTime
@ lEncodingTime
Definition id3v2frameids.h:51
TagParser::Id3v2FrameIds::sKey
@ sKey
Definition id3v2frameids.h:99
TagParser::Id3v2FrameIds::sOriginalYear
@ sOriginalYear
Definition id3v2frameids.h:70
TagParser::Id3v2FrameIds::lBpm
@ lBpm
Definition id3v2frameids.h:31
TagParser::Id3v2FrameIds::lRemixedBy
@ lRemixedBy
Definition id3v2frameids.h:49
TagParser::Id3v2FrameIds::lLength
@ lLength
Definition id3v2frameids.h:34
TagParser::Id3v2FrameIds::sTrackPosition
@ sTrackPosition
Definition id3v2frameids.h:76
TagParser::Id3v2FrameIds::isTextFrame
constexpr bool isTextFrame(std::uint32_t id)
Returns an indication whether the specified id is a text frame id.
Definition id3v2frameids.h:134
TagParser::Id3v2FrameIds::isUrlFrame
constexpr bool isUrlFrame(std::uint32_t id)
Returns an indication whether the specified id is a URL frame id.
Definition id3v2frameids.h:146
TagParser::Id3v2FrameIds::isShortId
constexpr bool isShortId(std::uint32_t id)
Returns an indication whether the specified id is a short frame id.
Definition id3v2frameids.h:126
TagParser::Id3v2FrameIds::isOnlyId3v24Id
TAG_PARSER_EXPORT bool isOnlyId3v24Id(std::uint32_t id)
TagParser::Id3v2FrameIds::convertToLongId
TAG_PARSER_EXPORT std::uint32_t convertToLongId(std::uint32_t id)
Converts the specified short frame ID to the equivalent long frame ID.
Definition id3v2frameids.cpp:117
TagParser
Contains all classes and functions of the TagInfo library.
Definition aaccodebook.h:10