|
||||||||||
| 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
| Constructor Summary | |
|---|---|
FlacTag(VorbisCommentTag tag,
java.util.List<MetadataBlockDataPicture> images)
|
|
| Method Summary | |
|---|---|
void |
add(TagField field)
Adds a tagfield to the structure. |
void |
addAlbum(java.lang.String album)
Adds an album to the tag. |
void |
addArtist(java.lang.String artist)
Adds an artist to the tag. |
void |
addComment(java.lang.String comment)
Adds a comment to the tag. |
void |
addGenre(java.lang.String genre)
Adds a genre to the tag. |
void |
addTitle(java.lang.String title)
Adds a title to the tag. |
void |
addTrack(java.lang.String track)
Adds a track to the tag. |
void |
addYear(java.lang.String year)
Adds a year to the Tag. |
void |
createAndSetArtworkField(Artwork artwork)
Create field and then set within tag itself |
TagField |
createArtworkField(Artwork artwork)
Create artwork field |
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)
Create Artwork when have the raw image data |
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. |
TagField |
createTagField(TagFieldKey genericKey,
java.lang.String value)
Create a new TagField based on generic key |
void |
deleteTagField(TagFieldKey tagFieldKey)
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<TagField> |
get(TagFieldKey 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()
|
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.lang.String |
getFirst(java.lang.String id)
Retrieve the first value that exists for this key |
java.lang.String |
getFirst(TagFieldKey id)
Retrieve String value of first tagfield that exists for this key |
java.lang.String |
getFirstAlbum()
|
java.lang.String |
getFirstArtist()
|
Artwork |
getFirstArtwork()
|
java.lang.String |
getFirstComment()
|
TagField |
getFirstField(java.lang.String id)
Retrieve the first tagfield that exists for this key |
TagField |
getFirstField(TagFieldKey genericKey)
|
java.lang.String |
getFirstGenre()
|
java.lang.String |
getFirstTitle()
|
java.lang.String |
getFirstTrack()
|
java.lang.String |
getFirstYear()
|
java.util.List<TagField> |
getGenre()
|
java.util.List<MetadataBlockDataPicture> |
getImages()
|
java.util.List<TagField> |
getTitle()
|
java.util.List<TagField> |
getTrack()
|
VorbisCommentTag |
getVorbisCommentTag()
|
java.util.List<TagField> |
getYear()
|
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. |
void |
set(TagField field)
|
void |
setAlbum(java.lang.String s)
|
void |
setArtist(java.lang.String s)
|
void |
setComment(java.lang.String s)
|
boolean |
setEncoding(java.lang.String enc)
|
void |
setGenre(java.lang.String s)
|
void |
setTitle(java.lang.String s)
|
void |
setTrack(java.lang.String s)
|
void |
setYear(java.lang.String s)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jaudiotagger.tag.Tag |
|---|
toString |
| Constructor Detail |
|---|
public FlacTag(VorbisCommentTag tag,
java.util.List<MetadataBlockDataPicture> images)
| Method Detail |
|---|
public java.util.List<MetadataBlockDataPicture> getImages()
public VorbisCommentTag getVorbisCommentTag()
public void add(TagField field)
throws FieldDataInvalidException
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 void addAlbum(java.lang.String album)
throws FieldDataInvalidException
addAlbum in interface Tagalbum - Album description
FieldDataInvalidException
public void addArtist(java.lang.String artist)
throws FieldDataInvalidException
addArtist in interface Tagartist - Artist's name
FieldDataInvalidException
public void addComment(java.lang.String comment)
throws FieldDataInvalidException
addComment in interface Tagcomment - Comment.
FieldDataInvalidException
public void addGenre(java.lang.String genre)
throws FieldDataInvalidException
addGenre in interface Taggenre - Genre
FieldDataInvalidException
public void addTitle(java.lang.String title)
throws FieldDataInvalidException
addTitle in interface Tagtitle - Title
FieldDataInvalidException
public void addTrack(java.lang.String track)
throws FieldDataInvalidException
addTrack in interface Tagtrack - Track
FieldDataInvalidException
public void addYear(java.lang.String year)
throws FieldDataInvalidException
addYear in interface Tagyear - Year
FieldDataInvalidExceptionpublic java.util.List<TagField> get(java.lang.String id)
TagField objects whose "id"
is the specified one.
get in interface Tagid - The field id.
TagField objects with the given "id".public java.util.List<TagField> getAlbum()
getAlbum in interface Tagpublic java.util.List<TagField> getArtist()
getArtist in interface Tagpublic java.util.List<TagField> getComment()
getComment in interface Tagpublic java.util.List<TagField> getGenre()
getGenre in interface Tagpublic java.util.List<TagField> getTitle()
getTitle in interface Tagpublic java.util.List<TagField> getTrack()
getTrack in interface Tagpublic java.util.List<TagField> getYear()
getYear in interface Tagpublic java.lang.String getFirstAlbum()
getFirstAlbum in interface Tagpublic java.lang.String getFirstArtist()
getFirstArtist in interface Tagpublic java.lang.String getFirstComment()
getFirstComment in interface Tagpublic java.lang.String getFirstGenre()
getFirstGenre in interface Tagpublic java.lang.String getFirstTitle()
getFirstTitle in interface Tagpublic java.lang.String getFirstTrack()
getFirstTrack in interface Tagpublic java.lang.String getFirstYear()
getFirstYear in interface Tagpublic boolean hasCommonFields()
true, 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)
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 set(TagField field)
throws FieldDataInvalidException
set in interface Tagfield -
FieldDataInvalidException
public void setAlbum(java.lang.String s)
throws FieldDataInvalidException
setAlbum in interface Tags -
FieldDataInvalidException
public void setArtist(java.lang.String s)
throws FieldDataInvalidException
setArtist in interface Tags -
FieldDataInvalidException
public void setComment(java.lang.String s)
throws FieldDataInvalidException
setComment in interface Tags -
FieldDataInvalidException
public void setGenre(java.lang.String s)
throws FieldDataInvalidException
setGenre in interface Tags -
FieldDataInvalidException
public void setTitle(java.lang.String s)
throws FieldDataInvalidException
setTitle in interface Tags -
FieldDataInvalidException
public void setTrack(java.lang.String s)
throws FieldDataInvalidException
setTrack in interface Tags -
FieldDataInvalidException
public void setYear(java.lang.String s)
throws FieldDataInvalidException
setYear in interface Tags -
FieldDataInvalidException
public TagField createTagField(TagFieldKey genericKey,
java.lang.String value)
throws KeyNotFoundException,
FieldDataInvalidException
Only textual data supported at the moment. The genericKey will be mapped to the correct implementation key and return a TagField.
createTagField in interface TaggenericKey - is the generic keyvalue - to store
KeyNotFoundException
FieldDataInvalidExceptionpublic java.lang.String getFirst(java.lang.String id)
getFirst in interface Tagid -
public java.lang.String getFirst(TagFieldKey id)
throws KeyNotFoundException
getFirst in interface Tagid -
KeyNotFoundExceptionpublic TagField getFirstField(java.lang.String id)
Can be used to retrieve fields with any identifier, useful if the identifier is not within the jaudiotagger enum
getFirstField in interface Tagid - audio specific key
public TagField getFirstField(TagFieldKey genericKey)
throws KeyNotFoundException
getFirstField in interface TagKeyNotFoundException
public void deleteTagField(TagFieldKey tagFieldKey)
throws KeyNotFoundException
deleteTagField in interface TagtagFieldKey -
KeyNotFoundExceptionpublic java.util.Iterator<TagField> getFields()
getFields in interface Tagpublic int getFieldCount()
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 TagFieldDataInvalidException
public java.util.List<TagField> get(TagFieldKey id)
throws KeyNotFoundException
TagField objects whose "id"
is the specified one.
get 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
imageData - pictureType - mimeType - description - width - height - colourDepth - indexedColouredCount -
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
pictureType - mimeType - description - colourDepth - indexedColouredCount -
FieldDataInvalidExceptionpublic TagField createLinkedArtworkField(java.lang.String url)
public TagField createArtworkField(Artwork artwork)
throws FieldDataInvalidException
createArtworkField in interface TagFieldDataInvalidException
public void createAndSetArtworkField(Artwork artwork)
throws FieldDataInvalidException
createAndSetArtworkField in interface Tagartwork -
FieldDataInvalidExceptionpublic java.util.List<Artwork> getArtworkList()
getArtworkList in interface Tagpublic Artwork getFirstArtwork()
getFirstArtwork in interface Tag
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||