public class VorbisCommentTag extends AbstractTag
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_VENDOR |
commonNumber, fields
Constructor and Description |
---|
VorbisCommentTag()
Only used within Package, hidden because it doesnt set Vendor
which should be done when created by end user
|
Modifier and Type | Method and Description |
---|---|
void |
addField(Artwork artwork)
Add artwork field
|
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)
Add Field
|
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... values)
Create Tag Field using generic key
|
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
|
static VorbisCommentTag |
createNewTag()
Use to construct a new tag properly initialized
|
void |
deleteArtworkField()
Delete all instance of artwork Field
|
void |
deleteField(FieldKey genericKey)
Delete fields with this generic key
|
void |
deleteField(VorbisCommentFieldKey vorbisCommentFieldKey)
Delete fields with this vorbisCommentFieldKey
|
List<TagField> |
get(VorbisCommentFieldKey vorbisCommentKey)
Retrieve the first value that exists for this vorbis comment key
|
List<String> |
getAll(FieldKey genericKey)
Maps the generic key to the ogg key and return the list of values for this field as strings
|
byte[] |
getArtworkBinaryData()
Retrieve artwork raw data when using the deprecated COVERART format
|
List<Artwork> |
getArtworkList() |
String |
getArtworkMimeType()
Retrieve artwork mimeType when using deprecated COVERART format
|
List<TagField> |
getFields(FieldKey genericKey)
Maps the generic key to the ogg key and return the list of values for this field
|
String |
getFirst(VorbisCommentFieldKey vorbisCommentKey)
Retrieve the first value that exists for this vorbis comment key
|
TagField |
getFirstField(FieldKey genericKey) |
String |
getValue(FieldKey genericKey,
int index)
Retrieve String value of the nth tag field that exists for this generic key
|
String |
getVendor() |
boolean |
hasField(FieldKey genericKey)
Determines whether the tag has at least one field with the specified field key.
|
boolean |
hasField(VorbisCommentFieldKey vorbisFieldKey) |
protected boolean |
isAllowedEncoding(Charset enc)
Determines whether the given charset encoding may be used for the
represented tagging system.
|
boolean |
isEmpty()
Is this tag empty
|
void |
setArtworkField(byte[] data,
String mimeType)
Deprecated.
|
void |
setField(Artwork artwork)
Create and set artwork field
|
void |
setField(FieldKey genericKey,
String... values)
Create new field and set it in the tag
|
void |
setField(String vorbisCommentKey,
String value)
Create and set field with name of vorbisCommentkey
|
void |
setVendor(String vendor)
Set the vendor, known as the encoder generally
We dont want this to be blank, when written to file this field is written to a different location
to all other fields but user of library can just reat it as another field
|
String |
toString()
(overridden)
|
deleteField, getAll, getAll, getFieldCount, getFieldCountIncludingSubValues, getFields, getFields, getFirst, getFirst, getFirstArtwork, getFirstField, getItem, hasCommonFields, hasField, setEncoding, setField
public static final String DEFAULT_VENDOR
public VorbisCommentTag()
public static VorbisCommentTag createNewTag()
public String getVendor()
public void setVendor(String vendor)
vendor
- protected boolean isAllowedEncoding(Charset enc)
AbstractTag
isAllowedEncoding
in class AbstractTag
enc
- charset encoding.true
if the given encoding can be used.public String toString()
AbstractTag
toString
in interface Tag
toString
in class AbstractTag
Object.toString()
public TagField createField(FieldKey genericKey, String... values) throws KeyNotFoundException, FieldDataInvalidException
createField
in interface Tag
createField
in class AbstractTag
genericKey
- is the generic keyvalues
- 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 List<TagField> getFields(FieldKey genericKey) throws KeyNotFoundException
genericKey
- TagField
objects with the given "id".KeyNotFoundException
public List<String> getAll(FieldKey genericKey) throws KeyNotFoundException
genericKey
- KeyNotFoundException
public List<TagField> get(VorbisCommentFieldKey vorbisCommentKey) throws KeyNotFoundException
vorbisCommentKey
- KeyNotFoundException
public String getFirst(VorbisCommentFieldKey vorbisCommentKey) throws KeyNotFoundException
vorbisCommentKey
- KeyNotFoundException
public boolean hasField(FieldKey genericKey)
Tag
hasField
in interface Tag
hasField
in class AbstractTag
genericKey
- public boolean hasField(VorbisCommentFieldKey vorbisFieldKey)
vorbisFieldKey
- public void deleteField(FieldKey genericKey) throws KeyNotFoundException
deleteField
in interface Tag
deleteField
in class AbstractTag
genericKey
- KeyNotFoundException
public void deleteField(VorbisCommentFieldKey vorbisCommentFieldKey) throws KeyNotFoundException
vorbisCommentFieldKey
- KeyNotFoundException
public byte[] getArtworkBinaryData()
public String getArtworkMimeType()
public boolean isEmpty()
Overridden because check for size of one because there is always a vendor tag unless just created an empty vorbis tag as part of flac tag in which case size could be zero
isEmpty
in interface Tag
isEmpty
in class AbstractTag
true
if tag contains no field.Tag.isEmpty()
public void addField(TagField field)
Overidden because there can only be one vendor set
addField
in interface Tag
addField
in class AbstractTag
field
- Changed so add empty fields
public TagField getFirstField(FieldKey genericKey) throws KeyNotFoundException
getFirstField
in interface Tag
getFirstField
in class AbstractTag
KeyNotFoundException
public TagField createField(Artwork artwork) throws FieldDataInvalidException
artwork
- FieldDataInvalidException
public void setField(Artwork artwork) throws FieldDataInvalidException
setField
in interface Tag
setField
in class AbstractTag
FieldDataInvalidException
public void addField(Artwork artwork) throws FieldDataInvalidException
addField
in interface Tag
addField
in class AbstractTag
artwork
- FieldDataInvalidException
@Deprecated public void setArtworkField(byte[] data, String mimeType)
data
- raw image datamimeType
- mimeType of datapublic 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 deleteArtworkField() throws KeyNotFoundException
deleteArtworkField
in interface Tag
deleteArtworkField
in class AbstractTag
KeyNotFoundException
public TagField createCompilationField(boolean value) throws KeyNotFoundException, FieldDataInvalidException
Tag
KeyNotFoundException
FieldDataInvalidException
public void setField(FieldKey genericKey, String... values) throws KeyNotFoundException, FieldDataInvalidException
AbstractTag
setField
in interface Tag
setField
in class AbstractTag
KeyNotFoundException
FieldDataInvalidException
public void addField(FieldKey genericKey, String... values) throws KeyNotFoundException, FieldDataInvalidException
addField
in interface Tag
addField
in class AbstractTag
genericKey
- values
- KeyNotFoundException
FieldDataInvalidException
public String getValue(FieldKey genericKey, int index) throws KeyNotFoundException
Tag
KeyNotFoundException
Copyright © 2005–2020 jthink.net. All rights reserved.