Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

id3v1.cpp File Reference

#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "id3v1.h"
#include "misc.h"

Go to the source code of this file.

Defines

#define NUMGENRES   sizeof(id3genres)/sizeof(char*)

Functions

void trim (char *str, int length)
 Strip trailing spaces from a padded string field.

const char * ID3v1_GetGenreString (int genre)
 Get string for a id3v1 genre id.

int ID3v1_ReadTag (FILE *f, ID3v1Tag *tag)
 Read a ID3, version 1 tag from a file.


Variables

const char * id3genres []


Define Documentation

#define NUMGENRES   sizeof(id3genres)/sizeof(char*)
 

Definition at line 51 of file id3v1.cpp.

Referenced by ID3v1_GetGenreString().


Function Documentation

const char* ID3v1_GetGenreString int    genre
 

Get string for a id3v1 genre id.

Parameters:
genre  genre id
Returns:
pointer to a string containing the genre, or the string "genre #id" for unknown id's.

Definition at line 79 of file id3v1.cpp.

References id3genres, and NUMGENRES.

int ID3v1_ReadTag FILE *    f,
ID3v1Tag   tag
 

Read a ID3, version 1 tag from a file.

The file position is restored, after the tag has been read from the end of the file. For further information about the I3v1 Tag, see http://www.id3.org

Parameters:
f  open File handle to read from
tag  pointer to a ID3v1Tag structure to fill out
Returns:
0 if there was no tag, 1 when successful

Definition at line 104 of file id3v1.cpp.

References ID3v1Tag::album, ID3v1Tag::artist, ID3v1Tag::comment, ID3v1Tag::genre, ID3v1Tag::title, ID3v1Tag::track, trim(), and ID3v1Tag::year.

void trim char *    str,
int    length
[static]
 

Strip trailing spaces from a padded string field.

Note:
If the string contains the full length of characters (i.e. there's no space at the end) there's no '\0' added to the string!
Parameters:
str  pointer to string
length  length of padded string field

Definition at line 62 of file id3v1.cpp.

Referenced by CheckBIOS(), and ID3v1_ReadTag().


Variable Documentation

const char* id3genres[] [static]
 

Initial value:

 {
  "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", "Alternative 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", "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", "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", "Acapella",
  "Euro-House", "Dance Hall", "Goa", "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"
}

Definition at line 23 of file id3v1.cpp.

Referenced by ID3v1_GetGenreString().


Generated on Sun Aug 4 21:47:38 2002 for k/os mp3v2 by doxygen1.2.16