Constructor and Description |
---|
FlacTag() |
FlacTag(VorbisCommentTag tag,
List<MetadataBlockDataPicture> images) |
Modifier and Type | Method and Description |
---|---|
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,
String... values)
Create new field and add it to the tag
|
void |
addField(String vorbisCommentKey,
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(byte[] imageData,
int pictureType,
String mimeType,
String description,
int width,
int height,
int colourDepth,
int indexedColouredCount) |
TagField |
createCompilationField(boolean value)
Creates isCompilation field
It is useful to have this method because it handles ensuring that the correct value to represent a boolean
is stored in the underlying field format.
|
TagField |
createField(Artwork artwork)
Create artwork field
|
TagField |
createField(FieldKey genericKey,
String... value)
Create a new field based on generic key, used internally by the library
|
TagField |
createField(String vorbisCommentFieldKey,
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,
String value)
Create Tag Field using ogg key
|
TagField |
createLinkedArtworkField(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(String id)
Delete any fields with this Flac (Vorbis Comment) id
|
List<String> |
getAll(FieldKey genericKey)
Maps the generic key to the specific key and return the list of values for this field as strings
|
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.
|
Iterator<TagField> |
getFields()
Iterator over all the fields within the tag, handle multiple fields with the same id
|
List<TagField> |
getFields(FieldKey id)
|
List<TagField> |
getFields(String id)
|
String |
getFirst(FieldKey id)
Retrieve String value of the first tag field that exists for this generic key
|
String |
getFirst(String id)
Retrieve String value of the first value that exists for this format specific key
|
Artwork |
getFirstArtwork() |
TagField |
getFirstField(FieldKey genericKey) |
TagField |
getFirstField(String id)
Retrieve the first field that exists for this format specific key
|
List<MetadataBlockDataPicture> |
getImages() |
String |
getValue(FieldKey id,
int index)
Retrieve String value of the nth tag field that exists for this generic key
|
VorbisCommentTag |
getVorbisCommentTag() |
boolean |
hasCommonFields()
|
boolean |
hasField(FieldKey genericKey)
Determines whether the tag has at least one field with the specified field key.
|
boolean |
hasField(String id)
Determines whether the tag has at least one field with the specified
"id".
|
boolean |
hasField(VorbisCommentFieldKey vorbisFieldKey) |
boolean |
isEmpty()
Determines whether the tag has no fields specified.
|
boolean |
setEncoding(Charset 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,
String... values)
Create the field based on the generic key and set it in the tag
|
void |
setField(String vorbisCommentKey,
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
|
String |
toString() |
public FlacTag()
public FlacTag(VorbisCommentTag tag, List<MetadataBlockDataPicture> images)
public 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 List<String> getAll(FieldKey genericKey) throws KeyNotFoundException
getAll
in interface Tag
genericKey
- KeyNotFoundException
public boolean hasCommonFields()
Tag
hasCommonFields
in interface Tag
true
if a common
field is present.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
public void setField(FieldKey genericKey, String... values) throws KeyNotFoundException, FieldDataInvalidException
Tag
setField
in interface Tag
KeyNotFoundException
FieldDataInvalidException
public void addField(FieldKey genericKey, String... values) throws KeyNotFoundException, FieldDataInvalidException
addField
in interface Tag
genericKey
- values
- KeyNotFoundException
FieldDataInvalidException
public void setField(String vorbisCommentKey, String value) throws KeyNotFoundException, FieldDataInvalidException
vorbisCommentKey
- value
- KeyNotFoundException
FieldDataInvalidException
public void addField(String vorbisCommentKey, 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, 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. Usually the value field should only be one value, but certain fields may require more than one value currently the only field to require this is the MUSICIAN field, it should contain instrument and then performer name
createField
in interface Tag
genericKey
- is the generic keyvalue
- to storeKeyNotFoundException
FieldDataInvalidException
public TagField createField(VorbisCommentFieldKey vorbisCommentFieldKey, String value) throws KeyNotFoundException, FieldDataInvalidException
vorbisCommentFieldKey
- value
- KeyNotFoundException
FieldDataInvalidException
public TagField createField(String vorbisCommentFieldKey, String value)
vorbisCommentFieldKey
- value
- public String getFirst(String id)
Tag
Can be used to retrieve fields with any identifier, useful if the identifier is not within FieldKey
public String getValue(FieldKey id, int index) throws KeyNotFoundException
Tag
getValue
in interface Tag
KeyNotFoundException
public String getFirst(FieldKey id) throws KeyNotFoundException
Tag
getFirst
in interface Tag
KeyNotFoundException
public TagField getFirstField(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 keypublic 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(String id) throws KeyNotFoundException
Tag
deleteField
in interface Tag
KeyNotFoundException
public Iterator<TagField> getFields()
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(Charset enc) throws FieldDataInvalidException
setEncoding
in interface Tag
FieldDataInvalidException
public List<TagField> getFields(FieldKey id) throws KeyNotFoundException
Tag
getFields
in interface Tag
id
- The field id.TagField
objects with the given "id".KeyNotFoundException
public TagField createArtworkField(byte[] imageData, int pictureType, String mimeType, String description, int width, int height, int colourDepth, int indexedColouredCount) throws FieldDataInvalidException
FieldDataInvalidException
public TagField createLinkedArtworkField(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 List<Artwork> getArtworkList()
getArtworkList
in interface Tag
public Artwork getFirstArtwork()
getFirstArtwork
in interface Tag
public void deleteArtworkField() throws KeyNotFoundException
deleteArtworkField
in interface Tag
KeyNotFoundException
public boolean hasField(FieldKey genericKey)
Tag
public boolean hasField(VorbisCommentFieldKey vorbisFieldKey)
vorbisFieldKey
- public boolean hasField(String id)
Tag
public TagField createCompilationField(boolean value) throws KeyNotFoundException, FieldDataInvalidException
Tag
createCompilationField
in interface Tag
KeyNotFoundException
FieldDataInvalidException
Copyright © 2005–2020 jthink.net. All rights reserved.