#include <strawberry_id3tag.h>
Public Members | |||
enum | SB_TAG_VERSION { TAG_VERSION_INVALID, TAG_VERSION_1, TAG_VERSION_11, TAG_VERSION_2 } | ||
List of ID3 tag versions (1.0, 1.1, and 2.0). | |||
enum | SB_GENRE_MODE { TAG_GENRES_INVALID, TAG_GENRES_STANDARD, TAG_GENRES_WINAMP } | ||
List of Genre modes (original standard or WinAMP genres). | |||
SB_ID3Tag () | |||
Constructor, allocates stuff. More... | |||
~SB_ID3Tag () | |||
Destructor, deallocates stuff. More... | |||
void | EraseAllFields () | ||
Clears all tag information. More... | |||
bool | Open (CFile *openfile) | ||
"Open" MP3 from an already opened CFile. | |||
bool | Open (const CString &filename) | ||
Open MP3 with specified filename. | |||
bool | ExtractTag () | ||
Actually load tag once the file has been opened. | |||
bool | WriteTag (bool overwrite = false) | ||
Writes an ID3 tag to the currently open MP3 file. If "overwrite" is false and the MP3 already has a tag, this function will immediately abort. All items in the tag are padded by null bytes, as they actually should be (some programs improperly pad items with spaces). More... | |||
CString | GenerateReport () | ||
Return a multiline string with a bunch of ID3 tag info. | |||
bool | Close () | ||
Close MP3 file. | |||
void | SetGenreMode (SB_GENRE_MODE mode) | ||
Sets the current genre mode to either WinAMP or generic (winamp has almost twice as many genres than the original ID3 standard genre list). More... | |||
bool | IsValidTag () | ||
Returns whether or not the current MP3 has a valid ID3 tag. | |||
CString | GetSongName () | ||
Returns ID3 song name. More... | |||
CString | GetSongArtist () | ||
Returns ID3 song artist. More... | |||
CString | GetAlbumName () | ||
Returns ID3 album name. More... | |||
int | GetYearNumber () | ||
Returns ID3 year as a number. More... | |||
CString | GetYear () | ||
Returns ID3 year as a string. More... | |||
int | GetGenreNumber () | ||
Returns ID3 genre ID number. More... | |||
CString | GetGenre () | ||
Returns ID3 genre name. More... | |||
CString | GetComment () | ||
Returns ID3 comment field. More... | |||
void | SetSongName (CString name) | ||
Sets ID3 song name, truncated to 30 characters. More... | |||
void | SetSongArtist (CString artist) | ||
Sets ID3 song artist, truncated to 30 characters. More... | |||
void | SetAlbumName (CString album) | ||
Sets ID3 album name, truncated to 30 characters. More... | |||
void | SetYear (CString year) | ||
Sets ID3 year, truncated to 4 characters. More... | |||
void | SetYear (int year) | ||
Sets ID3 year, truncated to 4 numbers. More... | |||
void | SetGenre (int id) | ||
Sets ID3 genre, by ID number. More... | |||
void | SetComment (CString comment) | ||
Sets ID3 comment field, truncated to 30 characters. More... |
Includes ID3v1.x tag detection and input, and output/modifications. Genre definitions are switchable between the standard list of genres, and WinAMP's extended list of genres.
SB_ID3Tag::SB_ID3Tag () |
Constructor, allocates stuff.
Sets aside resources for open file and raw data, and initializes genre arrays.
SB_ID3Tag::~SB_ID3Tag () |
Destructor, deallocates stuff.
Only deallocates the open CFile pointer if it created it itself, not if it was passed on to it.
void SB_ID3Tag::EraseAllFields () |
Clears all tag information.
Unsets internal counters, sets all string fields to NULL, and sets all int fields to -1.
bool SB_ID3Tag::WriteTag (bool overwrite = false) |
Writes an ID3 tag to the currently open MP3 file. If "overwrite" is false and the MP3 already has a tag, this function will immediately abort. All items in the tag are padded by null bytes, as they actually should be (some programs improperly pad items with spaces).
void SB_ID3Tag::SetGenreMode (SB_GENRE_MODE mode) |
Sets the current genre mode to either WinAMP or generic (winamp has almost twice as many genres than the original ID3 standard genre list).
CString SB_ID3Tag::GetSongName () [inline]
|
Returns ID3 song name.
CString SB_ID3Tag::GetSongArtist () [inline]
|
Returns ID3 song artist.
CString SB_ID3Tag::GetAlbumName () [inline]
|
Returns ID3 album name.
int SB_ID3Tag::GetYearNumber () |
Returns ID3 year as a number.
CString SB_ID3Tag::GetYear () [inline]
|
Returns ID3 year as a string.
int SB_ID3Tag::GetGenreNumber () [inline]
|
Returns ID3 genre ID number.
CString SB_ID3Tag::GetGenre () [inline]
|
Returns ID3 genre name.
CString SB_ID3Tag::GetComment () [inline]
|
Returns ID3 comment field.
void SB_ID3Tag::SetSongName (CString name) [inline]
|
Sets ID3 song name, truncated to 30 characters.
void SB_ID3Tag::SetSongArtist (CString artist) [inline]
|
Sets ID3 song artist, truncated to 30 characters.
void SB_ID3Tag::SetAlbumName (CString album) [inline]
|
Sets ID3 album name, truncated to 30 characters.
void SB_ID3Tag::SetYear (CString year) [inline]
|
Sets ID3 year, truncated to 4 characters.
void SB_ID3Tag::SetYear (int year) [inline]
|
Sets ID3 year, truncated to 4 numbers.
void SB_ID3Tag::SetGenre (int id) [inline]
|
Sets ID3 genre, by ID number.
void SB_ID3Tag::SetComment (CString comment) [inline]
|
Sets ID3 comment field, truncated to 30 characters.