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