00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00033 #ifndef _ID3LIB_GLOBALS_H_
00034 #define _ID3LIB_GLOBALS_H_
00035
00036 #include <stdlib.h>
00037 #include <id3/sized_types.h>
00038
00039
00040
00041
00042
00043
00044 #ifdef WIN32
00045 # ifdef ID3LIB_COMPILATION
00046 # define ID3_C_EXPORT extern _declspec(dllexport)
00047 # define ID3_CPP_EXPORT __declspec(dllexport)
00048 # else
00049 # define ID3_C_EXPORT extern _declspec(dllimport)
00050 # define ID3_CPP_EXPORT __declspec(dllimport)
00051 # endif
00052 #else
00053 # define ID3_C_EXPORT
00054 # define ID3_CPP_EXPORT
00055 #endif
00056 #define ID3_C_VAR extern
00057
00058 #ifndef __cplusplus
00059
00060 typedef int bool;
00061 # define false (0)
00062 # define true (!false)
00063
00064 #endif
00065
00066 ID3_C_VAR const char * const ID3LIB_NAME;
00067 ID3_C_VAR const char * const ID3LIB_RELEASE;
00068 ID3_C_VAR const char * const ID3LIB_FULL_NAME;
00069 ID3_C_VAR const int ID3LIB_MAJOR_VERSION;
00070 ID3_C_VAR const int ID3LIB_MINOR_VERSION;
00071 ID3_C_VAR const int ID3LIB_PATCH_VERSION;
00072 ID3_C_VAR const int ID3LIB_INTERFACE_AGE;
00073 ID3_C_VAR const int ID3LIB_BINARY_AGE;
00074
00075 #define ID3_TAGID "ID3"
00076 #define ID3_TAGIDSIZE (3)
00077 #define ID3_TAGHEADERSIZE (10)
00078
00084 #define STR_V1_COMMENT_DESC "ID3v1 Comment"
00085
00086
00087 typedef unsigned char uchar;
00088 typedef short signed int ssint;
00089 typedef short unsigned int suint;
00090 typedef long signed int lsint;
00091 typedef long unsigned int luint;
00092 typedef long double ldoub;
00093
00094 typedef uint16 unicode_t;
00095 typedef uint16 flags_t;
00096
00097 #if !defined index_t
00098 # define index_t size_t
00099 #endif
00100
00101 #define NULL_UNICODE ((unicode_t) '\0')
00102
00103
00104
00105
00106
00107 #ifdef __cplusplus
00108 # define ID3_ENUM(E) enum E
00109 # define ID3_STRUCT(S) struct S
00110 #else
00111 # define ID3_ENUM(E) typedef enum _ ## E E; enum _ ## E
00112 # define ID3_STRUCT(S) typedef struct _ ## S S; struct _ ## S
00113 #endif
00114
00118 ID3_ENUM(ID3_TextEnc)
00119 {
00120 ID3TE_NONE = -1,
00121 ID3TE_ISO8859_1,
00122 ID3TE_UTF16,
00123 ID3TE_UTF16BE,
00124 ID3TE_UTF8,
00125 ID3TE_NUMENCODINGS,
00126 ID3TE_ASCII = ID3TE_ISO8859_1,
00127 ID3TE_UNICODE = ID3TE_UTF16
00128 };
00129
00132 ID3_ENUM(ID3_V1Spec)
00133 {
00134 ID3V1_0 = 0,
00135 ID3V1_1,
00136 ID3V1_NUMSPECS
00137 };
00138
00139 ID3_ENUM(ID3_V2Spec)
00140 {
00141 ID3V2_UNKNOWN = -1,
00142 ID3V2_2_0 = 0,
00143 ID3V2_2_1,
00144 ID3V2_3_0,
00145 ID3V2_4_0,
00146 ID3V2_EARLIEST = ID3V2_2_0,
00147 ID3V2_LATEST = ID3V2_3_0
00148 };
00149
00152 ID3_ENUM(ID3_TagType)
00153 {
00154 ID3TT_NONE = 0,
00155 ID3TT_ID3V1 = 1 << 0,
00156 ID3TT_ID3V2 = 1 << 1,
00157 ID3TT_LYRICS3 = 1 << 2,
00158 ID3TT_LYRICS3V2 = 1 << 3,
00159 ID3TT_MUSICMATCH = 1 << 4,
00161 ID3TT_LYRICS = ID3TT_LYRICS3,
00163 ID3TT_ID3 = ID3TT_ID3V1 | ID3TT_ID3V2,
00165 ID3TT_ALL = ~ID3TT_NONE,
00167 ID3TT_PREPENDED = ID3TT_ID3V2,
00169 ID3TT_APPENDED = ID3TT_ALL & ~ID3TT_ID3V2
00170 };
00171
00175 ID3_ENUM(ID3_FieldID)
00176 {
00177 ID3FN_NOFIELD = 0,
00178 ID3FN_TEXTENC,
00179 ID3FN_TEXT,
00180 ID3FN_URL,
00181 ID3FN_DATA,
00182 ID3FN_DESCRIPTION,
00183 ID3FN_OWNER,
00184 ID3FN_EMAIL,
00185 ID3FN_RATING,
00186 ID3FN_FILENAME,
00187 ID3FN_LANGUAGE,
00188 ID3FN_PICTURETYPE,
00189 ID3FN_IMAGEFORMAT,
00190 ID3FN_MIMETYPE,
00191 ID3FN_COUNTER,
00192 ID3FN_ID,
00193 ID3FN_VOLUMEADJ,
00194 ID3FN_NUMBITS,
00195 ID3FN_VOLCHGRIGHT,
00196 ID3FN_VOLCHGLEFT,
00197 ID3FN_PEAKVOLRIGHT,
00198 ID3FN_PEAKVOLLEFT,
00199 ID3FN_TIMESTAMPFORMAT,
00200 ID3FN_CONTENTTYPE,
00201 ID3FN_LASTFIELDID
00202 };
00203
00207 ID3_ENUM(ID3_FrameID)
00208 {
00209 ID3FID_NOFRAME = 0,
00210 ID3FID_AUDIOCRYPTO,
00211 ID3FID_PICTURE,
00212 ID3FID_COMMENT,
00213 ID3FID_COMMERCIAL,
00214 ID3FID_CRYPTOREG,
00215 ID3FID_EQUALIZATION,
00216 ID3FID_EVENTTIMING,
00217 ID3FID_GENERALOBJECT,
00218 ID3FID_GROUPINGREG,
00219 ID3FID_INVOLVEDPEOPLE,
00220 ID3FID_LINKEDINFO,
00221 ID3FID_CDID,
00222 ID3FID_MPEGLOOKUP,
00223 ID3FID_OWNERSHIP,
00224 ID3FID_PRIVATE,
00225 ID3FID_PLAYCOUNTER,
00226 ID3FID_POPULARIMETER,
00227 ID3FID_POSITIONSYNC,
00228 ID3FID_BUFFERSIZE,
00229 ID3FID_VOLUMEADJ,
00230 ID3FID_REVERB,
00231 ID3FID_SYNCEDLYRICS,
00232 ID3FID_SYNCEDTEMPO,
00233 ID3FID_ALBUM,
00234 ID3FID_BPM,
00235 ID3FID_COMPOSER,
00236 ID3FID_CONTENTTYPE,
00237 ID3FID_COPYRIGHT,
00238 ID3FID_DATE,
00239 ID3FID_PLAYLISTDELAY,
00240 ID3FID_ENCODEDBY,
00241 ID3FID_LYRICIST,
00242 ID3FID_FILETYPE,
00243 ID3FID_TIME,
00244 ID3FID_CONTENTGROUP,
00245 ID3FID_TITLE,
00246 ID3FID_SUBTITLE,
00247 ID3FID_INITIALKEY,
00248 ID3FID_LANGUAGE,
00249 ID3FID_SONGLEN,
00250 ID3FID_MEDIATYPE,
00251 ID3FID_ORIGALBUM,
00252 ID3FID_ORIGFILENAME,
00253 ID3FID_ORIGLYRICIST,
00254 ID3FID_ORIGARTIST,
00255 ID3FID_ORIGYEAR,
00256 ID3FID_FILEOWNER,
00257 ID3FID_LEADARTIST,
00258 ID3FID_BAND,
00259 ID3FID_CONDUCTOR,
00260 ID3FID_MIXARTIST,
00261 ID3FID_PARTINSET,
00262 ID3FID_PUBLISHER,
00263 ID3FID_TRACKNUM,
00264 ID3FID_RECORDINGDATES,
00265 ID3FID_NETRADIOSTATION,
00266 ID3FID_NETRADIOOWNER,
00267 ID3FID_SIZE,
00268 ID3FID_ISRC,
00269 ID3FID_ENCODERSETTINGS,
00270 ID3FID_USERTEXT,
00271 ID3FID_YEAR,
00272 ID3FID_UNIQUEFILEID,
00273 ID3FID_TERMSOFUSE,
00274 ID3FID_UNSYNCEDLYRICS,
00275 ID3FID_WWWCOMMERCIALINFO,
00276 ID3FID_WWWCOPYRIGHT,
00277 ID3FID_WWWAUDIOFILE,
00278 ID3FID_WWWARTIST,
00279 ID3FID_WWWAUDIOSOURCE,
00280 ID3FID_WWWRADIOPAGE,
00281 ID3FID_WWWPAYMENT,
00282 ID3FID_WWWPUBLISHER,
00283 ID3FID_WWWUSER,
00284 ID3FID_METACRYPTO,
00285 ID3FID_METACOMPRESSION,
00286 ID3FID_LASTFRAMEID
00287 };
00288
00289 ID3_ENUM(ID3_V1Lengths)
00290 {
00291 ID3_V1_LEN = 128,
00292 ID3_V1_LEN_ID = 3,
00293 ID3_V1_LEN_TITLE = 30,
00294 ID3_V1_LEN_ARTIST = 30,
00295 ID3_V1_LEN_ALBUM = 30,
00296 ID3_V1_LEN_YEAR = 4,
00297 ID3_V1_LEN_COMMENT = 30,
00298 ID3_V1_LEN_GENRE = 1
00299 };
00300
00301 ID3_ENUM(ID3_FieldFlags)
00302 {
00303 ID3FF_NONE = 0,
00304 ID3FF_CSTR = 1 << 0,
00305 ID3FF_LIST = 1 << 1,
00306 ID3FF_ENCODABLE = 1 << 2,
00307 ID3FF_TEXTLIST = ID3FF_CSTR | ID3FF_LIST | ID3FF_ENCODABLE
00308 };
00309
00311 ID3_ENUM(ID3_FieldType)
00312 {
00313 ID3FTY_NONE = -1,
00314 ID3FTY_INTEGER = 0,
00315 ID3FTY_BINARY,
00316 ID3FTY_TEXTSTRING,
00317 ID3FTY_NUMTYPES
00318 };
00319
00323 ID3_ENUM(ID3_Err)
00324 {
00325 ID3E_NoError = 0,
00326 ID3E_NoMemory,
00327 ID3E_NoData,
00328 ID3E_BadData,
00329 ID3E_NoBuffer,
00330 ID3E_SmallBuffer,
00331 ID3E_InvalidFrameID,
00332 ID3E_FieldNotFound,
00333 ID3E_UnknownFieldType,
00334 ID3E_TagAlreadyAttached,
00335 ID3E_InvalidTagVersion,
00336 ID3E_NoFile,
00337 ID3E_ReadOnly,
00338 ID3E_zlibError
00339 };
00340
00341 ID3_ENUM(ID3_ContentType)
00342 {
00343 ID3CT_OTHER = 0,
00344 ID3CT_LYRICS,
00345 ID3CT_TEXTTRANSCRIPTION,
00346 ID3CT_MOVEMENT,
00347 ID3CT_EVENTS,
00348 ID3CT_CHORD,
00349 ID3CT_TRIVIA
00350 };
00351
00352 ID3_ENUM(ID3_TimeStampFormat)
00353 {
00354 ID3TSF_FRAME = 1,
00355 ID3TSF_MS
00356 };
00357
00358 #define MASK(bits) ((1 << (bits)) - 1)
00359 #define MASK1 MASK(1)
00360 #define MASK2 MASK(2)
00361 #define MASK3 MASK(3)
00362 #define MASK4 MASK(4)
00363 #define MASK5 MASK(5)
00364 #define MASK6 MASK(6)
00365 #define MASK7 MASK(7)
00366 #define MASK8 MASK(8)
00367
00368
00369
00370
00371 #ifdef WIN32
00372
00373
00374
00375
00376 # define ID3_DIR_SEPARATOR '\\'
00377 # define ID3_DIR_SEPARATOR_S "\\"
00378 # define ID3_SEARCHPATH_SEPARATOR ';'
00379 # define ID3_SEARCHPATH_SEPARATOR_S ";"
00380
00381 #else
00382
00383 # ifndef _EMX_
00384
00385
00386 # define ID3_DIR_SEPARATOR '/'
00387 # define ID3_DIR_SEPARATOR_S "/"
00388 # define ID3_SEARCHPATH_SEPARATOR ':'
00389 # define ID3_SEARCHPATH_SEPARATOR_S ":"
00390
00391 # else
00392
00393
00394 # define ID3_DIR_SEPARATOR '/'
00395 # define ID3_DIR_SEPARATOR_S "/"
00396 # define ID3_SEARCHPATH_SEPARATOR ';'
00397 # define ID3_SEARCHPATH_SEPARATOR_S ";"
00398
00399 # endif
00400
00401 #endif
00402
00403 #ifndef NULL
00404 # define NULL ((void*) 0)
00405 #endif
00406
00407 #endif