.\" DO NOT MODIFY THIS FILE! it was generated by rd2 .TH mp3tag.rb 1 "July 2001" .SH Synopsis .PP Read the tag from a file or create and Mp3Tag instance for saving tag to mp3 file later: .nf \& tag = Mp3Tag.new(filename) .fi Examining tags: .nf \& tag.songname \& tag.artist \& tag.album \& tag.year \& tag.comment \& tag.tracknum \& tag.genre_id \& tag.genre .fi Setting tags: .nf \& tag.songname = "My Song" \& tag.artist = "Me" \& tag.album = "My Album" \& tag.year = "2001" \& tag.comment = "No Comment" \& tag.tracknum = 3 \& \& tag.genre_id = 23 \& tag.genre = "Drum Solo" .fi genre_id's should exist in Mp3Tag::Genres. Elements in Mp3Tag::Genres can be assigned using tag.genre= and the id will be looked up automatically. Saving tag to mp3: .nf \& tag.commit .fi Checking if a file has a tag: .nf \& Mp3Tag.hastag?(filename) .fi .SH Class Methods .PP .TP .fi .B Mp3Tag.new(path) Creates a new Mp3Tag object for the file give by path. .TP .fi .B Mp3Tag.hastag?(filename) Tests if filename has a ID3V1.0 or ID3V1.1 tag. Returns a boolean values giving the result of the test. .TP .fi .B Mp3Tag.removetag(filename) Removes an ID3v1 tag from the MP3 file filename .SH Instance Methods .PP .TP .fi .B songname .TP .fi .B artist .TP .fi .B album .TP .fi .B comment Return the song name, artist, album, or comment from the tag as a String object. Will return empty strings if file did not have a tag. .TP .fi .B tracknum Returns the track number from the tag. Will return 0 if the track number was not set in the tag when loaded, or if the file had no tag. .TP .fi .B year Returns the year from the tag. Will return 0 if the file had no tag. .TP .fi .B genre_id Return the id number of the genre from the tag. Will return 255 if the file had no tag. .TP .fi .B genre Returns the genre name. Will return "Unknown" if the file had no tag or the genre id was not in Mp3Tag::Genres .TP .fi .B path Returns the full path name of the MP3 file. .TP .fi .B filename Returns the filename without the directory part of the MP3 File. .TP .fi .B songname=(txt) .TP .fi .B artist=(txt) .TP .fi .B album=(txt) .TP .fi .B comment=(txt) Sets the song name, atist, album, or comment for the tag to txt. txt should be a String object. .TP .fi .B tracknum=(num) Sets the track number for the tag. Only values in the range (0..255) are allowed. .TP .fi .B year=(num) Sets the year for the tag. Should be a four digit number. .TP .fi .B genre_id=(num) Sets the the genre id for the tag. Only values in the range (0..255) are allowed. .TP .fi .B genre=(txt) Sets the genre id for the tag to the index of txt in Mp3Tag::Genres. The genre id will be set to 255 if txt is not found in the list. .TP .fi .B commit Saves the tag to the MP3 file. Will overwrite any existing tag.