Tag Parser  6.5.0
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 ID3V2FRAMEIDS_H
2 #define ID3V2FRAMEIDS_H
3 
4 #include <c++utilities/conversion/types.h>
5 
6 #include <string>
7 
8 namespace Media {
9 
10 namespace Id3v2FrameIds {
11 enum KnownValue : uint32 {
12  lAlbum = 0x54414c42,
13  lArtist = 0x54504531,
14  lComment = 0x434f4d4d,
15  lYear = 0x54594552,
16  lRecordDate = 0x54445243,
17  lTitle = 0x54495432,
18  lGenre = 0x54434f4e,
19  lTrackPosition = 0x5452434b,
20  lDiskPosition = 0x54504f53,
21  lEncoder = 0x54454e43,
22  lBpm = 0x5442504d,
23  lCover = 0x41504943,
24  lWriter = 0x54455854,
25  lLength = 0x544c454e,
26  lLanguage = 0x544c414e,
27  lEncoderSettings = 0x54535345,
28  lUnsynchronizedLyrics = 0x55534c54,
29  lSynchronizedLyrics = 0x53594C54,
30  lGrouping = 0x54504532,
31  lRecordLabel = 0x54505542,
32  lUniqueFileId = 0x55464944,
33  lComposer = 0x54434f4d,
34  lRating = 0x504f504d,
35  lUserDefinedText = 0x54585858,
36 
37  sAlbum = 0x54414c,
38  sArtist = 0x545031,
39  sComment = 0x434f4d,
40  sYear = 0x545945,
41  sRecordDate = 0x545243,
42  sTitle = 0x545432,
43  sGenre = 0x54434f,
44  sTrackPosition = 0x54524b,
45  sEncoder = 0x54454e,
46  sBpm = 0x544250,
47  sCover = 0x504943,
48  sWriter = 0x545854,
49  sLength = 0x544c45,
50  sLanguage = 0x544c41,
51  sEncoderSettings = 0x545353,
53  sSynchronizedLyrics = 0x534C54,
54  sGrouping = 0x545032,
55  sRecordLabel = 0x545042,
56  sUniqueFileId = 0x554649,
57  sComposer = 0x54434d,
58  sRating = 0x504f50,
59  sUserDefinedText = 0x545858,
60 };
61 
62 uint32 convertToShortId(uint32 id);
63 uint32 convertToLongId(uint32 id);
64 
68 inline bool isLongId(uint32 id)
69 {
70  return (id & 0x00ffffff) != id;
71 }
72 
76 inline bool isShortId(uint32 id)
77 {
78  return (id & 0x00ffffff) == id;
79 }
80 
84 inline bool isTextFrame(uint32 id)
85 {
86  if(isShortId(id)) {
87  return ((id & 0x00FF0000u) == 0x00540000u) && (id != Id3v2FrameIds::sUserDefinedText);
88  } else {
89  return (id & 0xFF000000u) == 0x54000000u && (id != Id3v2FrameIds::lUserDefinedText);
90  }
91 }
92 
93 }
94 
95 }
96 #endif // ID3V2FRAMEIDS_H
bool isLongId(uint32 id)
Returns an indication whether the specified id is a long frame id.
Definition: id3v2frameids.h:68
bool isShortId(uint32 id)
Returns an indication whether the specified id is a short frame id.
Definition: id3v2frameids.h:76
uint32 convertToShortId(uint32 id)
Converts the specified long frame ID to the equivalent short frame ID.
bool isTextFrame(uint32 id)
Returns an indication whether the specified id is a text frame id.
Definition: id3v2frameids.h:84
uint32 convertToLongId(uint32 id)
Converts the specified short frame ID to the equivalent long frame ID.
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9