|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jaudiotagger.audio.AudioFile
org.jaudiotagger.audio.mp3.MP3File
public class MP3File
This class represents a physical MP3 File
Field Summary | |
---|---|
static int |
LOAD_ALL
|
static int |
LOAD_IDV1TAG
|
static int |
LOAD_IDV2TAG
|
static int |
LOAD_LYRICS3
This option is currently ignored |
Fields inherited from class org.jaudiotagger.audio.AudioFile |
---|
logger |
Constructor Summary | |
---|---|
MP3File()
Creates a new empty MP3File datatype that is not associated with a specific file. |
|
MP3File(java.io.File file)
Creates a new MP3File datatype and parse the tag from the given file Object. |
|
MP3File(java.io.File file,
int loadOptions)
Creates a new MP3File datatype and parse the tag from the given file Object, files must be writable to use this constructor. |
|
MP3File(java.io.File file,
int loadOptions,
boolean readOnly)
Creates a new MP3File datatype and parse the tag from the given file Object, files can be onpened read only if required. |
|
MP3File(java.lang.String filename)
Creates a new MP3File datatype and parse the tag from the given filename. |
Method Summary | |
---|---|
void |
commit()
Overriden for comptability with merged code |
void |
delete(AbstractTag mp3tag)
Remove tag from file |
java.lang.String |
displayStructureAsPlainText()
Displays MP3File Structure |
java.lang.String |
displayStructureAsXML()
Displays MP3File Structure |
java.io.File |
extractID3v2TagDataIntoFile(java.io.File outputFile)
Extracts the raw ID3v2 tag data into a file. |
ID3v1Tag |
getID3v1Tag()
Returns the ID3v1 tag for this datatype. |
AbstractID3v2Tag |
getID3v2Tag()
Returns the ID3v2 tag for this datatype. |
ID3v24Tag |
getID3v2TagAsv24()
|
MP3AudioHeader |
getMP3AudioHeader()
Return audio header |
long |
getMP3StartByte(java.io.File file)
Used by tags when writing to calculate the location of the music file |
static AbstractTagDisplayFormatter |
getStructureFormatter()
|
boolean |
hasID3v1Tag()
Returns true if this datatype contains an Id3v1 tag |
boolean |
hasID3v2Tag()
Returns true if this datatype contains an Id3v2 tag |
void |
save()
Saves the tags in this datatype to the file referred to by this datatype. |
void |
save(java.io.File file)
Saves the tags in this datatype to the file argument. |
void |
setID3v1Tag(AbstractTag mp3tag)
Sets the ID3v1 tag for this datatype. |
void |
setID3v1Tag(ID3v1Tag id3v1tag)
Sets the ID3v1(_1)tag to the tag provided as an argument. |
void |
setID3v1Tag(Tag id3v1tag)
|
void |
setID3v2Tag(AbstractID3v2Tag id3v2tag)
Sets the v2 tag to the v2 tag provided as an argument. |
void |
setID3v2Tag(AbstractTag mp3tag)
Sets the ID3v2 tag for this datatype. |
void |
setID3v2TagOnly(AbstractID3v2Tag id3v2tag)
Set v2 tag ,dont need to set v24 tag because saving TODO temp its rather messy |
void |
setTag(Tag tag)
Set the Tag If the parameter tag is a v1tag then the v1 tag is set if v2tag then the v2tag. |
Methods inherited from class org.jaudiotagger.audio.AudioFile |
---|
getAudioHeader, getFile, getTag, setFile, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int LOAD_IDV1TAG
public static final int LOAD_IDV2TAG
public static final int LOAD_LYRICS3
public static final int LOAD_ALL
Constructor Detail |
---|
public MP3File()
public MP3File(java.lang.String filename) throws java.io.IOException, TagException, ReadOnlyFileException, InvalidAudioFrameException
filename
- MP3 file
java.io.IOException
- on any I/O error
TagException
- on any exception generated by this library.
ReadOnlyFileException
InvalidAudioFrameException
public MP3File(java.io.File file, int loadOptions) throws java.io.IOException, TagException, ReadOnlyFileException, InvalidAudioFrameException
file
- MP3 fileloadOptions
- decide what tags to load
java.io.IOException
- on any I/O error
TagException
- on any exception generated by this library.
ReadOnlyFileException
InvalidAudioFrameException
public MP3File(java.io.File file, int loadOptions, boolean readOnly) throws java.io.IOException, TagException, ReadOnlyFileException, InvalidAudioFrameException
file
- MP3 fileloadOptions
- decide what tags to loadreadOnly
- causes the files to be opened readonly
java.io.IOException
- on any I/O error
TagException
- on any exception generated by this library.
ReadOnlyFileException
InvalidAudioFrameException
public MP3File(java.io.File file) throws java.io.IOException, TagException, ReadOnlyFileException, InvalidAudioFrameException
file
- MP3 file
java.io.IOException
- on any I/O error
TagException
- on any exception generated by this library.
ReadOnlyFileException
InvalidAudioFrameException
Method Detail |
---|
public long getMP3StartByte(java.io.File file) throws InvalidAudioFrameException, java.io.IOException
InvalidAudioFrameException
java.io.IOException
public java.io.File extractID3v2TagDataIntoFile(java.io.File outputFile) throws TagNotFoundException, java.io.IOException
outputFile
- to write the data to
TagNotFoundException
java.io.IOException
public MP3AudioHeader getMP3AudioHeader()
public boolean hasID3v1Tag()
Id3v1
tag
Id3v1
tagpublic boolean hasID3v2Tag()
Id3v2
tag
Id3v2
tagpublic void setID3v1Tag(ID3v1Tag id3v1tag)
id3v1tag
- public void setID3v1Tag(Tag id3v1tag)
public void setID3v1Tag(AbstractTag mp3tag)
ID3v1
tag for this datatype. A new
ID3v1_1
datatype is created from the argument and then used
here.
mp3tag
- Any MP3Tag datatype can be used and will be converted into a
new ID3v1_1 datatype.public ID3v1Tag getID3v1Tag()
ID3v1
tag for this datatype.
ID3v1
tag for this datatypepublic void setID3v2Tag(AbstractTag mp3tag)
ID3v2
tag for this datatype. A new
ID3v2_4
datatype is created from the argument and then used
here.
mp3tag
- Any MP3Tag datatype can be used and will be converted into a
new ID3v2_4 datatype.public void setID3v2Tag(AbstractID3v2Tag id3v2tag)
id3v2tag
- public void setID3v2TagOnly(AbstractID3v2Tag id3v2tag)
public AbstractID3v2Tag getID3v2Tag()
ID3v2
tag for this datatype.
ID3v2
tag for this datatypepublic ID3v24Tag getID3v2TagAsv24()
public void delete(AbstractTag mp3tag) throws java.io.FileNotFoundException, java.io.IOException
mp3tag
-
java.io.FileNotFoundException
java.io.IOException
public void save() throws java.io.IOException, TagException
java.io.IOException
- on any I/O error
TagException
- on any exception generated by this library.public void commit() throws CannotWriteException
commit
in class AudioFile
CannotWriteException
AudioFileIO
public void save(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
file
- file to save the this datatype's tags to
java.io.FileNotFoundException
- if unable to find file
java.io.IOException
- on any I/O errorpublic java.lang.String displayStructureAsXML()
displayStructureAsXML
in class AudioFile
public java.lang.String displayStructureAsPlainText()
displayStructureAsPlainText
in class AudioFile
public static AbstractTagDisplayFormatter getStructureFormatter()
public void setTag(Tag tag)
setTag
in class AudioFile
tag
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |