|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 |
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 |
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 |
java.util.List<TagField> |
get(java.lang.String id)
Returns a list of TagField objects whose "id"
is the specified one. |
java.util.List<Artwork> |
getArtworkList()
|
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 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 tagfield 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()
|
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(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
It 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.
FieldDataInvalidException
public java.util.List<TagField> get(java.lang.String id)
Tag
TagField
objects whose "id"
is the specified one.
get
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(TagField field) throws FieldDataInvalidException
Tag
It 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
-
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.
It is not recommended to use this method for normal use of the audiolibrary, this is snot added to the structure
createField
in interface Tag
genericKey
- is the generic keyvalue
- to store
KeyNotFoundException
FieldDataInvalidException
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 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 java.util.Iterator<TagField> getFields()
Tag
getFields
in interface Tag
public int getFieldCount()
Tag
Fields with the same identifiers are counted seperately i.e two title fields would contribute two to the count
getFieldCount
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 |