|
|||||||||
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 Tag
field
- The field to add.
FieldDataInvalidException
public java.util.List<TagField> getFields(java.lang.String id)
Tag
TagField
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 Tag
id
- The field id.
TagField
objects with the given "id".public boolean hasCommonFields()
Tag
true
, if at least one of the contained
fields is a common field (TagField.isCommon()
).
hasCommonFields
in interface Tag
true
if a common
field is present.public boolean hasField(java.lang.String id)
Tag
hasField
in interface Tag
id
- 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 Tag
true
if tag contains no field.public void setField(FieldKey genericKey, java.lang.String value) throws KeyNotFoundException, FieldDataInvalidException
Tag
setField
in interface Tag
KeyNotFoundException
FieldDataInvalidException
public void addField(FieldKey genericKey, java.lang.String value) throws KeyNotFoundException, FieldDataInvalidException
Tag
addField
in interface Tag
KeyNotFoundException
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 Tag
field
-
FieldDataInvalidException
public TagField createField(FieldKey genericKey, java.lang.String value) throws KeyNotFoundException, FieldDataInvalidException
Tag
Only textual data supported at the moment. The genericKey will be mapped to the correct implementation key and return a TagField.
createField
in interface Tag
genericKey
- 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)
Tag
Can 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 Tag
id
- n
- m
-
public java.lang.String getValue(FieldKey id, int index) throws KeyNotFoundException
Tag
getValue
in interface Tag
KeyNotFoundException
public java.lang.String getFirst(FieldKey id) throws KeyNotFoundException
Tag
getFirst
in interface Tag
KeyNotFoundException
public TagField getFirstField(java.lang.String id)
Tag
Can be used to retrieve fields with any identifier, useful if the identifier is not within FieldKey
getFirstField
in interface Tag
id
- audio specific key
public TagField getFirstField(FieldKey genericKey) throws KeyNotFoundException
getFirstField
in interface Tag
KeyNotFoundException
public void deleteField(FieldKey fieldKey) throws KeyNotFoundException
deleteField
in interface Tag
fieldKey
-
KeyNotFoundException
public void deleteField(java.lang.String id) throws KeyNotFoundException
Tag
deleteField
in interface Tag
KeyNotFoundException
public java.util.Iterator<TagField> getFields()
Tag
getFields
in interface Tag
public int getFieldCount()
Tag
Fields with the same identifiers are counted separately i.e two TITLE fields in a Vorbis Comment file would count as two
getFieldCount
in interface Tag
public int getFieldCountIncludingSubValues()
Tag
getFieldCountIncludingSubValues
in interface Tag
public boolean setEncoding(java.lang.String enc) throws FieldDataInvalidException
setEncoding
in interface Tag
FieldDataInvalidException
public java.util.List<TagField> getFields(FieldKey id) throws KeyNotFoundException
Tag
TagField
objects whose "id"
is the specified one.
getFields
in interface Tag
id
- 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
-
FieldDataInvalidException
public TagField createLinkedArtworkField(java.lang.String url)
url
-
public TagField createField(Artwork artwork) throws FieldDataInvalidException
createField
in interface Tag
FieldDataInvalidException
public void setField(Artwork artwork) throws FieldDataInvalidException
Tag
setField
in interface Tag
FieldDataInvalidException
public void addField(Artwork artwork) throws FieldDataInvalidException
Tag
addField
in interface Tag
FieldDataInvalidException
public java.util.List<Artwork> getArtworkList()
getArtworkList
in interface Tag
public Artwork getFirstArtwork()
getFirstArtwork
in interface Tag
public void deleteArtworkField() throws KeyNotFoundException
deleteArtworkField
in interface Tag
KeyNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |