Class ID3v1

Description

This class represents a file containing ID3v1 headers as described in The ID3-Tag Specification Appendix.

Located in /ID3v1.php (line 55)


	
			
Variable Summary
static Array $genres
Method Summary
ID3v1 __construct ([string|Reader $filename = false])
string getAlbum ()
string getArtist ()
string getComment ()
string getGenre ()
string getTitle ()
integer getTrack ()
string getYear ()
void setAlbum (string $album)
void setArtist (string $artist)
void setComment (string $comment)
void setGenre (integer $genre)
void setTitle (string $title)
void setTrack (integer $track)
void setYear (string $year)
void write ([string $filename = false])
mixed __get (string $name)
mixed __set (string $name, string $value)
Variables
static Array $genres = 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", "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 capella", "Euro-House",
"Dance Hall", 255 => "Unknown")
(line 83)

The genre list.

  • access: public
Methods
Constructor __construct (line 121)

Constructs the ID3v1 class with given file. The file is not mandatory argument and may be omitted. A new tag can be written to a file also by giving the filename to the #write method of this class.

  • access: public
ID3v1 __construct ([string|Reader $filename = false])
  • string|Reader $filename: The path to the file, file descriptor of an opened file, or Reader instance.
getAlbum (line 193)

Returns the album field.

  • access: public
string getAlbum ()
getArtist (line 178)

Returns the artist field.

  • access: public
string getArtist ()
getComment (line 223)

Returns the comment field.

  • access: public
string getComment ()
getGenre (line 255)

Returns the genre.

  • access: public
string getGenre ()
getTitle (line 163)

Returns the title field.

  • access: public
string getTitle ()
getTrack (line 239)

Returns the track field.

  • since: ID3v1.1
  • access: public
integer getTrack ()
getYear (line 208)

Returns the year field.

  • access: public
string getYear ()
setAlbum (line 201)

Sets a new value for the album field. The field cannot exceed 30 characters in length.

  • access: public
void setAlbum (string $album)
  • string $album: The album.
setArtist (line 186)

Sets a new value for the artist field. The field cannot exceed 30 characters in length.

  • access: public
void setArtist (string $artist)
  • string $artist: The artist.
setComment (line 231)

Sets a new value for the comment field. The field cannot exceed 30 characters in length.

  • access: public
void setComment (string $comment)
  • string $comment: The comment.
setGenre (line 272)

Sets a new value for the genre field. The value may either be a numerical code representing one of the genres, or its string variant.

The genre is set to unknown (code 255) in case the string is not found from the static $genres array of this class.

  • access: public
void setGenre (integer $genre)
  • integer $genre: The genre.
setTitle (line 171)

Sets a new value for the title field. The field cannot exceed 30 characters in length.

  • access: public
void setTitle (string $title)
  • string $title: The title.
setTrack (line 248)

Sets a new value for the track field. By setting this field you enforce the 1.1 version to be used.

  • since: ID3v1.1
  • access: public
void setTrack (integer $track)
  • integer $track: The track number.
setYear (line 216)

Sets a new value for the year field. The field cannot exceed 4 characters in length.

  • access: public
void setYear (string $year)
  • string $year: The year.
write (line 289)

Writes the possibly altered ID3v1 tag back to the file where it was read.

If the class was constructed without a file name, one can be provided here as an argument. Regardless, the write operation will override previous tag information, if found.

  • access: public
void write ([string $filename = false])
  • string $filename: The optional path to the file.
__get (line 310)

Magic function so that $obj->value will work.

  • access: public
mixed __get (string $name)
  • string $name: The field name.
__set (line 324)

Magic function so that assignments with $obj->value will work.

  • access: public
mixed __set (string $name, string $value)
  • string $name: The field name.
  • string $value: The field value.

Documentation generated on Fri, 05 Sep 2008 20:18:50 +0300 by phpDocumentor 1.4.1