public class ID3v1Tag extends Object
| Constructor and Description |
|---|
ID3v1Tag(RandomAccessInputStream raf)
Create an id3v1tag from the file specified.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAlbum()
Return the album field of the tag
|
String |
getArtist()
Return the artist field of the tag
|
String |
getComment()
Return the comment field of the tag
|
int |
getGenre()
Return the genre field of the tag
|
String |
getGenreString()
Return the genre name based on the ID3/Nullsoft standards.
|
int |
getSize()
Return the size in bytes of the tag.
|
String |
getTitle()
Return the title field of the tag
|
int |
getTrack()
Return the track field of the tag
|
String |
getYear()
Return the year field of the tag
|
void |
removeTag(RandomAccessFile raf)
Removes the id3v1 tag from the file specified in the constructor
by reducing the file size
|
void |
setAlbum(String newAlbum)
Set the album field of the tag.
|
void |
setArtist(String newArtist)
Set the artist field of the tag.
|
void |
setComment(String newComment)
Set the comment field of the tag.
|
void |
setGenre(int newGenre)
Set the genre field of the tag.
|
boolean |
setGenreString(String str)
Attempt to set the genre value of this tag from the string specified.
|
void |
setTitle(String newTitle)
Set the title field of the tag.
|
void |
setTrack(int newTrack)
Set the track field of the tag.
|
void |
setYear(String newYear)
Set the year field of the tag.
|
boolean |
tagExists()
Checks if a tag exists
|
String |
toString() |
void |
writeTag(RandomAccessFile raf)
Writes the information in this tag to the file specified in the
constructor.
|
public ID3v1Tag(RandomAccessInputStream raf) throws FileNotFoundException, IOException
mp3 - the file to read/write the tag toFileNotFoundException - if an error occursIOException - if an error occurspublic void writeTag(RandomAccessFile raf) throws FileNotFoundException, IOException
FileNotFoundException - if an error occursIOException - if an error occurspublic void removeTag(RandomAccessFile raf) throws FileNotFoundException, IOException
FileNotFoundException - if an error occursIOException - if an error occurspublic String getGenreString()
public boolean setGenreString(String str)
str - the string value of the genre to attempt to setpublic boolean tagExists()
public String getTitle()
public void setTitle(String newTitle)
newTitle - the title for the tagpublic String getArtist()
public void setArtist(String newArtist)
newArtist - the artist for the tagpublic String getAlbum()
public void setAlbum(String newAlbum)
newAlbum - the album for the tagpublic String getYear()
public void setYear(String newYear)
newYear - the year for the tagpublic String getComment()
public void setComment(String newComment)
newComment - the comment of the tagpublic int getTrack()
public void setTrack(int newTrack)
newTrack - the track of the tagpublic int getGenre()
public void setGenre(int newGenre)
throws ID3FieldDataException
newGenre - the genre of the tagID3FieldDataException - if the value supplie is invalidpublic int getSize()
Copyright © 2014. All rights reserved.