|
||||||||||
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. |
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<TagField> |
getComment()
|
int |
getFieldCount()
Return the number of fields |
java.util.Iterator |
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()
|
java.lang.String |
getFirstComment()
|
TagField |
getFirstField(java.lang.String id)
Retrieve the first tagfield that exists for this key |
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 Tag
album
- Album description
FieldDataInvalidException
public void addArtist(java.lang.String artist) throws FieldDataInvalidException
addArtist
in interface Tag
artist
- Artist's name
FieldDataInvalidException
public void addComment(java.lang.String comment) throws FieldDataInvalidException
addComment
in interface Tag
comment
- Comment.
FieldDataInvalidException
public void addGenre(java.lang.String genre) throws FieldDataInvalidException
addGenre
in interface Tag
genre
- Genre
FieldDataInvalidException
public void addTitle(java.lang.String title) throws FieldDataInvalidException
addTitle
in interface Tag
title
- Title
FieldDataInvalidException
public void addTrack(java.lang.String track) throws FieldDataInvalidException
addTrack
in interface Tag
track
- Track
FieldDataInvalidException
public void addYear(java.lang.String year) throws FieldDataInvalidException
addYear
in interface Tag
year
- Year
FieldDataInvalidException
public java.util.List<TagField> get(java.lang.String id)
TagField
objects whose "id"
is the specified one.
get
in interface Tag
id
- The field id.
TagField
objects with the given "id".public java.util.List<TagField> getAlbum()
getAlbum
in interface Tag
public java.util.List<TagField> getArtist()
getArtist
in interface Tag
public java.util.List<TagField> getComment()
getComment
in interface Tag
public java.util.List<TagField> getGenre()
getGenre
in interface Tag
public java.util.List<TagField> getTitle()
getTitle
in interface Tag
public java.util.List<TagField> getTrack()
getTrack
in interface Tag
public java.util.List<TagField> getYear()
getYear
in interface Tag
public java.lang.String getFirstAlbum()
getFirstAlbum
in interface Tag
public java.lang.String getFirstArtist()
getFirstArtist
in interface Tag
public java.lang.String getFirstComment()
getFirstComment
in interface Tag
public java.lang.String getFirstGenre()
getFirstGenre
in interface Tag
public java.lang.String getFirstTitle()
getFirstTitle
in interface Tag
public java.lang.String getFirstTrack()
getFirstTrack
in interface Tag
public java.lang.String getFirstYear()
getFirstYear
in interface Tag
public boolean hasCommonFields()
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)
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 set(TagField field) throws FieldDataInvalidException
set
in interface Tag
field
-
FieldDataInvalidException
public void setAlbum(java.lang.String s) throws FieldDataInvalidException
setAlbum
in interface Tag
s
-
FieldDataInvalidException
public void setArtist(java.lang.String s) throws FieldDataInvalidException
setArtist
in interface Tag
s
-
FieldDataInvalidException
public void setComment(java.lang.String s) throws FieldDataInvalidException
setComment
in interface Tag
s
-
FieldDataInvalidException
public void setGenre(java.lang.String s) throws FieldDataInvalidException
setGenre
in interface Tag
s
-
FieldDataInvalidException
public void setTitle(java.lang.String s) throws FieldDataInvalidException
setTitle
in interface Tag
s
-
FieldDataInvalidException
public void setTrack(java.lang.String s) throws FieldDataInvalidException
setTrack
in interface Tag
s
-
FieldDataInvalidException
public void setYear(java.lang.String s) throws FieldDataInvalidException
setYear
in interface Tag
s
-
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 Tag
genericKey
- is the generic keyvalue
- to store
KeyNotFoundException
FieldDataInvalidException
public java.lang.String getFirst(java.lang.String id)
getFirst
in interface Tag
id
-
public java.lang.String getFirst(TagFieldKey id) throws KeyNotFoundException
getFirst
in interface Tag
id
-
KeyNotFoundException
public 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 Tag
id
- audio specific key
public void deleteTagField(TagFieldKey tagFieldKey) throws KeyNotFoundException
deleteTagField
in interface Tag
tagFieldKey
-
KeyNotFoundException
public java.util.Iterator getFields()
getFields
in interface Tag
public 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 Tag
FieldDataInvalidException
public java.util.List<TagField> get(TagFieldKey id) throws KeyNotFoundException
TagField
objects whose "id"
is the specified one.
get
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
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
-
FieldDataInvalidException
public TagField createLinkedArtworkField(java.lang.String url)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |