Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

ID3.H

Go to the documentation of this file.
00001 //
00002 // ID3.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 
00022 #pragma once
00023 
00024 #pragma pack(1)
00025 
00026 typedef struct
00027 {
00028         CHAR    szTag[3];
00029         CHAR    szSongname[30];
00030         CHAR    szArtist[30];
00031         CHAR    szAlbum[30];
00032         CHAR    szYear[4];
00033         CHAR    szComment[30];
00034         BYTE    nGenre;
00035 } ID3V1;
00036 
00037 #define ID3V1_TAG       "TAG"
00038 
00039 typedef struct
00040 {
00041         CHAR    szTag[3];
00042         BYTE    nMajorVersion;
00043         BYTE    nMinorVersion;
00044         BYTE    nFlags;
00045         DWORD   nSize;
00046 } ID3V2_HEADER;
00047 
00048 #define ID3V2_TAG                       "ID3"
00049 
00050 #define ID3V2_UNSYNCHRONISED    0x80
00051 #define ID3V2_EXTENDEDHEADER    0x40
00052 #define ID3V2_EXPERIMENTAL              0x20
00053 #define ID3V2_FOOTERPRESENT             0x10
00054 #define ID3V2_KNOWNMASK                 0xF0
00055 
00056 typedef struct
00057 {
00058         DWORD   nSize;
00059         BYTE    nFlags1;
00060         BYTE    nFlags2;
00061         DWORD   nPadding;
00062 } ID3V2_EXTENDED_HEADER_1;
00063 
00064 typedef struct
00065 {
00066         DWORD   nSize;
00067         BYTE    nFlagBytes;
00068 } ID3V2_EXTENDED_HEADER_2;
00069 
00070 typedef struct
00071 {
00072         CHAR    szID[4];
00073         DWORD   nSize;
00074         BYTE    nFlags1;
00075         BYTE    nFlags2;
00076 } ID3V2_FRAME;
00077 
00078 typedef struct
00079 {
00080         CHAR    szID[3];
00081         BYTE    nSize[3];
00082 } ID3V2_FRAME_2;
00083 
00084 #define ID3V2_KNOWNFRAME        0x4F
00085 
00086 #define ID3_DESYNC_SIZE(x)      {       \
00087         x = ( x & 0x7F ) | ( ( x & ~0xFF ) >> 1 );      \
00088         x = ( x & 0x03FFF ) | ( ( x & ~0x03FFF ) >> 1 );        \
00089         x = ( x & 0x01FFFFF ) | ( ( x & ~0x01FFFFF ) >> 1 ); }
00090 
00091 typedef struct
00092 {
00093         char cID[4];                                                    // should equal 'MAC '
00094         unsigned __int16 nVersion;                              // version number * 1000 (3.81 = 3810)
00095         unsigned __int16 nCompressionLevel;             // the compression level
00096         unsigned __int16 nFormatFlags;                  // any format flags (for future use)
00097         unsigned __int16 nChannels;                             // the number of channels (1 or 2)
00098         unsigned __int32 nSampleRate;                   // the sample rate (typically 44100)
00099         unsigned __int32 nHeaderBytes;                  // the bytes after the MAC header that compose the WAV header
00100         unsigned __int32 nTerminatingBytes;             // the bytes after that raw data (for extended info)
00101         unsigned __int32 nTotalFrames;                  // the number of frames in the file
00102         unsigned __int32 nFinalFrameBlocks;             // the number of samples in the final frame
00103 } APE_HEADER;
00104 
00105 typedef struct
00106 {
00107         char cID[8];                    // should equal 'APETAGEX'
00108         int nVersion;                   // equals CURRENT_APE_TAG_VERSION
00109         int nSize;                              // the complete size of the tag, including this footer
00110         int nFields;                    // the number of fields in the tag
00111         int nFlags;                             // the tag flags (none currently defined)
00112         char cReserved[8];              // reserved for later use
00113 } APE_TAG_FOOTER;
00114 
00115 typedef struct
00116 {
00117     DWORD               dwMicroSecPerFrame;     // frame display rate (or 0L)
00118     DWORD               dwMaxBytesPerSec;       // max. transfer rate
00119     DWORD               dwPaddingGranularity;   // pad to multiples of this
00120                                                 // size; normally 2K.
00121     DWORD               dwFlags;                // the ever-present flags
00122     DWORD               dwTotalFrames;          // # frames in file
00123     DWORD               dwInitialFrames;
00124     DWORD               dwStreams;
00125     DWORD               dwSuggestedBufferSize;
00126 
00127     DWORD               dwWidth;
00128     DWORD               dwHeight;
00129 
00130     DWORD               dwReserved[4];
00131 } AVI_HEADER;
00132 
00133 #ifdef _ID3_DEFINE_GENRES
00134 LPCTSTR CLibraryBuilderInternals::pszID3Genre[] =
00135 {
00136         _T("Blues"), _T("Classic Rock"), _T("Country"), _T("Dance"), _T("Disco"),
00137         _T("Funk"), _T("Grunge"), _T("Hip-Hop"), _T("Jazz"), _T("Metal"), _T("New Age"),
00138         _T("Oldies"), _T("Other"), _T("Pop"), _T("R&B"), _T("Rap"), _T("Reggae"),
00139         _T("Rock"), _T("Techno"), _T("Industrial"), _T("Alternative"), _T("Ska"),
00140         _T("Death Metal"), _T("Pranks"), _T("Soundtrack"), _T("Euro-Techno"), _T("Ambient"),
00141         _T("Trip-Hop"), _T("Vocal"), _T("Jazz+Funk"), _T("Fusion"), _T("Trance"),
00142         _T("Classical"), _T("Instrumental"), _T("Acid"), _T("House"), _T("Game"),
00143         _T("Sound Clip"), _T("Gospel"), _T("Noise"), _T("AlternRock"), _T("Bass"),
00144         _T("Soul"), _T("Punk"), _T("Space"), _T("Meditative"), _T("Instrumental Pop"),
00145         _T("Instrumental Rock"), _T("Ethnic"), _T("Gothic"), _T("Darkwave"),
00146         _T("Techno-Industrial"), _T("Electronic"), _T("Pop-Folk"), _T("Eurodance"),
00147         _T("Dream"), _T("Southern Rock"), _T("Comedy"), _T("Cult"), _T("Gangsta"), _T("Top 40"),
00148         _T("Christian Rap"), _T("Pop/Funk"), _T("Jungle"), _T("Native American"), _T("Cabaret"),
00149         _T("New Wave"), _T("Psychadelic"), _T("Rave"), _T("Showtunes"), _T("Trailer"),
00150         _T("Lo-Fi"), _T("Tribal"), _T("Acid Punk"), _T("Acid Jazz"), _T("Polka"), _T("Retro"),
00151         _T("Musical"), _T("Rock & Roll"), _T("Hard Rock"), _T("Folk"), _T("Folk/Rock"),
00152         _T("National Folk"), _T("Swing"), _T("Easy Listening"), _T("Bebob"), _T("Latin"), _T("Revival"),
00153         _T("Celtic"), _T("Bluegrass"), _T("Avantgarde"), _T("Gothic Rock"),
00154         _T("Progressive Rock"), _T("Psychedelic Rock"), _T("Symphonic Rock"),
00155         _T("Slow Rock"), _T("Big Band"), _T("Chorus"), _T("Easy Listening"),
00156         _T("Acoustic"), _T("Humour"), _T("Speech"), _T("Chanson"), _T("Opera"),
00157         _T("Chamber Music"), _T("Sonata"), _T("Symphony"), _T("Booty Bass"),
00158         _T("Primus"), _T("Porn Groove"), _T("Satire"), _T("Slow Jam"), _T("Club"),
00159         _T("Tango"), _T("Samba"), _T("Folklore"), _T("Ballad"), _T("Power Ballad"),
00160         _T("Rhythmic Soul"), _T("Freestyle"), _T("Duet"), _T("Punk Rock"), _T("Drum Solo"),
00161         _T("A capella"), _T("Euro-House"), _T("Dance Hall"), _T("Goa"), _T("Drum & Bass"),
00162         _T("Club-House"), _T("Hardcore"), _T("Terror"), _T("Indie"), _T("BritPop"), _T("Negerpunk"),
00163         _T("Polsk Punk"), _T("Beat"), _T("Christian Gangsta"), _T("Heavy Metal"), _T("Black Metal"),
00164         _T("Crossover"), _T("Contemporary C"), _T("Christian Rock"), _T("Merengue"),
00165         _T("Salsa"), _T("Thrash Metal"), _T("Anime"), _T("JPop"), _T("SynthPop")
00166 
00167 };
00168 #endif
00169 
00170 #define ID3_GENRES      148
00171 
00172 #pragma pack()

Generated on Thu Dec 15 10:39:43 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2