Tag Parser  10.0.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
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 
10 namespace 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  lTaggingTime = 0x54445447,
26  lTitle = 0x54495432,
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  lRecordLabel = 0x54505542,
42  lUniqueFileId = 0x55464944,
43  lComposer = 0x54434f4d,
44  lRating = 0x504f504d,
45  lUserDefinedText = 0x54585858,
47  sAlbum = 0x54414c,
48  sArtist = 0x545031,
49  sComment = 0x434f4d,
50  sYear = 0x545945,
51  sOriginalYear = 0x544F5259,
52  sRecordingDates = 0x545244,
53  sDate = 0x544441,
54  sTime = 0x54494D,
55  sTitle = 0x545432,
56  sGenre = 0x54434f,
57  sTrackPosition = 0x54524b,
58  sDiskPosition = 0x545041,
59  sEncoder = 0x54454e,
60  sBpm = 0x544250,
61  sCover = 0x504943,
62  sWriter = 0x545854,
63  sLength = 0x544c45,
64  sLanguage = 0x544c41,
65  sEncoderSettings = 0x545353,
66  sUnsynchronizedLyrics = 0x554C54,
67  sSynchronizedLyrics = 0x534C54,
68  sAlbumArtist = 0x545032,
70  sRecordLabel = 0x545042,
71  sUniqueFileId = 0x554649,
72  sComposer = 0x54434d,
73  sRating = 0x504f50,
74  sUserDefinedText = 0x545858,
75 };
76 
77 TAG_PARSER_EXPORT std::uint32_t convertToShortId(std::uint32_t id);
78 TAG_PARSER_EXPORT std::uint32_t convertToLongId(std::uint32_t id);
79 TAG_PARSER_EXPORT bool isPreId3v24Id(std::uint32_t id);
80 TAG_PARSER_EXPORT bool isOnlyId3v24Id(std::uint32_t id);
81 
85 constexpr bool isLongId(std::uint32_t id)
86 {
87  return (id & 0x00ffffff) != id;
88 }
89 
93 constexpr bool isShortId(std::uint32_t id)
94 {
95  return (id & 0x00ffffff) == id;
96 }
97 
101 constexpr bool isTextFrame(std::uint32_t id)
102 {
103  if (isShortId(id)) {
104  return ((id & 0x00FF0000u) == 0x00540000u) && (id != Id3v2FrameIds::sUserDefinedText);
105  } else {
106  return (id & 0xFF000000u) == 0x54000000u && (id != Id3v2FrameIds::lUserDefinedText);
107  }
108 }
109 
110 } // namespace Id3v2FrameIds
111 
112 } // namespace TagParser
113 #endif // TAG_PARSER_ID3V2FRAMEIDS_H
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
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.
Definition: id3v2frameids.h:85
constexpr bool isTextFrame(std::uint32_t id)
Returns an indication whether the specified id is a text frame id.
constexpr bool isShortId(std::uint32_t id)
Returns an indication whether the specified id is a short frame id.
Definition: id3v2frameids.h:93
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