|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jaudiotagger.tag.flac.FlacTag
public class FlacTag
Flac uses Vorbis Comment for most of its metadata and a Flac Picture Block for images
This class enscapulates the items into a single tag
| Field Summary | |
|---|---|
private java.util.List<MetadataBlockDataPicture> |
images
|
private VorbisCommentTag |
tag
|
| Constructor Summary | |
|---|---|
FlacTag(VorbisCommentTag tag,
java.util.List<MetadataBlockDataPicture> images)
|
|
| 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 This is handled differently by different formats |
void |
addField(java.lang.String vorbisCommentKey,
java.lang.String value)
Create and add field with name of vorbisCommentkey |
void |
addField(TagField field)
Adds a field to the structure, used internally by the library |
TagField |
createArtworkField(java.awt.image.BufferedImage bi,
int pictureType,
java.lang.String mimeType,
java.lang.String description,
int colourDepth,
int indexedColouredCount)
Create Artwork when have the bufferedimage |
TagField |
createArtworkField(byte[] imageData,
int pictureType,
java.lang.String mimeType,
java.lang.String description,
int width,
int height,
int colourDepth,
int indexedColouredCount)
|
TagField |
createField(Artwork artwork)
Create artwork field |
TagField |
createField(FieldKey genericKey,
java.lang.String value)
Create a new field based on generic key, used internally by the library |
TagField |
createField(java.lang.String vorbisCommentFieldKey,
java.lang.String value)
Create Tag Field using ogg key This method is provided to allow you to create key of any value because VorbisComment allows arbitary keys. |
TagField |
createField(VorbisCommentFieldKey vorbisCommentFieldKey,
java.lang.String value)
Create Tag Field using ogg key |
TagField |
createLinkedArtworkField(java.lang.String url)
Create Link to Image File, not recommended because if either flac or image file is moved link will be broken. |
void |
deleteArtworkField()
Delete all instance of artwork Field |
void |
deleteField(FieldKey fieldKey)
Delete any instance of tag fields with this key |
void |
deleteField(java.lang.String id)
Delete any fields with this Flac (Vorbis Comment) id |
java.util.List<Artwork> |
getArtworkList()
|
int |
getFieldCount()
Return the number of fields |
int |
getFieldCountIncludingSubValues()
Return the number of fields taking multiple value fields into consideration Fields that actually contain multiple values are counted seperately i.e. |
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 id)
Returns a list of TagField objects whose "id"
is the specified one. |
java.util.List<TagField> |
getFields(java.lang.String id)
Returns a list of TagField objects whose "id"
is the specified one. |
java.lang.String |
getFirst(FieldKey id)
Retrieve String value of the first tag field that exists for this generic key |
java.lang.String |
getFirst(java.lang.String id)
Retrieve String value of the first value that exists for this format specific key |
Artwork |
getFirstArtwork()
|
TagField |
getFirstField(FieldKey genericKey)
|
TagField |
getFirstField(java.lang.String id)
Retrieve the first field that exists for this format specific key |
java.util.List<MetadataBlockDataPicture> |
getImages()
|
java.lang.String |
getSubValue(FieldKey id,
int n,
int m)
The m parameter is effectively ignored |
java.lang.String |
getValue(FieldKey id,
int index)
Retrieve String value of the nth tag field that exists for this generic key |
VorbisCommentTag |
getVorbisCommentTag()
|
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. |
boolean |
setEncoding(java.lang.String enc)
|
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(java.lang.String vorbisCommentKey,
java.lang.String value)
Create and set field with name of vorbisCommentkey |
void |
setField(TagField field)
Sets a field in the structure, used internally by the library |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jaudiotagger.tag.Tag |
|---|
toString |
| Field Detail |
|---|
private VorbisCommentTag tag
private java.util.List<MetadataBlockDataPicture> images
| Constructor Detail |
|---|
public FlacTag(VorbisCommentTag tag,
java.util.List<MetadataBlockDataPicture> images)
| Method Detail |
|---|
public java.util.List<MetadataBlockDataPicture> getImages()
public VorbisCommentTag getVorbisCommentTag()
public void addField(TagField field)
throws FieldDataInvalidException
Tag
addField in interface Tagfield - The field to add.
FieldDataInvalidExceptionpublic java.util.List<TagField> getFields(java.lang.String id)
TagTagField objects whose "id"
is the specified one.Can be used to retrieve fields with any identifier, useful if the identifier is not within FieldKey
getFields in interface Tagid - The field id.
TagField objects with the given "id".public 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()
If there are no images we return empty if either there is no VorbisTag or if there is a VorbisTag but it is empty
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
FieldDataInvalidException
public void setField(java.lang.String vorbisCommentKey,
java.lang.String value)
throws KeyNotFoundException,
FieldDataInvalidException
vorbisCommentKey - value -
KeyNotFoundException
FieldDataInvalidException
public void addField(java.lang.String vorbisCommentKey,
java.lang.String value)
throws KeyNotFoundException,
FieldDataInvalidException
vorbisCommentKey - value -
KeyNotFoundException
FieldDataInvalidException
public void setField(TagField field)
throws FieldDataInvalidException
Tag
setField in interface Tagfield -
FieldDataInvalidException
public TagField createField(FieldKey genericKey,
java.lang.String value)
throws KeyNotFoundException,
FieldDataInvalidException
TagOnly textual data supported at the moment. The genericKey will be mapped to the correct implementation key and return a TagField.
createField in interface TaggenericKey - is the generic keyvalue - to store
KeyNotFoundException
FieldDataInvalidException
public TagField createField(VorbisCommentFieldKey vorbisCommentFieldKey,
java.lang.String value)
throws KeyNotFoundException,
FieldDataInvalidException
vorbisCommentFieldKey - value -
KeyNotFoundException
FieldDataInvalidException
public TagField createField(java.lang.String vorbisCommentFieldKey,
java.lang.String value)
vorbisCommentFieldKey - value -
public java.lang.String getFirst(java.lang.String id)
TagCan be used to retrieve fields with any identifier, useful if the identifier is not within FieldKey
getFirst in interface Tag
public java.lang.String getSubValue(FieldKey id,
int n,
int m)
getSubValue in interface Tagid - n - m -
public java.lang.String getValue(FieldKey id,
int index)
throws KeyNotFoundException
Tag
getValue in interface TagKeyNotFoundException
public java.lang.String getFirst(FieldKey id)
throws KeyNotFoundException
Tag
getFirst in interface TagKeyNotFoundExceptionpublic 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 TagField getFirstField(FieldKey genericKey)
throws KeyNotFoundException
getFirstField in interface TagKeyNotFoundException
public void deleteField(FieldKey fieldKey)
throws KeyNotFoundException
deleteField in interface TagfieldKey -
KeyNotFoundException
public void deleteField(java.lang.String id)
throws KeyNotFoundException
Tag
deleteField in interface TagKeyNotFoundExceptionpublic java.util.Iterator<TagField> getFields()
Tag
getFields in interface Tagpublic int getFieldCount()
TagFields with the same identifiers are counted separately i.e two TITLE fields in a Vorbis Comment file would count as two
getFieldCount in interface Tagpublic int getFieldCountIncludingSubValues()
Tag
getFieldCountIncludingSubValues in interface Tag
public boolean setEncoding(java.lang.String enc)
throws FieldDataInvalidException
setEncoding in interface TagFieldDataInvalidException
public java.util.List<TagField> getFields(FieldKey id)
throws KeyNotFoundException
TagTagField objects whose "id"
is the specified one.
getFields in interface Tagid - The field id.
TagField objects with the given "id".
KeyNotFoundException
public TagField createArtworkField(byte[] imageData,
int pictureType,
java.lang.String mimeType,
java.lang.String description,
int width,
int height,
int colourDepth,
int indexedColouredCount)
throws FieldDataInvalidException
FieldDataInvalidException
public TagField createArtworkField(java.awt.image.BufferedImage bi,
int pictureType,
java.lang.String mimeType,
java.lang.String description,
int colourDepth,
int indexedColouredCount)
throws FieldDataInvalidException
bi - pictureType - mimeType - description - colourDepth - indexedColouredCount -
FieldDataInvalidExceptionpublic TagField createLinkedArtworkField(java.lang.String url)
url -
public TagField createField(Artwork artwork)
throws FieldDataInvalidException
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 TagFieldDataInvalidExceptionpublic java.util.List<Artwork> getArtworkList()
getArtworkList in interface Tagpublic Artwork getFirstArtwork()
getFirstArtwork in interface Tag
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 | ||||||||