Tag Parser 12.4.0
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
12namespace Id3v2FrameIds {
13enum 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 lTitle = 0x54495432,
28 lGenre = 0x54434f4e,
29 lTrackPosition = 0x5452434b,
30 lDiskPosition = 0x54504f53,
31 lEncoder = 0x54454e43,
32 lBpm = 0x5442504d,
33 lCover = 0x41504943,
34 lWriter = 0x54455854,
35 lLength = 0x544c454e,
36 lLanguage = 0x544c414e,
37 lEncoderSettings = 0x54535345,
38 lUnsynchronizedLyrics = 0x55534c54,
39 lSynchronizedLyrics = 0x53594C54,
40 lAlbumArtist = 0x54504532,
42 lRecordLabel = 0x54505542,
43 lUniqueFileId = 0x55464944,
44 lComposer = 0x54434f4d,
45 lPlayCounter = 0x50434E54,
46 lRating = 0x504f504d,
47 lRemixedBy = 0x54504534,
48 lCopyright = 0x54434F50,
49 lEncodingTime = 0x5444454E,
50 lMood = 0x544D4F4F,
51 lISRC = 0x54535243,
52 lKey = 0x544B4559,
53 lUserDefinedText = 0x54585858,
55 lCopyrightInfoWebpage = 0x57434F50,
56 lAudioFileWebpage = 0x574F4146,
57 lAudioSourceWebpage = 0x574F4153,
59 lPaymentWebpage = 0x57504159,
60 lPublisherWebpage = 0x57505542,
61 lPerformerWebpage = 0x574F4152,
62 lUserDefinedURL = 0x57585858,
64 sAlbum = 0x54414c,
65 sArtist = 0x545031,
66 sComment = 0x434f4d,
67 sYear = 0x545945,
68 sOriginalYear = 0x544F52,
69 sOriginalMediaType = 0x544D54,
70 sRecordingDates = 0x545244,
71 sDate = 0x544441,
72 sTime = 0x54494D,
73 sTitle = 0x545432,
74 sGenre = 0x54434f,
75 sTrackPosition = 0x54524b,
76 sDiskPosition = 0x545041,
77 sEncoder = 0x54454e,
78 sBpm = 0x544250,
79 sCover = 0x504943,
80 sWriter = 0x545854,
81 sLength = 0x544c45,
82 sLanguage = 0x544c41,
83 sEncoderSettings = 0x545353,
86 sAlbumArtist = 0x545032,
88 sRecordLabel = 0x545042,
89 sUniqueFileId = 0x554649,
90 sComposer = 0x54434d,
91 sPlayCounter = 0x434E54,
92 sRating = 0x504f50,
93 sRemixedBy = 0x545034,
94 sCopyright = 0x544352,
95 sISRC = 0x545243,
96 sKey = 0x544B45,
97 sUserDefinedText = 0x545858,
100 sAudioFileWebpage = 0x574146,
102 sPublisherWebpage = 0x575042,
103 sPerformerWebpage = 0x574152,
104 sUserDefinedURL = 0x575858,
105};
106
107TAG_PARSER_EXPORT std::uint32_t convertToShortId(std::uint32_t id);
108TAG_PARSER_EXPORT std::uint32_t convertToLongId(std::uint32_t id);
109TAG_PARSER_EXPORT bool isPreId3v24Id(std::uint32_t id);
110TAG_PARSER_EXPORT bool isOnlyId3v24Id(std::uint32_t id);
111
115constexpr bool isLongId(std::uint32_t id)
116{
117 return (id & 0x00ffffff) != id;
118}
119
123constexpr bool isShortId(std::uint32_t id)
124{
125 return (id & 0x00ffffff) == id;
126}
127
131constexpr bool isTextFrame(std::uint32_t id)
132{
133 if (isShortId(id)) {
134 return ((id & 0x00FF0000u) == 0x00540000u) && (id != Id3v2FrameIds::sUserDefinedText);
135 } else {
136 return (id & 0xFF000000u) == 0x54000000u && (id != Id3v2FrameIds::lUserDefinedText);
137 }
138}
139
143constexpr bool isUrlFrame(std::uint32_t id)
144{
145 if (isShortId(id)) {
146 return ((id & 0x00FF0000u) == 0x00570000u) && (id != Id3v2FrameIds::sUserDefinedURL);
147 } else {
148 return (id & 0xFF000000u) == 0x57000000u && (id != Id3v2FrameIds::lUserDefinedURL);
149 }
150}
151
152} // namespace Id3v2FrameIds
153
154} // namespace TagParser
155#endif // TAG_PARSER_ID3V2FRAMEIDS_H
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Definition global.h:14
TAG_PARSER_EXPORT bool isPreId3v24Id(std::uint32_t id)
TAG_PARSER_EXPORT std::uint32_t convertToShortId(std::uint32_t id)
Converts the specified long frame ID to the equivalent short frame ID.
constexpr bool isLongId(std::uint32_t id)
Returns an indication whether the specified id is a long frame id.
constexpr bool isTextFrame(std::uint32_t id)
Returns an indication whether the specified id is a text frame id.
constexpr bool isUrlFrame(std::uint32_t id)
Returns an indication whether the specified id is a URL frame id.
constexpr bool isShortId(std::uint32_t id)
Returns an indication whether the specified id is a short frame id.
TAG_PARSER_EXPORT bool isOnlyId3v24Id(std::uint32_t id)
TAG_PARSER_EXPORT std::uint32_t convertToLongId(std::uint32_t id)
Converts the specified short frame ID to the equivalent long frame ID.
Contains all classes and functions of the TagInfo library.
Definition aaccodebook.h:10