Tag Parser  8.2.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 TAG_PARSER_ID3V2FRAMEIDS_H
2 #define TAG_PARSER_ID3V2FRAMEIDS_H
3 
4 #include <c++utilities/conversion/types.h>
5 
6 #include <string>
7 
8 namespace TagParser {
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, // FIXME: rename to lAlbumArtist in v9
32  lRecordLabel = 0x54505542,
33  lUniqueFileId = 0x55464944,
34  lComposer = 0x54434f4d,
35  lRating = 0x504f504d,
36  lUserDefinedText = 0x54585858,
37 
38  sAlbum = 0x54414c,
39  sArtist = 0x545031,
40  sComment = 0x434f4d,
41  sYear = 0x545945,
42  sRecordDate = 0x545243,
43  sTitle = 0x545432,
44  sGenre = 0x54434f,
45  sTrackPosition = 0x54524b,
46  sDiskPosition = 0x545041,
47  sEncoder = 0x54454e,
48  sBpm = 0x544250,
49  sCover = 0x504943,
50  sWriter = 0x545854,
51  sLength = 0x544c45,
52  sLanguage = 0x544c41,
53  sEncoderSettings = 0x545353,
55  sSynchronizedLyrics = 0x534C54,
56  sGrouping = 0x545032, // FIXME: rename to sAlbumArtist in v9
58  sRecordLabel = 0x545042,
59  sUniqueFileId = 0x554649,
60  sComposer = 0x54434d,
61  sRating = 0x504f50,
62  sUserDefinedText = 0x545858,
63 };
64 
65 uint32 convertToShortId(uint32 id);
66 uint32 convertToLongId(uint32 id);
67 
71 constexpr bool isLongId(uint32 id)
72 {
73  return (id & 0x00ffffff) != id;
74 }
75 
79 constexpr bool isShortId(uint32 id)
80 {
81  return (id & 0x00ffffff) == id;
82 }
83 
87 constexpr bool isTextFrame(uint32 id)
88 {
89  if (isShortId(id)) {
90  return ((id & 0x00FF0000u) == 0x00540000u) && (id != Id3v2FrameIds::sUserDefinedText);
91  } else {
92  return (id & 0xFF000000u) == 0x54000000u && (id != Id3v2FrameIds::lUserDefinedText);
93  }
94 }
95 
96 } // namespace Id3v2FrameIds
97 
98 } // namespace TagParser
99 #endif // TAG_PARSER_ID3V2FRAMEIDS_H
constexpr bool isLongId(uint32 id)
Returns an indication whether the specified id is a long frame id.
Definition: id3v2frameids.h:71
uint32 convertToLongId(uint32 id)
Converts the specified short frame ID to the equivalent long frame ID.
constexpr bool isShortId(uint32 id)
Returns an indication whether the specified id is a short frame id.
Definition: id3v2frameids.h:79
uint32 convertToShortId(uint32 id)
Converts the specified long frame ID to the equivalent short frame ID.
constexpr bool isTextFrame(uint32 id)
Returns an indication whether the specified id is a text frame id.
Definition: id3v2frameids.h:87
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:9