|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jaudiotagger.tag.id3.AbstractTagItem
org.jaudiotagger.tag.id3.AbstractTag
org.jaudiotagger.tag.id3.AbstractID3Tag
org.jaudiotagger.tag.id3.AbstractID3v1Tag
org.jaudiotagger.tag.id3.ID3v1Tag
public class ID3v1Tag
Represents an ID3v1 tag.
| Field Summary | |
|---|---|
protected java.lang.String |
album
|
protected java.lang.String |
artist
|
protected static int |
BYTE_TO_UNSIGNED
|
protected java.lang.String |
comment
|
protected static int |
FIELD_COMMENT_LENGTH
|
protected static int |
FIELD_COMMENT_POS
|
protected byte |
genre
|
protected static int |
GENRE_UNDEFINED
|
private static byte |
MAJOR_VERSION
|
private static byte |
RELEASE
|
private static byte |
REVISION
|
(package private) static java.util.EnumMap<FieldKey,ID3v1FieldKey> |
tagFieldToID3v1Field
|
protected java.lang.String |
title
|
protected static java.lang.String |
TYPE_COMMENT
|
protected java.lang.String |
year
|
| Fields inherited from class org.jaudiotagger.tag.id3.AbstractID3v1Tag |
|---|
END_OF_FIELD, endofStringPattern, FIELD_ALBUM_LENGTH, FIELD_ALBUM_POS, FIELD_ARTIST_LENGTH, FIELD_ARTIST_POS, FIELD_GENRE_LENGTH, FIELD_GENRE_POS, FIELD_TAGID_LENGTH, FIELD_TAGID_POS, FIELD_TITLE_LENGTH, FIELD_TITLE_POS, FIELD_YEAR_LENGTH, FIELD_YEAR_POS, logger, TAG_DATA_LENGTH, TAG_ID, TAG_LENGTH, TYPE_ALBUM, TYPE_ARTIST, TYPE_GENRE, TYPE_TITLE, TYPE_YEAR |
| Fields inherited from class org.jaudiotagger.tag.id3.AbstractID3Tag |
|---|
TAG_RELEASE |
| Fields inherited from class org.jaudiotagger.tag.id3.AbstractTag |
|---|
TYPE_TAG |
| Constructor Summary | |
|---|---|
ID3v1Tag()
Creates a new ID3v1 datatype. |
|
ID3v1Tag(AbstractTag mp3tag)
|
|
ID3v1Tag(ID3v1Tag copyObject)
|
|
ID3v1Tag(java.io.RandomAccessFile file)
Deprecated. use ID3v1Tag(RandomAccessFile,String) instead |
|
ID3v1Tag(java.io.RandomAccessFile file,
java.lang.String loggingFilename)
Creates a new ID3v1 datatype. |
|
| Method Summary | |
|---|---|
void |
addField(Artwork artwork)
Create artwork field based on the data in artwork and then add it to the tag itself |
void |
addField(FieldKey genericKey,
java.lang.String value)
Create the field based on the generic key and add it to the tag |
void |
addField(TagField field)
Adds a field to the structure, used internally by the library |
TagField |
createField(Artwork artwork)
Create artwork field based on the data in artwork |
TagField |
createField(FieldKey genericKey,
java.lang.String value)
Create Tag Field using generic key |
void |
createStructure()
Create strcutured representation of this item. |
void |
deleteArtworkField()
Delete all instance of artwork Field |
void |
deleteField(FieldKey genericKey)
Delete any instance of tag fields with this key |
boolean |
equals(java.lang.Object obj)
Determines whether another datatype is equal to this tag. |
java.util.List<TagField> |
get(java.lang.String id)
Returns a list of TagField objects whose "id"
is the specified one. |
java.util.List<TagField> |
getAlbum()
|
java.util.List<TagField> |
getArtist()
|
java.util.List<Artwork> |
getArtworkList()
|
java.util.List<TagField> |
getComment()
|
java.lang.String |
getEncoding()
|
int |
getFieldCount()
Return the number of fields |
java.util.Iterator<TagField> |
getFields()
Iterator over all the fields within the tag, handle multiple fields with the same id |
java.util.List<TagField> |
getFields(FieldKey genericKey)
Returns a list of TagField objects whose "id"
is the specified one. |
java.lang.String |
getFirst(FieldKey genericKey)
Retrieve the first value that exists for this generic key |
java.lang.String |
getFirst(java.lang.String genericKey)
Retrieve the first value that exists for this key id |
private java.lang.String |
getFirstAlbum()
Get Album |
private java.lang.String |
getFirstArtist()
Get Artist |
Artwork |
getFirstArtwork()
|
java.lang.String |
getFirstComment()
Get Comment |
TagField |
getFirstField(FieldKey genericKey)
|
TagField |
getFirstField(java.lang.String id)
Retrieve the first field that exists for this format specific key |
java.lang.String |
getFirstGenre()
Get Genre |
java.lang.String |
getFirstTitle()
Get title |
java.lang.String |
getFirstTrack()
|
java.lang.String |
getFirstYear()
Get year |
java.util.List<TagField> |
getGenre()
Get Genre field |
byte |
getMajorVersion()
Retrieve the Major Version |
byte |
getRelease()
Retrieve the Release |
byte |
getRevision()
Retrieve the Revision |
java.util.List<TagField> |
getTitle()
Get title field |
java.util.List<TagField> |
getTrack()
|
java.util.List<TagField> |
getYear()
Get year field |
boolean |
hasCommonFields()
Returns true, if at least one of the contained
fields is a common field (TagField.isCommon()). |
boolean |
hasField(java.lang.String id)
Determines whether the tag has at least one field with the specified "id". |
boolean |
isEmpty()
Determines whether the tag has no fields specified. |
java.util.Iterator |
iterator()
|
void |
read(java.nio.ByteBuffer byteBuffer)
|
protected java.util.List<TagField> |
returnFieldToList(ID3v1TagField field)
|
boolean |
seek(java.nio.ByteBuffer byteBuffer)
Does a tag of this version exist within the byteBuffer |
void |
setAlbum(java.lang.String album)
Set Album |
void |
setArtist(java.lang.String artist)
Set Artist |
void |
setComment(java.lang.String comment)
Set Comment |
boolean |
setEncoding(java.lang.String encoding)
|
void |
setField(Artwork artwork)
Create artwork field based on the data in artwork and then set it in the tag itself |
void |
setField(FieldKey genericKey,
java.lang.String value)
Create the field based on the generic key and set it in the tag |
void |
setField(TagField field)
Sets a field in the structure, used internally by the library |
void |
setGenre(java.lang.String genreVal)
Sets the genreID, |
void |
setTitle(java.lang.String title)
Set Title |
void |
setYear(java.lang.String year)
Set year |
void |
write(java.io.RandomAccessFile file)
Write this tag to the file, replacing any tag previously existing |
| Methods inherited from class org.jaudiotagger.tag.id3.AbstractID3v1Tag |
|---|
delete, getSize |
| Methods inherited from class org.jaudiotagger.tag.id3.AbstractID3Tag |
|---|
getIdentifier, getLoggingFilename, setLoggingFilename, toString |
| Methods inherited from class org.jaudiotagger.tag.id3.AbstractTagItem |
|---|
isSubsetOf |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jaudiotagger.tag.Tag |
|---|
toString |
| Field Detail |
|---|
static java.util.EnumMap<FieldKey,ID3v1FieldKey> tagFieldToID3v1Field
protected static final java.lang.String TYPE_COMMENT
protected static final int FIELD_COMMENT_LENGTH
protected static final int FIELD_COMMENT_POS
protected static final int BYTE_TO_UNSIGNED
protected static final int GENRE_UNDEFINED
protected java.lang.String album
protected java.lang.String artist
protected java.lang.String comment
protected java.lang.String title
protected java.lang.String year
protected byte genre
private static final byte RELEASE
private static final byte MAJOR_VERSION
private static final byte REVISION
| Constructor Detail |
|---|
public ID3v1Tag()
public ID3v1Tag(ID3v1Tag copyObject)
public ID3v1Tag(AbstractTag mp3tag)
public ID3v1Tag(java.io.RandomAccessFile file,
java.lang.String loggingFilename)
throws TagNotFoundException,
java.io.IOException
file - loggingFilename -
TagNotFoundException
java.io.IOException
public ID3v1Tag(java.io.RandomAccessFile file)
throws TagNotFoundException,
java.io.IOException
ID3v1Tag(RandomAccessFile,String) instead
file -
TagNotFoundException
java.io.IOException| Method Detail |
|---|
public byte getRelease()
getRelease in class AbstractID3Tagpublic byte getMajorVersion()
getMajorVersion in class AbstractID3Tagpublic byte getRevision()
getRevision in class AbstractID3Tagpublic void addField(TagField field)
TagIt is not recommended to use this method for normal use of the
audiolibrary. The developer will circumvent the underlying
implementation. For example, if one adds a field with the field id
"TALB" for an mp3 file, and the given
TagField
implementation does not return a text field compliant data with
TagField.getRawContent() other software and the audio library
won't read the file correctly, if they do read it at all.
So for short:
field - The field to add.
public java.util.List<TagField> get(java.lang.String id)
TagTagField objects whose "id"
is the specified one.
get in interface Tagid - The field id.
TagField objects with the given "id".public int getFieldCount()
TagFields with the same identifiers are counted seperately i.e two title fields would contribute two to the count
getFieldCount in interface Tagprotected java.util.List<TagField> returnFieldToList(ID3v1TagField field)
public void setAlbum(java.lang.String album)
album - private java.lang.String getFirstAlbum()
public java.util.List<TagField> getAlbum()
public void setArtist(java.lang.String artist)
artist - private java.lang.String getFirstArtist()
public java.util.List<TagField> getArtist()
public void setComment(java.lang.String comment)
comment -
java.lang.IllegalArgumentException - if comment nullpublic java.util.List<TagField> getComment()
public java.lang.String getFirstComment()
public void setGenre(java.lang.String genreVal)
ID3v1 only supports genres defined in a predefined list so if unable to find value in list set 255, which seems to be the value winamp uses for undefined.
genreVal - public java.lang.String getFirstGenre()
public java.util.List<TagField> getGenre()
Only a single genre is available in ID3v1
public void setTitle(java.lang.String title)
title - public java.lang.String getFirstTitle()
public java.util.List<TagField> getTitle()
Only a single title is available in ID3v1
public void setYear(java.lang.String year)
year - public java.lang.String getFirstYear()
public java.util.List<TagField> getYear()
Only a single year is available in ID3v1
public java.lang.String getFirstTrack()
public java.util.List<TagField> getTrack()
public TagField getFirstField(java.lang.String id)
TagCan be used to retrieve fields with any identifier, useful if the identifier is not within FieldKey
getFirstField in interface Tagid - audio specific key
public java.util.Iterator<TagField> getFields()
Tag
getFields in interface Tagpublic boolean hasCommonFields()
Tagtrue, if at least one of the contained
fields is a common field (TagField.isCommon()).
hasCommonFields in interface Tagtrue if a common
field is present.public boolean hasField(java.lang.String id)
Tag
hasField in interface Tagid - The field id to look for.
true if tag contains a TagField with the
given id.public boolean isEmpty()
Tag
isEmpty in interface Tagtrue if tag contains no field.
public void setField(FieldKey genericKey,
java.lang.String value)
throws KeyNotFoundException,
FieldDataInvalidException
Tag
setField in interface TagKeyNotFoundException
FieldDataInvalidException
public void addField(FieldKey genericKey,
java.lang.String value)
throws KeyNotFoundException,
FieldDataInvalidException
Tag
addField in interface TagKeyNotFoundException
FieldDataInvalidExceptionpublic void setField(TagField field)
TagIt is not recommended to use this method for normal use of the
audiolibrary. The developer will circumvent the underlying
implementation. For example, if one adds a field with the field id
"TALB" for an mp3 file, and the given
TagField
implementation does not return a text field compliant data with
TagField.getRawContent() other software and the audio library
won't read the file correctly, if they do read it at all.
So for short:
field - The field to add.
public boolean setEncoding(java.lang.String encoding)
setEncoding in interface Tagencoding -
public TagField createField(FieldKey genericKey,
java.lang.String value)
createField in interface TaggenericKey - is the generic keyvalue - to store
public java.lang.String getEncoding()
public TagField getFirstField(FieldKey genericKey)
getFirstField in interface Tagpublic java.util.List<TagField> getFields(FieldKey genericKey)
TagField objects whose "id"
is the specified one.
getFields in interface TaggenericKey - The generic field key
TagField objects with the given "id".public java.lang.String getFirst(java.lang.String genericKey)
getFirst in interface TaggenericKey -
public java.lang.String getFirst(FieldKey genericKey)
getFirst in interface TaggenericKey -
public void deleteField(FieldKey genericKey)
deleteField in interface TaggenericKey - public boolean equals(java.lang.Object obj)
AbstractTagsuper.equals(obj).
equals in class AbstractTagobj -
public java.util.Iterator iterator()
iterator in class AbstractTag
public void read(java.nio.ByteBuffer byteBuffer)
throws TagNotFoundException
read in class AbstractTagItembyteBuffer -
TagNotFoundExceptionpublic boolean seek(java.nio.ByteBuffer byteBuffer)
seek in class AbstractTag
public void write(java.io.RandomAccessFile file)
throws java.io.IOException
write in class AbstractTagfile -
java.io.IOExceptionpublic void createStructure()
public java.util.List<Artwork> getArtworkList()
getArtworkList in interface Tagpublic Artwork getFirstArtwork()
getFirstArtwork in interface Tag
public TagField createField(Artwork artwork)
throws FieldDataInvalidException
Tag
createField in interface TagFieldDataInvalidException
public void setField(Artwork artwork)
throws FieldDataInvalidException
Tag
setField in interface TagFieldDataInvalidException
public void addField(Artwork artwork)
throws FieldDataInvalidException
Tag
addField in interface TagFieldDataInvalidException
public void deleteArtworkField()
throws KeyNotFoundException
deleteArtworkField in interface TagKeyNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||