id3dev 26.01 An ID3 metadata library

Loading...
Searching...
No Matches
id3v2.h
Go to the documentation of this file.
1
11
12#ifndef ID3V2
13#define ID3V2
14
15#ifdef __cplusplus
16 extern "C"{
17#endif
18
19#include "id3v2Types.h"
20#include "id3v2TagIdentity.h" // included due to dependency on freeing memory
21
22
23 Id3v2Tag *id3v2TagFromFile(const char *filename);
24
25 Id3v2Tag *id3v2CopyTag(const Id3v2Tag *toCopy);
26
27// util functions
28
29 bool id3v2CompareTag(Id3v2Tag *tag1, Id3v2Tag *tag2);
30
31 Id3v2Frame *id3v2ReadFrameByID(const char id[ID3V2_FRAME_ID_MAX_SIZE], Id3v2Tag *tag);
32
33 int id3v2RemoveFrameByID(const char *id, Id3v2Tag *tag);
34
35 int id3v2InsertTextFrame(const char id[ID3V2_FRAME_ID_MAX_SIZE], const uint8_t encoding, const char *string,
36 Id3v2Tag *tag);
37
38 int id3v2ReadTagVersion(const Id3v2Tag *tag);
39
40// compatability functions a.k.a getters
41
42 char *id3v2ReadTextFrameContent(const char id[ID3V2_FRAME_ID_MAX_SIZE], Id3v2Tag *tag);
43
44 char *id3v2ReadTitle(Id3v2Tag *tag);
45
46 char *id3v2ReadArtist(Id3v2Tag *tag);
47
48 char *id3v2ReadAlbumArtist(Id3v2Tag *tag);
49
50 char *id3v2ReadAlbum(Id3v2Tag *tag);
51
52 char *id3v2ReadYear(Id3v2Tag *tag);
53
54 char *id3v2ReadGenre(Id3v2Tag *tag);
55
56 char *id3v2ReadTrack(Id3v2Tag *tag);
57
58 char *id3v2ReadComposer(Id3v2Tag *tag);
59
60 char *id3v2ReadDisc(Id3v2Tag *tag);
61
62 char *id3v2ReadLyrics(Id3v2Tag *tag);
63
64 char *id3v2ReadComment(Id3v2Tag *tag);
65
66uint8_t *id3v2ReadPicture(uint8_t type, const Id3v2Tag *tag, size_t *dataSize);
67
68// change values within an id3v2 structure
69
70 int id3v2WriteTextFrameContent(const char id[ID3V2_FRAME_ID_MAX_SIZE], const char *string, Id3v2Tag *tag);
71
72 int id3v2WriteTitle(const char *title, Id3v2Tag *tag);
73
74 int id3v2WriteArtist(const char *artist, Id3v2Tag *tag);
75
76 int id3v2WriteAlbumArtist(const char *albumArtist, Id3v2Tag *tag);
77
78 int id3v2WriteAlbum(const char *album, Id3v2Tag *tag);
79
80 int id3v2WriteYear(const char *year, Id3v2Tag *tag);
81
82 int id3v2WriteGenre(const char *genre, Id3v2Tag *tag);
83
84 int id3v2WriteTrack(const char *track, Id3v2Tag *tag);
85
86 int id3v2WriteDisc(const char *disc, Id3v2Tag *tag);
87
88 int id3v2WriteComposer(const char *composer, Id3v2Tag *tag);
89
90 int id3v2WriteLyrics(const char *lyrics, Id3v2Tag *tag);
91
92 int id3v2WriteComment(const char *comment, Id3v2Tag *tag);
93
94 int id3v2WritePicture(uint8_t *image, size_t imageSize, const char *kind, uint8_t type, Id3v2Tag *tag);
95
96 int id3v2WritePictureFromFile(const char *filename, const char *kind, uint8_t type, Id3v2Tag *tag);
97
98// writes
99
100uint8_t *id3v2TagSerialize(Id3v2Tag *tag, size_t *outl);
101
102 char *id3v2TagToJSON(Id3v2Tag *tag);
103
104 int id3v2WriteTagToFile(const char *filename, Id3v2Tag *tag);
105
106#ifdef __cplusplus
107} //extern c end
108#endif
109
110#endif
id3v2WriteLyrics
int id3v2WriteLyrics(const char *lyrics, Id3v2Tag *tag)
Writes lyrics to the appropriate unsynchronized lyrics frame in a tag.
Definition id3v2.c:1290
id3v2ReadAlbum
char * id3v2ReadAlbum(Id3v2Tag *tag)
Extracts the album name from an ID3v2 tag.
Definition id3v2.c:483
id3v2TagSerialize
uint8_t * id3v2TagSerialize(Id3v2Tag *tag, size_t *outl)
Serializes an ID3v2 tag structure to its binary representation.
Definition id3v2.c:1984
id3v2WriteGenre
int id3v2WriteGenre(const char *genre, Id3v2Tag *tag)
Writes the genre/content type to an ID3v2 tag.
Definition id3v2.c:1077
id3v2CompareTag
bool id3v2CompareTag(Id3v2Tag *tag1, Id3v2Tag *tag2)
Performs deep structural comparison of two ID3v2 tags for equality.
Definition id3v2.c:89
id3v2WritePictureFromFile
int id3v2WritePictureFromFile(const char *filename, const char *kind, uint8_t type, Id3v2Tag *tag)
Reads a picture from a file and writes it to the appropriate attached picture frame in a tag.
Definition id3v2.c:1932
id3v2ReadGenre
char * id3v2ReadGenre(Id3v2Tag *tag)
Extracts the genre/content type from an ID3v2 tag.
Definition id3v2.c:541
id3v2WriteYear
int id3v2WriteYear(const char *year, Id3v2Tag *tag)
Writes the year to an ID3v2 tag.
Definition id3v2.c:1051
id3v2ReadTrack
char * id3v2ReadTrack(Id3v2Tag *tag)
Extracts the track number/position from an ID3v2 tag.
Definition id3v2.c:570
id3v2ReadYear
char * id3v2ReadYear(Id3v2Tag *tag)
Extracts the year from an ID3v2 tag.
Definition id3v2.c:512
id3v2ReadTitle
char * id3v2ReadTitle(Id3v2Tag *tag)
Extracts the title/song name from an ID3v2 tag.
Definition id3v2.c:396
id3v2ReadAlbumArtist
char * id3v2ReadAlbumArtist(Id3v2Tag *tag)
Extracts the album artist/band/orchestra from an ID3v2 tag.
Definition id3v2.c:454
id3v2WritePicture
int id3v2WritePicture(uint8_t *image, size_t imageSize, const char *kind, uint8_t type, Id3v2Tag *tag)
Writes a picture to the appropriate attached picture frame in a tag.
Definition id3v2.c:1794
id3v2ReadComment
char * id3v2ReadComment(Id3v2Tag *tag)
Extracts the comment text from an ID3v2 tag.
Definition id3v2.c:727
id3v2ReadPicture
uint8_t * id3v2ReadPicture(uint8_t type, const Id3v2Tag *tag, size_t *dataSize)
Extracts picture/artwork data of a specific type from an ID3v2 tag.
Definition id3v2.c:797
id3v2ReadTextFrameContent
char * id3v2ReadTextFrameContent(const char id[ID3V2_FRAME_ID_MAX_SIZE], Id3v2Tag *tag)
Extracts the text content from a text frame with the specified ID.
Definition id3v2.c:337
id3v2WriteTextFrameContent
int id3v2WriteTextFrameContent(const char id[ID3V2_FRAME_ID_MAX_SIZE], const char *string, Id3v2Tag *tag)
Writes UTF-8 text content to a text frame, creating it if necessary.
Definition id3v2.c:836
id3v2ReadComposer
char * id3v2ReadComposer(Id3v2Tag *tag)
Extracts the composer from an ID3v2 tag.
Definition id3v2.c:599
id3v2ReadTagVersion
int id3v2ReadTagVersion(const Id3v2Tag *tag)
Retrieves the major version number from an ID3v2 tag.
Definition id3v2.c:316
id3v2WriteAlbumArtist
int id3v2WriteAlbumArtist(const char *albumArtist, Id3v2Tag *tag)
Writes the album artist/band/orchestra to an ID3v2 tag.
Definition id3v2.c:999
id3v2ReadArtist
char * id3v2ReadArtist(Id3v2Tag *tag)
Extracts the lead artist/performer from an ID3v2 tag.
Definition id3v2.c:425
id3v2InsertTextFrame
int id3v2InsertTextFrame(const char id[ID3V2_FRAME_ID_MAX_SIZE], const uint8_t encoding, const char *string, Id3v2Tag *tag)
Creates and inserts a new text frame with the specified encoding into a tag.
Definition id3v2.c:235
id3v2WriteDisc
int id3v2WriteDisc(const char *disc, Id3v2Tag *tag)
Writes a disc number to the appropriate disc number frame in a tag.
Definition id3v2.c:1129
id3v2ReadDisc
char * id3v2ReadDisc(Id3v2Tag *tag)
Extracts the disc number/position from an ID3v2 tag.
Definition id3v2.c:628
id3v2WriteComposer
int id3v2WriteComposer(const char *composer, Id3v2Tag *tag)
Writes a composer name to the appropriate composer frame in a tag.
Definition id3v2.c:1155
id3v2TagFromFile
Id3v2Tag * id3v2TagFromFile(const char *filename)
Reads and parses an ID3v2 tag from a file.
Definition id3v2.c:31
id3v2WriteTagToFile
int id3v2WriteTagToFile(const char *filename, Id3v2Tag *tag)
Writes an ID3v2 tag to a file, creating, prepending, or replacing as needed.
Definition id3v2.c:2317
id3v2CopyTag
Id3v2Tag * id3v2CopyTag(const Id3v2Tag *toCopy)
Creates a deep copy of an ID3v2 tag structure.
Definition id3v2.c:57
id3v2ReadFrameByID
Id3v2Frame * id3v2ReadFrameByID(const char id[ID3V2_FRAME_ID_MAX_SIZE], Id3v2Tag *tag)
Searches for and returns a copy of the first frame matching the given ID.
Definition id3v2.c:173
id3v2WriteTitle
int id3v2WriteTitle(const char *title, Id3v2Tag *tag)
Writes the title/song name to an ID3v2 tag.
Definition id3v2.c:947
id3v2TagToJSON
char * id3v2TagToJSON(Id3v2Tag *tag)
Serializes an ID3v2 tag structure to JSON format.
Definition id3v2.c:2184
id3v2WriteArtist
int id3v2WriteArtist(const char *artist, Id3v2Tag *tag)
Writes the lead artist/performer to an ID3v2 tag.
Definition id3v2.c:973
id3v2WriteTrack
int id3v2WriteTrack(const char *track, Id3v2Tag *tag)
Writes the track number/position to an ID3v2 tag.
Definition id3v2.c:1103
id3v2WriteAlbum
int id3v2WriteAlbum(const char *album, Id3v2Tag *tag)
Writes the album name to an ID3v2 tag.
Definition id3v2.c:1025
id3v2RemoveFrameByID
int id3v2RemoveFrameByID(const char *id, Id3v2Tag *tag)
Locates and removes the first frame matching the given ID from a tag.
Definition id3v2.c:208
id3v2ReadLyrics
char * id3v2ReadLyrics(Id3v2Tag *tag)
Extracts unsynchronised lyrics/text transcription from an ID3v2 tag.
Definition id3v2.c:658
id3v2WriteComment
int id3v2WriteComment(const char *comment, Id3v2Tag *tag)
Writes a comment to the appropriate comment frame in a tag.
Definition id3v2.c:1553
id3v2TagIdentity.h
Function definitions of ID3v2 tag header and tag structure creation, manipulation,...
id3v2Types.h
Definitions for ID3v2.x tag structure, constants, and genre enumeration.
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
Id3v2Frame
struct _Id3v2Frame Id3v2Frame
Complete ID3v2 frame structure with header, parsing contexts, and data.