|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.vdheide.mp3.ID3
Class to read and modify ID3 tags on MP3 files.
ID3 information is loaded
ID3 information is written
If a file does not contain an ID3 tag, each read access will throw a NoID3TagException. A write access will create an ID3 tag if none is present.
Constructor Summary | |
ID3(java.io.File mp3_file)
Create a new ID3 tag which is based on mp3_file |
Method Summary | |
boolean |
checkForTag()
Check if ID3 tag is present |
java.lang.String |
getAlbum()
Read album from ID3 tag |
java.lang.String |
getArtist()
Read artist from ID3 tag |
java.lang.String |
getComment()
Read comment from ID3 tag |
int |
getGenre()
Read genre from ID3 tag |
java.lang.String |
getTitle()
Read title from ID3 tag |
int |
getTrack()
Read track number from ID3 tag |
java.lang.String |
getYear()
Read year from ID3 tag |
void |
readTag()
Read ID3 tag and prepare for retrieval with getXXX. |
void |
setAlbum(java.lang.String album)
Set album |
void |
setArtist(java.lang.String artist)
Set artist |
void |
setComment(java.lang.String comment)
Set comment |
void |
setGenre(int genre)
Set genre |
void |
setTitle(java.lang.String title)
Set title |
void |
setTrack(int track)
Set track number |
void |
setYear(java.lang.String year)
Set year |
void |
writeTag()
Write information provided with setXXX to ID3 tag |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ID3(java.io.File mp3_file)
mp3_file
- MP3 file to read ID3 tag to / write ID3 tag toMethod Detail |
public java.lang.String getTitle() throws NoID3TagException
NoID3TagException
- If file does not contain an ID3 tagpublic java.lang.String getArtist() throws NoID3TagException
NoID3TagException
- If file does not contain an ID3 tagpublic java.lang.String getAlbum() throws NoID3TagException
NoID3TagException
- If file does not contain an ID3 tagpublic java.lang.String getYear() throws NoID3TagException
NoID3TagException
- If file does not contain an ID3 tagpublic int getGenre() throws NoID3TagException
NoID3TagException
- If file does not contain an ID3 tagpublic java.lang.String getComment() throws NoID3TagException
NoID3TagException
- If file does not contain an ID3 tagpublic int getTrack() throws NoID3TagException
NoID3TagException
- If file does not contain an ID3 tagpublic void readTag() throws NoID3TagException, java.io.IOException
NoID3TagException
- If file does not contain an ID3 tag
java.io.IOException
- If I/O error occurspublic void setTitle(java.lang.String title)
title
- Titlepublic void setArtist(java.lang.String artist)
artist
- Artistpublic void setAlbum(java.lang.String album)
album
- Albumpublic void setYear(java.lang.String year)
year
- Yearpublic void setComment(java.lang.String comment)
comment
- Commentpublic void setTrack(int track) throws ID3IllegalFormatException
track
- Track number
ID3IllegalFormatException
- if track is negative or larger than 255public void setGenre(int genre) throws ID3IllegalFormatException
genre
- Genre
ID3IllegalFormatException
- if genre is negative or larger than 255public void writeTag() throws java.io.IOException
java.io.IOException
public boolean checkForTag() throws java.io.IOException
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |