id3lib 3.8.3

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

misc_support.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id: misc_support.h,v 1.29 2002/09/19 10:21:57 t1mpy Exp $
3
4 // id3lib: a C++ library for creating and manipulating id3v1/v2 tags
5 // Copyright 1999, 2000 Scott Thomas Haug
6 // Copyright 2002 Thijmen Klok (thijmen@id3lib.org)
7
8 // This library is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU Library General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or (at your
11 // option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
16 // License for more details.
17 //
18 // You should have received a copy of the GNU Library General Public License
19 // along with this library; if not, write to the Free Software Foundation,
20 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
22 // The id3lib authors encourage improvements and optimisations to be sent to
23 // the id3lib coordinator. Please see the README file for details on where to
24 // send such submissions. See the AUTHORS file for a list of people who have
25 // contributed to id3lib. See the ChangeLog file for a list of changes to
26 // id3lib. These files are distributed with id3lib at
27 // http://download.sourceforge.net/id3lib/
28
29 #ifndef _ID3LIB_MISC_SUPPORT_H_
30 #define _ID3LIB_MISC_SUPPORT_H_
31
32 #include <id3/tag.h>
33
34 ID3_C_EXPORT char* ID3_GetString(const ID3_Frame *, ID3_FieldID);
35 ID3_C_EXPORT char* ID3_GetString(const ID3_Frame *, ID3_FieldID, size_t nItems);
36
37 ID3_C_EXPORT void ID3_FreeString(char *str);
38
39 // defined in 'id3_misc_support.cpp'
40 // these are 'convenience functions,' to make using the library easier for the
41 // most common of operations
42 ID3_C_EXPORT char* ID3_GetArtist(const ID3_Tag*);
43 ID3_C_EXPORT ID3_Frame* ID3_AddArtist(ID3_Tag*, const char*, bool replace = false);
44 ID3_C_EXPORT size_t ID3_RemoveArtists(ID3_Tag*);
45
46 ID3_C_EXPORT char* ID3_GetAlbum(const ID3_Tag*);
47 ID3_C_EXPORT ID3_Frame* ID3_AddAlbum(ID3_Tag*, const char*, bool replace = false);
48 ID3_C_EXPORT size_t ID3_RemoveAlbums(ID3_Tag*);
49
50 ID3_C_EXPORT char* ID3_GetTitle(const ID3_Tag*);
51 ID3_C_EXPORT ID3_Frame* ID3_AddTitle(ID3_Tag*, const char*, bool replace = false);
52 ID3_C_EXPORT size_t ID3_RemoveTitles(ID3_Tag*);
53
54 ID3_C_EXPORT char* ID3_GetYear(const ID3_Tag*);
55 ID3_C_EXPORT ID3_Frame* ID3_AddYear(ID3_Tag*, const char*, bool replace = false);
56 ID3_C_EXPORT size_t ID3_RemoveYears(ID3_Tag*);
57
58 ID3_C_EXPORT char* ID3_GetComment(const ID3_Tag*, const char* desc = NULL);
59 ID3_C_EXPORT ID3_Frame* ID3_AddComment(ID3_Tag*, const char*, bool = false);
60 ID3_C_EXPORT ID3_Frame* ID3_AddComment(ID3_Tag*, const char*, const char*, bool = false);
61 ID3_C_EXPORT ID3_Frame* ID3_AddComment(ID3_Tag*, const char*, const char*, const char*,
62 bool = false);
63 ID3_C_EXPORT size_t ID3_RemoveComments(ID3_Tag*, const char * = NULL);
64
65 ID3_C_EXPORT char* ID3_GetTrack(const ID3_Tag*);
66 ID3_C_EXPORT size_t ID3_GetTrackNum(const ID3_Tag*);
67 //following routine courtesy of John George
68 ID3_C_EXPORT ID3_Frame* ID3_AddTrack(ID3_Tag*, uchar ucTrack, uchar ucTotal = 0,
69 bool replace = false);
70 ID3_C_EXPORT size_t ID3_RemoveTracks(ID3_Tag*);
71
72 ID3_C_EXPORT char* ID3_GetGenre(const ID3_Tag*);
73 ID3_C_EXPORT size_t ID3_GetGenreNum(const ID3_Tag*);
74 ID3_C_EXPORT ID3_Frame* ID3_AddGenre(ID3_Tag*, size_t ucGenre, bool replace = false);
75 //following routine courtesy of John George
76 ID3_C_EXPORT ID3_Frame* ID3_AddGenre(ID3_Tag*, const char *, bool replace = false);
77 ID3_C_EXPORT size_t ID3_RemoveGenres(ID3_Tag*);
78
79 ID3_C_EXPORT char* ID3_GetLyrics(const ID3_Tag*);
80 ID3_C_EXPORT ID3_Frame* ID3_AddLyrics(ID3_Tag*, const char*, bool = false);
81 ID3_C_EXPORT ID3_Frame* ID3_AddLyrics(ID3_Tag*, const char*, const char*, bool = false);
82 ID3_C_EXPORT ID3_Frame* ID3_AddLyrics(ID3_Tag*, const char*, const char*, const char*,
83 bool = false);
84 ID3_C_EXPORT size_t ID3_RemoveLyrics(ID3_Tag*);
85
86 ID3_C_EXPORT char* ID3_GetLyricist(const ID3_Tag*);
87 ID3_C_EXPORT ID3_Frame* ID3_AddLyricist(ID3_Tag *, const char *, bool replace = false);
88 ID3_C_EXPORT size_t ID3_RemoveLyricist(ID3_Tag*);
89
90 ID3_C_EXPORT ID3_Frame* ID3_AddSyncLyrics(ID3_Tag*, const uchar*, size_t,
91 ID3_TimeStampFormat, bool = false);
92 ID3_C_EXPORT ID3_Frame* ID3_AddSyncLyrics(ID3_Tag*, const uchar*, size_t,
93 ID3_TimeStampFormat, const char *, bool = false);
94 ID3_C_EXPORT ID3_Frame* ID3_AddSyncLyrics(ID3_Tag*, const uchar*, size_t,
95 ID3_TimeStampFormat, const char *, const char *,
96 bool = false);
97 ID3_C_EXPORT ID3_Frame* ID3_AddSyncLyrics(ID3_Tag*, const uchar*, size_t,
98 ID3_TimeStampFormat, const char *, const char *,
99 ID3_ContentType, bool = false);
100 ID3_C_EXPORT ID3_Frame* ID3_GetSyncLyricsInfo(const ID3_Tag *tag, const char *lang,
101 const char *desc, char &stampformat,
102 char &type, size_t &size);
103 ID3_C_EXPORT ID3_Frame* ID3_GetSyncLyrics(const ID3_Tag* tag, const char* lang,
104 const char* desc, const uchar* &pData, size_t& size);
105
106
107 //following routine courtesy of John George
108 ID3_C_EXPORT int ID3_GetPictureData(const ID3_Tag*, const char* TempPicPath);
109
110 //following routine courtesy of John George
111 ID3_C_EXPORT char* ID3_GetPictureMimeType(const ID3_Tag*);
112
113 //following routine courtesy of John George
114 ID3_C_EXPORT bool ID3_HasPicture(const ID3_Tag*);
115
116 //following two routines courtesy of John George
117 ID3_C_EXPORT ID3_Frame* ID3_AddPicture(ID3_Tag*, const char* TempPicPath, const char* MimeType, bool replace = false);
118 ID3_C_EXPORT ID3_Frame* ID3_AddPicture(ID3_Tag*, const char* TempPicPath, const char* MimeType, ID3_PictureType pictype, const char* Description, bool replace = false);
119
120 //following routine courtesy of John George
121 ID3_C_EXPORT size_t ID3_RemovePictures(ID3_Tag*);
122
123 //following routine courtesy of John George
124 ID3_C_EXPORT size_t ID3_GetPictureDataOfPicType(ID3_Tag*, const char* TempPicPath, ID3_PictureType pictype);
125
126 //following routine courtesy of John George
127 ID3_C_EXPORT char *ID3_GetMimeTypeOfPicType(ID3_Tag*, ID3_PictureType pictype);
128
129 //following routine courtesy of John George
130 ID3_C_EXPORT char *ID3_GetDescriptionOfPicType(ID3_Tag*, ID3_PictureType pictype);
131
132 //following routine courtesy of John George
133 ID3_C_EXPORT size_t ID3_RemovePictureType(ID3_Tag*, ID3_PictureType pictype);
134
135
136 #endif /* _ID3LIB_MISC_SUPPORT_H_ */
137
tag.h
ID3_GetLyricist
char * ID3_GetLyricist(const ID3_Tag *tag)
Definition: misc_support.cpp:969
ID3_GetYear
char * ID3_GetYear(const ID3_Tag *tag)
Definition: misc_support.cpp:274
ID3_Tag
The representative class of an id3 tag.
Definition: tag.h:41
ID3_GetTitle
char * ID3_GetTitle(const ID3_Tag *tag)
Definition: misc_support.cpp:215
ID3_ContentType
ID3_ContentType
Definition: globals.h:381
ID3_AddArtist
ID3_Frame * ID3_AddArtist(ID3_Tag *tag, const char *text, bool replace)
Definition: misc_support.cpp:92
ID3_AddGenre
ID3_Frame * ID3_AddGenre(ID3_Tag *tag, const char *genre, bool replace)
Definition: misc_support.cpp:839
ID3_GetPictureData
int ID3_GetPictureData(const ID3_Tag *tag, const char *TempPicPath)
Definition: misc_support.cpp:531
ID3_GetDescriptionOfPicType
char * ID3_GetDescriptionOfPicType(ID3_Tag *tag, ID3_PictureType pictype)
Definition: misc_support.cpp:745
ID3_GetTrackNum
size_t ID3_GetTrackNum(const ID3_Tag *tag)
Definition: misc_support.cpp:481
ID3_GetLyrics
char * ID3_GetLyrics(const ID3_Tag *tag)
Definition: misc_support.cpp:896
ID3_RemoveLyrics
size_t ID3_RemoveLyrics(ID3_Tag *tag)
Definition: misc_support.cpp:949
ID3_AddAlbum
ID3_Frame * ID3_AddAlbum(ID3_Tag *tag, const char *text, bool replace)
Definition: misc_support.cpp:172
ID3_RemovePictures
size_t ID3_RemovePictures(ID3_Tag *tag)
Definition: misc_support.cpp:612
ID3_GetTrack
char * ID3_GetTrack(const ID3_Tag *tag)
Definition: misc_support.cpp:465
ID3_AddLyricist
ID3_Frame * ID3_AddLyricist(ID3_Tag *tag, const char *text, bool replace)
Definition: misc_support.cpp:985
ID3_RemoveComments
size_t ID3_RemoveComments(ID3_Tag *tag, const char *desc)
Definition: misc_support.cpp:423
ID3_AddPicture
ID3_Frame * ID3_AddPicture(ID3_Tag *tag, const char *TempPicPath, const char *MimeType, bool replace)
Definition: misc_support.cpp:590
ID3_GetGenreNum
size_t ID3_GetGenreNum(const ID3_Tag *tag)
Definition: misc_support.cpp:809
uchar
unsigned char uchar
Definition: globals.h:114
ID3_GetAlbum
char * ID3_GetAlbum(const ID3_Tag *tag)
Definition: misc_support.cpp:156
ID3_RemoveTitles
size_t ID3_RemoveTitles(ID3_Tag *tag)
Definition: misc_support.cpp:254
ID3_GetMimeTypeOfPicType
char * ID3_GetMimeTypeOfPicType(ID3_Tag *tag, ID3_PictureType pictype)
Definition: misc_support.cpp:718
ID3_RemoveYears
size_t ID3_RemoveYears(ID3_Tag *tag)
Definition: misc_support.cpp:313
ID3_HasPicture
bool ID3_HasPicture(const ID3_Tag *tag)
Definition: misc_support.cpp:570
ID3_AddTrack
ID3_Frame * ID3_AddTrack(ID3_Tag *tag, uchar trk, uchar ttl, bool replace)
Definition: misc_support.cpp:493
ID3_GetComment
char * ID3_GetComment(const ID3_Tag *tag, const char *desc)
Definition: misc_support.cpp:333
ID3_AddComment
ID3_Frame * ID3_AddComment(ID3_Tag *tag, const char *text, bool replace)
Definition: misc_support.cpp:358
ID3_RemovePictureType
size_t ID3_RemovePictureType(ID3_Tag *tag, ID3_PictureType pictype)
Definition: misc_support.cpp:630
ID3_RemoveGenres
size_t ID3_RemoveGenres(ID3_Tag *tag)
Definition: misc_support.cpp:876
ID3_C_EXPORT
#define ID3_C_EXPORT
This file defines common macros, types, constants, and enums used throughout id3lib.
Definition: globals.h:78
ID3_Frame
The representative class of an id3v2 frame.
Definition: id3lib_frame.h:38
ID3_RemoveTracks
size_t ID3_RemoveTracks(ID3_Tag *tag)
Definition: misc_support.cpp:772
ID3_GetSyncLyrics
ID3_Frame * ID3_GetSyncLyrics(const ID3_Tag *tag, const char *lang, const char *desc, const uchar *&pData, size_t &size)
Definition: misc_support.cpp:1137
ID3_GetSyncLyricsInfo
ID3_Frame * ID3_GetSyncLyricsInfo(const ID3_Tag *tag, const char *desc, const char *lang, ID3_TimeStampFormat &format, ID3_ContentType &type, size_t &size)
Definition: misc_support.cpp:1096
ID3_TimeStampFormat
ID3_TimeStampFormat
Definition: globals.h:417
ID3_GetArtist
char * ID3_GetArtist(const ID3_Tag *tag)
Definition: misc_support.cpp:73
ID3_FreeString
void ID3_FreeString(char *str)
Definition: misc_support.cpp:67
ID3_GetPictureMimeType
char * ID3_GetPictureMimeType(const ID3_Tag *tag)
Definition: misc_support.cpp:554
NULL
#define NULL
Definition: globals.h:743
ID3_GetString
char * ID3_GetString(const ID3_Frame *frame, ID3_FieldID fldName)
Definition: misc_support.cpp:37
ID3_RemoveLyricist
size_t ID3_RemoveLyricist(ID3_Tag *tag)
Definition: misc_support.cpp:1008
ID3_AddTitle
ID3_Frame * ID3_AddTitle(ID3_Tag *tag, const char *text, bool replace)
Definition: misc_support.cpp:231
ID3_GetGenre
char * ID3_GetGenre(const ID3_Tag *tag)
Definition: misc_support.cpp:792
ID3_AddYear
ID3_Frame * ID3_AddYear(ID3_Tag *tag, const char *text, bool replace)
Definition: misc_support.cpp:290
ID3_PictureType
ID3_PictureType
Definition: globals.h:392
ID3_AddSyncLyrics
ID3_Frame * ID3_AddSyncLyrics(ID3_Tag *tag, const uchar *data, size_t datasize, ID3_TimeStampFormat format, bool replace)
Definition: misc_support.cpp:1028
ID3_RemoveAlbums
size_t ID3_RemoveAlbums(ID3_Tag *tag)
Definition: misc_support.cpp:195
ID3_FieldID
ID3_FieldID
Enumeration of the different types of fields in a frame.
Definition: globals.h:197
ID3_GetPictureDataOfPicType
size_t ID3_GetPictureDataOfPicType(ID3_Tag *tag, const char *TempPicPath, ID3_PictureType pictype)
Definition: misc_support.cpp:684
ID3_AddLyrics
ID3_Frame * ID3_AddLyrics(ID3_Tag *tag, const char *text, bool replace)
Definition: misc_support.cpp:912
ID3_RemoveArtists
size_t ID3_RemoveArtists(ID3_Tag *tag)
Definition: misc_support.cpp:118