id3dev 26.01 An ID3 metadata library

Loading...
Searching...
No Matches
id3v2Types.h
Go to the documentation of this file.
1
11
12#ifndef ID3V2_TYPES
13#define ID3V2_TYPES
14
15#ifdef __cplusplus
16 extern "C" {
17#endif
18
19#include "id3v1/id3v1Types.h"
20#include <stdbool.h>
21#include <stdint.h>
22#include <inttypes.h>
23
24// data structures
25
26#include "id3dependencies/LinkedListLib/include/LinkedList.h"
27#include "id3dependencies/HashTableLib/include/hashTable.h"
28#include "id3dependencies/ByteStream/include/byteDefines.h"
29
31#define ID3V2_TAG_ID_SIZE 3
32
34#define ID3V2_TAG_ID_MAGIC_NUMBER_H 0x494433
35
37#define ID3V2_TAG_ID_MAGIC_NUMBER_F 0x334449
38
40#define ID3V2_TAG_VERSION_2 2
41
43#define ID3V2_TAG_VERSION_3 3
44
46#define ID3V2_TAG_VERSION_4 4
47
49#define ID3V2_ENCODING_ISO_8859_1 BYTE_ISO_8859_1
50
52#define ID3V2_ENCODING_UTF16LE BYTE_UTF16LE
53
55#define ID3V2_ENCODING_UTF16BE BYTE_UTF16BE
56
58#define ID3V2_ENCODING_UTF8 BYTE_UTF8
59
61#define ID3V2_ENCODING_ASCII BYTE_ASCII
62
64#define ID3V2_ENCODING_OTHER BYTE_OTHER_ENCODING
65
70#define ID3V2_FRAME_ID_MAX_SIZE 4
71
76#define ID3V2_FRAME_FLAG_SIZE 2
77
84 typedef struct _Id3v2ExtendedTagHeader {
86 uint32_t padding;
87
89 uint32_t crc;
90
92 bool update;
93
95 bool tagRestrictions;
96
102 uint8_t restrictions;
103} Id3v2ExtendedTagHeader;
104
111 typedef struct _Id3v2TagHeader {
113 uint8_t majorVersion;
114
116 uint8_t minorVersion;
117
122 uint8_t flags;
123
125 Id3v2ExtendedTagHeader *extendedHeader;
126} Id3v2TagHeader;
127
132 typedef struct _Id3v2FrameHeader {
134 uint8_t id[ID3V2_FRAME_ID_MAX_SIZE];
135
137 bool tagAlterPreservation;
138
140 bool fileAlterPreservation;
141
143 bool readOnly;
144
146 bool unsynchronisation;
147
149 uint32_t decompressionSize;
150
152 uint8_t encryptionSymbol;
153
155 uint8_t groupSymbol;
156} Id3v2FrameHeader;
157
162 typedef enum _Id3v2ContextType {
167 unknown_context = -1,
168
173 noEncoding_context,
174
179 binary_context,
180
185 encodedString_context,
186
191 latin1Encoding_context,
192
197 numeric_context,
198
203 precision_context,
204
215 bit_context,
216
221 iter_context,
222
227 adjustment_context
228} Id3v2ContextType;
229
237 typedef struct _Id3v2ContentContext {
239 Id3v2ContextType type;
240
242 size_t key;
243
248 size_t min;
249
254 size_t max;
255} Id3v2ContentContext;
256
263 typedef struct _Id3v2ContentEntry {
265 void *entry;
266
268 size_t size;
269} Id3v2ContentEntry;
270
277 typedef struct _Id3v2Frame {
279 Id3v2FrameHeader *header;
280
282 List *contexts;
283
285 List *entries;
286} Id3v2Frame;
287
294 typedef struct _Id3v2Tag {
296 Id3v2TagHeader *header;
297
299 List *frames;
300} Id3v2Tag;
301
302#ifdef __cplusplus
303} // extern c end
304#endif
305
306#endif
id3v1Types.h
Definitions for ID3v1 tag structure, constants, and genre enumeration.
Id3v2ContentEntry
struct _Id3v2ContentEntry Id3v2ContentEntry
Parsed data field from an ID3v2 frame.
Id3v2ContentContext
struct _Id3v2ContentContext Id3v2ContentContext
Parsing instructions for a single field within an ID3v2 frame.
Id3v2Tag
struct _Id3v2Tag Id3v2Tag
Complete ID3v2 tag structure containing header and metadata frames.
ID3V2_FRAME_ID_MAX_SIZE
#define ID3V2_FRAME_ID_MAX_SIZE
Maximum size in bytes for a frame ID field (4 bytes).
Definition id3v2Types.h:70
_Id3v2ContextType
_Id3v2ContextType
Context types for parsing and writing ID3v2 frame content fields.
Definition id3v2Types.h:162
noEncoding_context
@ noEncoding_context
Raw character data with no encoding or null terminator.
Definition id3v2Types.h:173
iter_context
@ iter_context
Iterator for repeating context sequences.
Definition id3v2Types.h:221
numeric_context
@ numeric_context
Integer values of 8, 16, 32, or 64 bits.
Definition id3v2Types.h:197
encodedString_context
@ encodedString_context
Text string with encoding determined by prior context with the key 'encoding'.
Definition id3v2Types.h:185
latin1Encoding_context
@ latin1Encoding_context
Latin-1 (ISO-8859-1) null-terminated string.
Definition id3v2Types.h:191
adjustment_context
@ adjustment_context
Dynamic upper bound adjustment based on prior context with key 'adjustment'.
Definition id3v2Types.h:227
binary_context
@ binary_context
Binary data block with no terminator.
Definition id3v2Types.h:179
bit_context
@ bit_context
Bit-level field (1-8 bits).
Definition id3v2Types.h:215
precision_context
@ precision_context
Floating-point values (float or double).
Definition id3v2Types.h:203
unknown_context
@ unknown_context
Error/invalid context state (-1).
Definition id3v2Types.h:167
Id3v2ExtendedTagHeader
struct _Id3v2ExtendedTagHeader Id3v2ExtendedTagHeader
Optional ID3v2 extended header containing supplementary tag metadata.
Id3v2ContextType
enum _Id3v2ContextType Id3v2ContextType
Context types for parsing and writing ID3v2 frame content fields.
Id3v2Frame
struct _Id3v2Frame Id3v2Frame
Complete ID3v2 frame structure with header, parsing contexts, and data.
Id3v2FrameHeader
struct _Id3v2FrameHeader Id3v2FrameHeader
ID3v2 frame header containing identification and processing flags.
Id3v2TagHeader
struct _Id3v2TagHeader Id3v2TagHeader
ID3v2 tag header containing version and parsing information.
_Id3v2ContentContext
Parsing instructions for a single field within an ID3v2 frame.
Definition id3v2Types.h:237
_Id3v2ContentContext::min
size_t min
Minimum size in bytes (or bits for bit_context, or start index for iter_context).
Definition id3v2Types.h:248
_Id3v2ContentContext::max
size_t max
Maximum size in bytes (or bits for bit_context, or iteration count for iter_context).
Definition id3v2Types.h:254
_Id3v2ContentContext::type
Id3v2ContextType type
Context type determining parsing behavior (string, binary, numeric, etc.)
Definition id3v2Types.h:239
_Id3v2ContentContext::key
size_t key
Hashed identifier string for this field. Used to reference this context from other contexts (e....
Definition id3v2Types.h:242
_Id3v2ContentEntry
Parsed data field from an ID3v2 frame.
Definition id3v2Types.h:263
_Id3v2ContentEntry::size
size_t size
Size in bytes of the data pointed to by entry.
Definition id3v2Types.h:268
_Id3v2ContentEntry::entry
void * entry
Pointer to extracted field data (string, binary, numeric, etc.). Type determined by corresponding con...
Definition id3v2Types.h:265
_Id3v2ExtendedTagHeader
Optional ID3v2 extended header containing supplementary tag metadata.
Definition id3v2Types.h:84
_Id3v2ExtendedTagHeader::restrictions
uint8_t restrictions
Bitfield defining tag restrictions in format ppqrrstt (ID3v2.4 only).
Definition id3v2Types.h:102
_Id3v2ExtendedTagHeader::crc
uint32_t crc
CRC-32 checksum of the tag's audio data for integrity verification.
Definition id3v2Types.h:89
_Id3v2ExtendedTagHeader::padding
uint32_t padding
Size of the extended header as either a 32-bit integer or syncsafe integer depending on version.
Definition id3v2Types.h:86
_Id3v2ExtendedTagHeader::update
bool update
Indicates this tag is an update to a previous tag (ID3v2.4 only)
Definition id3v2Types.h:92
_Id3v2ExtendedTagHeader::tagRestrictions
bool tagRestrictions
Indicates whether tag restrictions are applied.
Definition id3v2Types.h:95
_Id3v2FrameHeader
ID3v2 frame header containing identification and processing flags.
Definition id3v2Types.h:132
_Id3v2FrameHeader::groupSymbol
uint8_t groupSymbol
Group identifier to associate related frames. 0 if frame is not grouped.
Definition id3v2Types.h:155
_Id3v2FrameHeader::fileAlterPreservation
bool fileAlterPreservation
Marks the frame as unknown if the file is altered.
Definition id3v2Types.h:140
_Id3v2FrameHeader::readOnly
bool readOnly
Marks the frame as read only. If true, frame content is read-only and should not be modified.
Definition id3v2Types.h:143
_Id3v2FrameHeader::encryptionSymbol
uint8_t encryptionSymbol
Encryption method identifier. 0 if frame is not encrypted.
Definition id3v2Types.h:152
_Id3v2FrameHeader::tagAlterPreservation
bool tagAlterPreservation
Marks the frame as unknown if the tag is altered.
Definition id3v2Types.h:137
_Id3v2FrameHeader::unsynchronisation
bool unsynchronisation
Marks a tag as unsynchronised.
Definition id3v2Types.h:146
_Id3v2FrameHeader::decompressionSize
uint32_t decompressionSize
Decompressed size in bytes if frame uses zlib compression. 0 if uncompressed.
Definition id3v2Types.h:149
_Id3v2Frame
Complete ID3v2 frame structure with header, parsing contexts, and data.
Definition id3v2Types.h:277
_Id3v2Frame::header
Id3v2FrameHeader * header
Frame header containing ID, flags, and processing parameters.
Definition id3v2Types.h:279
_Id3v2Frame::contexts
List * contexts
Linked list of Id3v2ContentContext parsing instructions defining frame field structure.
Definition id3v2Types.h:282
_Id3v2Frame::entries
List * entries
Linked list of Id3v2ContentEntry parsed data fields corresponding to contexts.
Definition id3v2Types.h:285
_Id3v2TagHeader
ID3v2 tag header containing version and parsing information.
Definition id3v2Types.h:111
_Id3v2TagHeader::minorVersion
uint8_t minorVersion
Minor version/revision number.
Definition id3v2Types.h:116
_Id3v2TagHeader::extendedHeader
Id3v2ExtendedTagHeader * extendedHeader
Pointer to optional extended header structure. NULL if extended header flag not set.
Definition id3v2Types.h:125
_Id3v2TagHeader::majorVersion
uint8_t majorVersion
Major version number (2, 3, or 4 for ID3v2.2, ID3v2.3, ID3v2.4)
Definition id3v2Types.h:113
_Id3v2TagHeader::flags
uint8_t flags
Bitfield in format abcd0000 defining extra format and feature options of a tag.
Definition id3v2Types.h:122
_Id3v2Tag
Complete ID3v2 tag structure containing header and metadata frames.
Definition id3v2Types.h:294
_Id3v2Tag::frames
List * frames
Linked list of Id3v2Frame structures containing all tag metadata.
Definition id3v2Types.h:299
_Id3v2Tag::header
Id3v2TagHeader * header
Tag header with version, flags, and optional extended header.
Definition id3v2Types.h:296