Tag Parser: id3/id3v2frameids.cpp 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.cpp
Go to the documentation of this file.
1#include "./id3v2frameids.h"
2
3#include "../exceptions.h"
4
5namespace TagParser {
6
21namespace Id3v2FrameIds {
22
27std::uint32_t convertToShortId(std::uint32_t id)
28{
29 switch (id) {
30 case lAlbum:
31 return sAlbum;
32 case lArtist:
33 return sArtist;
34 case lComment:
35 return sComment;
36 case lYear:
37 return sYear;
38 case lOriginalYear:
39 return sOriginalYear;
40 case lOriginalMediaType:
41 return sOriginalMediaType;
42 case lRecordingDates:
43 return sRecordingDates;
44 case lDate:
45 return sDate;
46 case lTime:
47 return sTime;
48 case lTitle:
49 return sTitle;
50 case lGenre:
51 return sGenre;
52 case lTrackPosition:
53 return sTrackPosition;
54 case lDiskPosition:
55 return sDiskPosition;
56 case lEncoder:
57 return sEncoder;
58 case lBpm:
59 return sBpm;
60 case lCover:
61 return sCover;
62 case lWriter:
63 return sWriter;
64 case lLength:
65 return sLength;
66 case lLanguage:
67 return sLanguage;
68 case lEncoderSettings:
69 return sEncoderSettings;
70 case lUnsynchronizedLyrics:
71 return sUnsynchronizedLyrics;
72 case lAlbumArtist:
73 return sAlbumArtist;
74 case lContentGroupDescription:
75 return sContentGroupDescription;
76 case lRecordLabel:
77 return sRecordLabel;
78 case lUserDefinedText:
79 return sUserDefinedText;
80 case lRemixedBy:
81 return sRemixedBy;
82 case lCopyright:
83 return sCopyright;
84 case lPlayCounter:
85 return sPlayCounter;
86 case lRating:
87 return sRating;
88 case lISRC:
89 return sISRC;
90 case lKey:
91 return sKey;
92 case lPublisherWebpage:
93 return sPublisherWebpage;
94 case lCommericalInfoWebpage:
95 return sCommericalInfoWebpage;
96 case lCopyrightInfoWebpage:
97 return sCopyrightInfoWebpage;
98 case lAudioFileWebpage:
99 return sAudioFileWebpage;
100 case lAudioSourceWebpage:
101 return sAudioSourceWebpage;
102 case lPerformerWebpage:
103 return sPerformerWebpage;
104 case lUserDefinedURL:
105 return sUserDefinedURL;
106 case lSubtitleOrDescriptionRefinement:
107 return sSubtitleOrDescriptionRefinement;
108 default:
109 return 0;
110 }
111}
112
117std::uint32_t convertToLongId(std::uint32_t id)
118{
119 switch (id) {
120 case sAlbum:
121 return lAlbum;
122 case sArtist:
123 return lArtist;
124 case sComment:
125 return lComment;
126 case sYear:
127 return lYear;
128 case sOriginalYear:
129 return lOriginalYear;
130 case sOriginalMediaType:
131 return lOriginalMediaType;
132 case sRecordingDates:
133 return lRecordingDates;
134 case sDate:
135 return lDate;
136 case sTime:
137 return lTime;
138 case sTitle:
139 return lTitle;
140 case sGenre:
141 return lGenre;
142 case sTrackPosition:
143 return lTrackPosition;
144 case sDiskPosition:
145 return lDiskPosition;
146 case sEncoder:
147 return lEncoder;
148 case sBpm:
149 return lBpm;
150 case sCover:
151 return lCover;
152 case sWriter:
153 return lWriter;
154 case sLength:
155 return lLength;
156 case sLanguage:
157 return lLanguage;
158 case sEncoderSettings:
159 return lEncoderSettings;
160 case sUnsynchronizedLyrics:
161 return lUnsynchronizedLyrics;
162 case sAlbumArtist:
163 return lAlbumArtist;
164 case sContentGroupDescription:
165 return lContentGroupDescription;
166 case sRecordLabel:
167 return lRecordLabel;
168 case sUserDefinedText:
169 return lUserDefinedText;
170 case sRemixedBy:
171 return lRemixedBy;
172 case sCopyright:
173 return lCopyright;
174 case sPlayCounter:
175 return lPlayCounter;
176 case sRating:
177 return lRating;
178 case sISRC:
179 return lISRC;
180 case sKey:
181 return lKey;
182 case sPublisherWebpage:
183 return lPublisherWebpage;
184 case sCommericalInfoWebpage:
185 return lCommericalInfoWebpage;
186 case sCopyrightInfoWebpage:
187 return lCopyrightInfoWebpage;
188 case sAudioFileWebpage:
189 return lAudioFileWebpage;
190 case sAudioSourceWebpage:
191 return lAudioSourceWebpage;
192 case sPerformerWebpage:
193 return lPerformerWebpage;
194 case sUserDefinedURL:
195 return lUserDefinedURL;
196 case sSubtitleOrDescriptionRefinement:
197 return lSubtitleOrDescriptionRefinement;
198 default:
199 return 0;
200 }
201}
202
210 bool isPreId3v24Id(uint32_t id)
211{
212 switch (id) {
213 case lYear:
214 case lOriginalYear:
215 case lRecordingDates:
216 case lDate:
217 case lTime:
218 return true;
219 default:
220 return false;
221 }
222}
223
228 bool isOnlyId3v24Id(uint32_t id)
229{
230 switch (id) {
231 case lRecordingTime:
232 case lReleaseTime:
233 case lOriginalReleaseTime:
234 case lTaggingTime:
235 return true;
236 default:
237 return false;
238 }
239}
240
241} // namespace Id3v2FrameIds
242
243} // namespace TagParser
exceptions.h
id3v2frameids.h
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::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::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::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::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::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::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::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::sUserDefinedURL
@ sUserDefinedURL
Definition id3v2frameids.h:107
TagParser::Id3v2FrameIds::sCover
@ sCover
Definition id3v2frameids.h:80
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::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