include/mp4v2/itmf_tags.h Source File
itmf_tags.h
1 #ifndef MP4V2_ITMF_TAGS_H
2 #define MP4V2_ITMF_TAGS_H
3 
4 /**************************************************************************/
57 typedef enum MP4TagArtworkType_e
58 {
59  MP4_ART_UNDEFINED = 0,
60  MP4_ART_BMP = 1,
61  MP4_ART_GIF = 2,
62  MP4_ART_JPEG = 3,
63  MP4_ART_PNG = 4
65 
67 typedef struct MP4TagArtwork_s
68 {
69  void* data;
70  uint32_t size;
73 
74 typedef struct MP4TagTrack_s
75 {
76  uint16_t index;
77  uint16_t total;
78 } MP4TagTrack;
79 
80 typedef struct MP4TagDisk_s
81 {
82  uint16_t index;
83  uint16_t total;
84 } MP4TagDisk;
85 
98 typedef struct MP4Tags_s
99 {
100  void* __handle; /* internal use only */
101 
102  const char* name;
103  const char* artist;
104  const char* albumArtist;
105  const char* album;
106  const char* grouping;
107  const char* composer;
108  const char* comments;
109  const char* genre;
110  const uint16_t* genreType;
111  const char* releaseDate;
112  const MP4TagTrack* track;
113  const MP4TagDisk* disk;
114  const uint16_t* tempo;
115  const uint8_t* compilation;
116 
117  const char* tvShow;
118  const char* tvNetwork;
119  const char* tvEpisodeID;
120  const uint32_t* tvSeason;
121  const uint32_t* tvEpisode;
122 
123  const char* description;
124  const char* longDescription;
125  const char* lyrics;
126 
127  const char* sortName;
128  const char* sortArtist;
129  const char* sortAlbumArtist;
130  const char* sortAlbum;
131  const char* sortComposer;
132  const char* sortTVShow;
133 
134  const MP4TagArtwork* artwork;
135  uint32_t artworkCount;
136 
137  const char* copyright;
138  const char* encodingTool;
139  const char* encodedBy;
140  const char* purchaseDate;
141 
142  const uint8_t* podcast;
143  const char* keywords; /* TODO: Needs testing */
144  const char* category;
145 
146  const uint8_t* hdVideo;
147  const uint8_t* mediaType;
148  const uint8_t* contentRating;
149  const uint8_t* gapless;
150 
151  const char* iTunesAccount;
152  const uint8_t* iTunesAccountType;
153  const uint32_t* iTunesCountry;
154  const uint32_t* contentID;
155  const uint32_t* artistID;
156  const uint64_t* playlistID;
157  const uint32_t* genreID;
158  const uint32_t* composerID;
159  const char* xid;
161 
171 MP4V2_EXPORT
172 const MP4Tags* MP4TagsAlloc( void );
173 
184 MP4V2_EXPORT
185 bool MP4TagsFetch( const MP4Tags* tags, MP4FileHandle hFile );
186 
198 MP4V2_EXPORT
199 bool MP4TagsStore( const MP4Tags* tags, MP4FileHandle hFile );
200 
207 MP4V2_EXPORT
208 void MP4TagsFree( const MP4Tags* tags );
209 
224 MP4V2_EXPORT
225 bool MP4TagsHasMetadata ( const MP4Tags* tags, bool *hasMetadata );
226 
227 MP4V2_EXPORT bool MP4TagsSetName ( const MP4Tags*, const char* );
228 MP4V2_EXPORT bool MP4TagsSetArtist ( const MP4Tags*, const char* );
229 MP4V2_EXPORT bool MP4TagsSetAlbumArtist ( const MP4Tags*, const char* );
230 MP4V2_EXPORT bool MP4TagsSetAlbum ( const MP4Tags*, const char* );
231 MP4V2_EXPORT bool MP4TagsSetGrouping ( const MP4Tags*, const char* );
232 MP4V2_EXPORT bool MP4TagsSetComposer ( const MP4Tags*, const char* );
233 MP4V2_EXPORT bool MP4TagsSetComments ( const MP4Tags*, const char* );
234 MP4V2_EXPORT bool MP4TagsSetGenre ( const MP4Tags*, const char* );
235 MP4V2_EXPORT bool MP4TagsSetGenreType ( const MP4Tags*, const uint16_t* );
236 MP4V2_EXPORT bool MP4TagsSetReleaseDate ( const MP4Tags*, const char* );
237 MP4V2_EXPORT bool MP4TagsSetTrack ( const MP4Tags*, const MP4TagTrack* );
238 MP4V2_EXPORT bool MP4TagsSetDisk ( const MP4Tags*, const MP4TagDisk* );
239 MP4V2_EXPORT bool MP4TagsSetTempo ( const MP4Tags*, const uint16_t* );
240 MP4V2_EXPORT bool MP4TagsSetCompilation ( const MP4Tags*, const uint8_t* );
241 
242 MP4V2_EXPORT bool MP4TagsSetTVShow ( const MP4Tags*, const char* );
243 MP4V2_EXPORT bool MP4TagsSetTVNetwork ( const MP4Tags*, const char* );
244 MP4V2_EXPORT bool MP4TagsSetTVEpisodeID ( const MP4Tags*, const char* );
245 MP4V2_EXPORT bool MP4TagsSetTVSeason ( const MP4Tags*, const uint32_t* );
246 MP4V2_EXPORT bool MP4TagsSetTVEpisode ( const MP4Tags*, const uint32_t* );
247 
248 MP4V2_EXPORT bool MP4TagsSetDescription ( const MP4Tags*, const char* );
249 MP4V2_EXPORT bool MP4TagsSetLongDescription ( const MP4Tags*, const char* );
250 MP4V2_EXPORT bool MP4TagsSetLyrics ( const MP4Tags*, const char* );
251 
252 MP4V2_EXPORT bool MP4TagsSetSortName ( const MP4Tags*, const char* );
253 MP4V2_EXPORT bool MP4TagsSetSortArtist ( const MP4Tags*, const char* );
254 MP4V2_EXPORT bool MP4TagsSetSortAlbumArtist ( const MP4Tags*, const char* );
255 MP4V2_EXPORT bool MP4TagsSetSortAlbum ( const MP4Tags*, const char* );
256 MP4V2_EXPORT bool MP4TagsSetSortComposer ( const MP4Tags*, const char* );
257 MP4V2_EXPORT bool MP4TagsSetSortTVShow ( const MP4Tags*, const char* );
258 
259 MP4V2_EXPORT bool MP4TagsAddArtwork ( const MP4Tags*, MP4TagArtwork* );
260 MP4V2_EXPORT bool MP4TagsSetArtwork ( const MP4Tags*, uint32_t, MP4TagArtwork* );
261 MP4V2_EXPORT bool MP4TagsRemoveArtwork ( const MP4Tags*, uint32_t );
262 
263 MP4V2_EXPORT bool MP4TagsSetCopyright ( const MP4Tags*, const char* );
264 MP4V2_EXPORT bool MP4TagsSetEncodingTool ( const MP4Tags*, const char* );
265 MP4V2_EXPORT bool MP4TagsSetEncodedBy ( const MP4Tags*, const char* );
266 MP4V2_EXPORT bool MP4TagsSetPurchaseDate ( const MP4Tags*, const char* );
267 
268 MP4V2_EXPORT bool MP4TagsSetPodcast ( const MP4Tags*, const uint8_t* );
269 MP4V2_EXPORT bool MP4TagsSetKeywords ( const MP4Tags*, const char* );
270 MP4V2_EXPORT bool MP4TagsSetCategory ( const MP4Tags*, const char* );
271 
272 MP4V2_EXPORT bool MP4TagsSetHDVideo ( const MP4Tags*, const uint8_t* );
273 MP4V2_EXPORT bool MP4TagsSetMediaType ( const MP4Tags*, const uint8_t* );
274 MP4V2_EXPORT bool MP4TagsSetContentRating ( const MP4Tags*, const uint8_t* );
275 MP4V2_EXPORT bool MP4TagsSetGapless ( const MP4Tags*, const uint8_t* );
276 
277 MP4V2_EXPORT bool MP4TagsSetITunesAccount ( const MP4Tags*, const char* );
278 MP4V2_EXPORT bool MP4TagsSetITunesAccountType ( const MP4Tags*, const uint8_t* );
279 MP4V2_EXPORT bool MP4TagsSetITunesCountry ( const MP4Tags*, const uint32_t* );
280 MP4V2_EXPORT bool MP4TagsSetContentID ( const MP4Tags*, const uint32_t* );
281 MP4V2_EXPORT bool MP4TagsSetArtistID ( const MP4Tags*, const uint32_t* );
282 MP4V2_EXPORT bool MP4TagsSetPlaylistID ( const MP4Tags*, const uint64_t* );
283 MP4V2_EXPORT bool MP4TagsSetGenreID ( const MP4Tags*, const uint32_t* );
284 MP4V2_EXPORT bool MP4TagsSetComposerID ( const MP4Tags*, const uint32_t* );
285 MP4V2_EXPORT bool MP4TagsSetXID ( const MP4Tags*, const char* );
286 
289 #endif /* MP4V2_ITMF_TAGS_H */
MP4TagArtwork_s::size
uint32_t size
data size in bytes
Definition: itmf_tags.h:70
MP4TagsHasMetadata
bool MP4TagsHasMetadata(const MP4Tags *tags, bool *hasMetadata)
Accessor that indicates whether a tags structure contains any metadata.
MP4TagsStore
bool MP4TagsStore(const MP4Tags *tags, MP4FileHandle hFile)
Store data to mp4 file from structure.
MP4TagArtwork
struct MP4TagArtwork_s MP4TagArtwork
Data object representing a single piece of artwork.
MP4TagDisk_s
Definition: itmf_tags.h:81
MP4TagArtwork_s
Data object representing a single piece of artwork.
Definition: itmf_tags.h:68
MP4TagArtwork_s::type
MP4TagArtworkType type
data type
Definition: itmf_tags.h:71
MP4Tags_s
Tags convenience structure.
Definition: itmf_tags.h:99
MP4TagArtwork_s::data
void * data
raw picture data
Definition: itmf_tags.h:69
MP4TagsFree
void MP4TagsFree(const MP4Tags *tags)
Free tags convenience structure.
MP4TagTrack_s
Definition: itmf_tags.h:75
MP4Tags
struct MP4Tags_s MP4Tags
Tags convenience structure.
MP4TagArtworkType_e
MP4TagArtworkType_e
Enumeration of possible MP4TagArtwork::type values.
Definition: itmf_tags.h:58
MP4TagsFetch
bool MP4TagsFetch(const MP4Tags *tags, MP4FileHandle hFile)
Fetch data from mp4 file and populate structure.
MP4TagsAlloc
const MP4Tags * MP4TagsAlloc(void)
Allocate tags convenience structure for reading and settings tags.
MP4TagArtworkType
enum MP4TagArtworkType_e MP4TagArtworkType
Enumeration of possible MP4TagArtwork::type values.