/*
* strawberry_id3tag.h last updated by David Parker <david@neongoat.com>
* $Id: strawberry_id3tag.h,v 1.6 2000/02/08 03:07:29 dap24 Exp $
*
* Strawberry Library - A class for MPEG header extraction and ID3 tag manipulation
* Copyright (C) 1999-2000 David Parker, Neon Goat Productions. All rights reserved.
* http://www.neongoat.com - david@neongoat.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
// strawberry_id3tag.h: interface for the SB_ID3Tag class.
//
#if !defined(AFX_STRAWBERRY_ID3TAG_H__806D7660_1AB0_11D3_B3F8_00A0CC3D7E01__INCLUDED_)
#define AFX_STRAWBERRY_ID3TAG_H__806D7660_1AB0_11D3_B3F8_00A0CC3D7E01__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define GENRE_STANDARD_LEN 81
#define GENRE_STANDARD_ARRAY {"Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop","Jazz","Metal","New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska","Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk","Fusion","Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise","AlternRock","Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic","Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta","Top 40","Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychadelic","Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro","Musical","Rock & Roll","Hard Rock","Unknown"}
#define GENRE_WINAMP_LEN 143
#define GENRE_WINAMP_ARRAY {"Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop","Jazz","Metal","New Age","Oldies","Other","Reggae","Rock","Techno","Industrial","Alternative","Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk","Fusion","Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise","Alt. Rock","Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic","Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta Rap","Top 40","Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychedelic","Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro","Musical","Rock & Roll","Hard Rock","Folk","Folk/Rock","National Folk","Swing","Fast-Fusion","Bebob","Latin","Revival","Celtic","Bluegrass","Avantgarde","Gothic Rock","Progressive Rock","Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus","Easy Listening","Acoustic","Humour","Speech","Chanson","Opera","Chamber Music","Sonata","Symphony","Booty Bass","Primus","Porn Groove","Satire","Slow Jam","Club","Tango","Samba","Folklore","Ballad","Power Ballad","Rhythmic Soul","Freestyle","Duet","Punk Rock","Drum Solo","A Cappella","Euro-House","Dance Hall","Drum & Bass","Club-House","Hardcore","Terror","Indie","BritPop","Negerpunk","Polsk Punk","Beat","Christian Gangsta Rap","Heavy Metal","Black Metal","Crossover","Contemporary Christian","Christian Rock","Merengue","Salsa","Thrash Metal","Anime","JPop","Synthpop"}
// taken right from in_mp3.dll of WinAMP v2.21
class SB_ID3Tag
{
public:
SB_ID3Tag();
~SB_ID3Tag();
void EraseAllFields();
bool Open(CFile *openfile);
bool Open(const CString &filename);
bool ExtractTag();
bool WriteTag(bool overwrite = false);
CString GenerateReport();
bool Close();
//void SetVersionMode(SB_TAG_VERSION mode);
enum SB_TAG_VERSION {TAG_VERSION_INVALID=0, TAG_VERSION_1, TAG_VERSION_11, TAG_VERSION_2};
enum SB_GENRE_MODE {TAG_GENRES_INVALID=0, TAG_GENRES_STANDARD, TAG_GENRES_WINAMP};
void SetGenreMode(SB_GENRE_MODE mode);
bool IsValidTag() {return m_isValidTag;};
CString GetSongName() {return CleanString(m_SongName);};
CString GetSongArtist() {return CleanString(m_SongArtist);};
CString GetAlbumName() {return CleanString(m_AlbumName);};
int GetYearNumber();
CString GetYear() {return CleanString(m_Year);};
int GetGenreNumber() {return m_GenreNumber;};
CString GetGenre() {return m_genres->GetAt(m_GenreNumber);};
CString GetComment() {return CleanString(m_Comment);};
void SetSongName(CString name) {strncpy(m_SongName, name, 30);};
void SetSongArtist(CString artist) {strncpy(m_SongArtist, artist, 30);};
void SetAlbumName(CString album) {strncpy(m_AlbumName, album, 30);};
void SetYear(CString year) {strncpy(m_Year, year, 4);};
void SetYear(int year) {char foo[5]; itoa(year, foo, 4); strncpy(m_Year, foo, 4);};
void SetGenre(int id) {m_GenreNumber = (unsigned char)id;};
void SetComment(CString comment) {strncpy(m_Comment, comment, 30);};
protected:
SB_TAG_VERSION m_Version; // old tag header = "TAG", new tag header = "TAG+"
SB_GENRE_MODE m_GenreMode; // use WinAMP's standard genres or official genres
bool m_isValidTag;
char m_SongName[31];
char m_SongArtist[31];
char m_AlbumName[31];
char m_Year[5];
char m_Comment[31];
int m_GenreNumber;
// NOTE! Enhanced TAGs not implemented yet, but this is the stucture it uses:
char m_PLUS_SongName[61];
char m_PLUS_SongArtist[61];
char m_PLUS_AlbumName[61];
int m_PLUS_Speed; // 1=slow, 2=medium, 3=fast, 4=hardcore (used for categorization, not actual playback speed)
char m_PLUS_Genre[31];
char m_PLUS_StartTime[7]; // mmm:ss
char m_PLUS_EndTime[7];
CString CleanString(char *str);
bool WritePadded(CString data, int len);
private:
CStringArray *m_genres;
CStringArray m_genresStandard;
CStringArray m_genresWinAMP;
BYTE *rawdata;
CFile *openfile;
bool myOpenfile;
CString filename;
/**************************************
BEGIN DOXYGEN DOCUMENTATION COMMENTS
**************************************/
};
#endif // !defined(AFX_STRAWBERRY_ID3TAG_H__806D7660_1AB0_11D3_B3F8_00A0CC3D7E01__INCLUDED_)