id3dev 26.01
An ID3 metadata library
Loading...
Searching...
No Matches
id3dev.h
Go to the documentation of this file.
1
11
12#ifndef ID3DEV
13#define ID3DEV
14
15#ifdef __cplusplus
16extern "C"{
17#endif
18
19#include "id3v1/id3v1Types.h"
20#include "id3v2/id3v2Types.h"
21
32
33// mem
34
35ID3 *id3Create(Id3v2Tag *id3v2, Id3v1Tag *id3v1);
36
37void id3Destroy(ID3 **toDelete);
38
39// util functions
40
41bool id3SetPreferredStandard(uint8_t standard);
42
43uint8_t id3GetPreferredStandard(void);
44
45ID3 *id3FromFile(const char *filePath);
46
47ID3 *id3Copy(const ID3 *toCopy);
48
49bool id3Compare(const ID3 *metadata1, const ID3 *metadata2);
50
51bool id3ConvertId3v1ToId3v2(ID3 *metadata);
52
53bool id3ConvertId3v2ToId3v1(ID3 *metadata);
54
55
56// compatability functions a.k.a getters
57
58char *id3ReadTitle(const ID3 *metadata);
59
60char *id3ReadArtist(const ID3 *metadata);
61
62char *id3ReadAlbumArtist(const ID3 *metadata);
63
64char *id3ReadAlbum(const ID3 *metadata);
65
66char *id3ReadYear(const ID3 *metadata);
67
68char *id3ReadGenre(const ID3 *metadata);
69
70char *id3ReadTrack(const ID3 *metadata);
71
72char *id3ReadComposer(const ID3 *metadata);
73
74char *id3ReadDisc(const ID3 *metadata);
75
76char *id3ReadLyrics(const ID3 *metadata);
77
78char *id3ReadComment(const ID3 *metadata);
79
80uint8_t *id3ReadPicture(uint8_t type, const ID3 *metadata, size_t *dataSize);
81
82// change values within a id3v2 structure
83
84int id3WriteTitle(const char *title, ID3 *metadata);
85
86int id3WriteArtist(const char *artist, ID3 *metadata);
87
88int id3WriteAlbumArtist(const char *albumArtist, ID3 *metadata);
89
90int id3WriteAlbum(const char *album, ID3 *metadata);
91
92int id3WriteYear(const char *year, ID3 *metadata);
93
94int id3WriteGenre(const char *genre, ID3 *metadata);
95
96int id3WriteTrack(const char *track, ID3 *metadata);
97
98int id3WriteDisc(const char *disc, ID3 *metadata);
99
100int id3WriteComposer(const char *composer, ID3 *metadata);
101
102int id3WriteLyrics(const char *lyrics, ID3 *metadata);
103
104int id3WriteComment(const char *comment, ID3 *metadata);
105
106int id3WritePicture(uint8_t *image, size_t imageSize, const char *kind, uint8_t type, ID3 *metadata);
107
108int id3WritePictureFromFile(const char *filename, const char *kind, uint8_t type, ID3 *metadata);
109
110// writes
111
112char *id3ToJSON(const ID3 *metadata);
113
114int id3WriteToFile(const char *filePath, const ID3 *metadata);
115
116#ifdef __cplusplus
117} //extern c end
118#endif
119
120#endif
char * id3ReadDisc(const ID3 *metadata)
Reads the disc number from an ID3 metadata structure using the preferred standard.
Definition id3dev.c:700
ID3 * id3FromFile(const char *filePath)
Reads both ID3v1 and ID3v2 tags from a file into an ID3 metadata structure.
Definition id3dev.c:103
char * id3ReadComposer(const ID3 *metadata)
Reads the composer from an ID3 metadata structure using the preferred standard.
Definition id3dev.c:670
char * id3ToJSON(const ID3 *metadata)
Converts an ID3 metadata structure to a JSON string.
Definition id3dev.c:1271
int id3WriteTitle(const char *title, ID3 *metadata)
Writes a title to an ID3 metadata structure using the preferred standard.
Definition id3dev.c:830
char * id3ReadArtist(const ID3 *metadata)
Reads the artist from an ID3 metadata structure using the preferred standard.
Definition id3dev.c:448
char * id3ReadGenre(const ID3 *metadata)
Reads the genre from an ID3 metadata structure using the preferred standard.
Definition id3dev.c:585
bool id3SetPreferredStandard(uint8_t standard)
Sets the preferred ID3 standard for reading metadata from tag structures.
Definition id3dev.c:68
void id3Destroy(ID3 **toDelete)
Destroys an ID3 metadata structure and frees all associated memory.
Definition id3dev.c:50
int id3WriteComposer(const char *composer, ID3 *metadata)
Writes a composer to an ID3 metadata structure using the preferred standard.
Definition id3dev.c:1104
char * id3ReadAlbum(const ID3 *metadata)
Reads the album from an ID3 metadata structure using the preferred standard.
Definition id3dev.c:509
int id3WriteAlbumArtist(const char *albumArtist, ID3 *metadata)
Writes an album artist to an ID3 metadata structure using the preferred standard.
Definition id3dev.c:894
int id3WriteYear(const char *year, ID3 *metadata)
Writes a year to an ID3 metadata structure using the preferred standard.
Definition id3dev.c:958
char * id3ReadYear(const ID3 *metadata)
Reads the year from an ID3 metadata structure using the preferred standard.
Definition id3dev.c:541
int id3WriteTrack(const char *track, ID3 *metadata)
Writes a track number to an ID3 metadata structure using the preferred standard.
Definition id3dev.c:1030
int id3WritePicture(uint8_t *image, size_t imageSize, const char *kind, uint8_t type, ID3 *metadata)
Writes a picture to an ID3 metadata structure using the preferred standard.
Definition id3dev.c:1201
bool id3Compare(const ID3 *metadata1, const ID3 *metadata2)
Compares two ID3 metadata structures for equality.
Definition id3dev.c:130
char * id3ReadAlbumArtist(const ID3 *metadata)
Reads the album artist from an ID3 metadata structure using the preferred standard.
Definition id3dev.c:479
bool id3ConvertId3v1ToId3v2(ID3 *metadata)
Converts the ID3v1 tag to an ID3v2 tag within the metadata structure.
Definition id3dev.c:167
int id3WriteArtist(const char *artist, ID3 *metadata)
Writes an artist to an ID3 metadata structure using the preferred standard.
Definition id3dev.c:862
ID3 * id3Copy(const ID3 *toCopy)
Creates a deep copy of an ID3 metadata structure.
Definition id3dev.c:114
ID3 * id3Create(Id3v2Tag *id3v2, Id3v1Tag *id3v1)
Creates a new ID3 metadata structure containing ID3v2 and ID3v1 tags.
Definition id3dev.c:35
int id3WriteDisc(const char *disc, ID3 *metadata)
Writes a disc number to an ID3 metadata structure using the preferred standard.
Definition id3dev.c:1073
uint8_t * id3ReadPicture(uint8_t type, const ID3 *metadata, size_t *dataSize)
Reads a picture of the specified type from an ID3 metadata structure using the preferred standard.
Definition id3dev.c:794
int id3WriteComment(const char *comment, ID3 *metadata)
Writes a comment to an ID3 metadata structure using the preferred standard.
Definition id3dev.c:1166
char * id3ReadLyrics(const ID3 *metadata)
Reads the lyrics from an ID3 metadata structure using the preferred standard.
Definition id3dev.c:730
int id3WritePictureFromFile(const char *filename, const char *kind, uint8_t type, ID3 *metadata)
Writes a picture from a file to an ID3 metadata structure using the preferred standard.
Definition id3dev.c:1234
int id3WriteToFile(const char *filePath, const ID3 *metadata)
Writes both ID3v1 and ID3v2 tags to a file using the given ID3 structure.
Definition id3dev.c:1305
char * id3ReadTrack(const ID3 *metadata)
Reads the track number from an ID3 metadata structure using the preferred standard.
Definition id3dev.c:628
int id3WriteLyrics(const char *lyrics, ID3 *metadata)
Writes lyrics to an ID3 metadata structure using the preferred standard.
Definition id3dev.c:1135
int id3WriteAlbum(const char *album, ID3 *metadata)
Writes an album to an ID3 metadata structure using the preferred standard.
Definition id3dev.c:925
bool id3ConvertId3v2ToId3v1(ID3 *metadata)
Converts the ID3v2 tag to an ID3v1 tag within the metadata structure.
Definition id3dev.c:295
struct _ID3 ID3
A structure of both ID3v1 and ID3v2 tags.
char * id3ReadComment(const ID3 *metadata)
Reads the comment from an ID3 metadata structure using the preferred standard.
Definition id3dev.c:760
char * id3ReadTitle(const ID3 *metadata)
Reads the title from an ID3 metadata structure using the preferred standard.
Definition id3dev.c:417
int id3WriteGenre(const char *genre, ID3 *metadata)
Writes a genre to an ID3 metadata structure using the preferred standard.
Definition id3dev.c:995
uint8_t id3GetPreferredStandard(void)
Returns the currently configured preferred ID3 standard.
Definition id3dev.c:90
Definitions for ID3v1 tag structure, constants, and genre enumeration.
struct _Id3v1Tag Id3v1Tag
ID3v1/ID3v1.1 tag structure containing all metadata fields.
Definitions for ID3v2.x tag structure, constants, and genre enumeration.
struct _Id3v2Tag Id3v2Tag
Complete ID3v2 tag structure containing header and metadata frames.
A structure of both ID3v1 and ID3v2 tags.
Definition id3dev.h:26
Id3v1Tag * id3v1
An ID3v1 or ID3v1.1 Tag.
Definition id3dev.h:30
Id3v2Tag * id3v2
An ID3v2.2, ID3v2.3, or ID3v2.4 Tag.
Definition id3dev.h:28