public class WavTag extends Object implements Tag, Id3SupportingTag
Constructor and Description |
---|
WavTag(WavOptions wavOptions) |
Modifier and Type | Method and Description |
---|---|
void |
addChunkSummary(ChunkSummary cs) |
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... value)
Create the field based on the generic key and add it to the tag
This is handled differently by different formats
|
void |
addField(TagField field)
Adds a field to the structure, used internally by the library
|
void |
addMetadataChunkSummary(ChunkSummary cs) |
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.
|
static AbstractID3v2Tag |
createDefaultID3Tag()
Default based on user option
|
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
|
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
|
boolean |
equals(Object obj) |
Tag |
getActiveTag() |
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() |
List<ChunkSummary> |
getChunkSummaryList() |
long |
getEndLocationInFileOfId3Chunk() |
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
|
AbstractID3v2Tag |
getID3Tag()
Returns the ID3 tag
|
WavInfoTag |
getInfoTag() |
List<ChunkSummary> |
getMetadataChunkSummaryList() |
long |
getSizeOfID3TagIncludingChunkHeader() |
long |
getSizeOfID3TagOnly() |
long |
getStartLocationInFileOfId3Chunk()
Offset into file of start ID3Chunk including header
|
String |
getValue(FieldKey id,
int index)
Retrieve String value of the nth tag field that exists for this generic key
|
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 |
isBadChunkData() |
boolean |
isEmpty()
Determines whether the tag has no fields specified.
|
boolean |
isExistingId3Tag() |
boolean |
isExistingInfoTag() |
boolean |
isID3Tag()
Does an ID3 tag exist, note it is created by default if one does not exist in file it was read from
|
boolean |
isIncorrectlyAlignedTag() |
boolean |
isInfoTag()
Does the info tag exist, note it is created by default if one does not exist in file it was read from
|
boolean |
isNonStandardPadding() |
void |
setBadChunkData(boolean badChunkData) |
boolean |
setEncoding(Charset enc) |
void |
setExistingId3Tag(boolean isExistingId3Tag) |
void |
setExistingInfoTag(boolean isExistingInfoTag) |
void |
setField(Artwork artwork)
Create field and then set within tag itself
|
void |
setField(FieldKey genericKey,
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
|
void |
setID3Tag(AbstractID3v2Tag t)
Sets the ID3 tag
|
void |
setIncorrectlyAlignedTag(boolean isIncorrectlyAlignedTag) |
void |
setInfoTag(WavInfoTag infoTag) |
void |
setNonStandardPadding(boolean nonStandardPadding) |
void |
syncTagBeforeWrite()
Call before save if saving both tags ensure any new information is the active tag is added to the other tag
overwriting any existing fields
|
void |
syncTagsAfterRead()
Call after read to ensure your preferred tag can make use of any additional metadata
held in the other tag, only used if the activetag field is empty for the fieldkey
|
void |
syncToId3FromInfoIfEmpty()
If we have field in INFO tag but not ID3 tag (perhaps coz doesn't exist add them to ID3 tag)
|
void |
syncToId3FromInfoOverwrite()
If we have field in INFO tag write to ID3 tag, if not we delete form ID3
(but only for tag that we can actually have in INFO tag)
|
void |
syncToInfoFromId3IfEmpty()
If we have field in INFO tag but not ID3 tag (perhaps coz doesn't exist add them to ID3 tag)
|
void |
syncToInfoFromId3Overwrite()
If we have field in ID3 tag write to INFO tag
|
String |
toString() |
public WavTag(WavOptions wavOptions)
public void addChunkSummary(ChunkSummary cs)
public List<ChunkSummary> getChunkSummaryList()
public void addMetadataChunkSummary(ChunkSummary cs)
public List<ChunkSummary> getMetadataChunkSummaryList()
public boolean isExistingId3Tag()
public boolean isExistingInfoTag()
public WavInfoTag getInfoTag()
public void setInfoTag(WavInfoTag infoTag)
public boolean isInfoTag()
public AbstractID3v2Tag getID3Tag()
getID3Tag
in interface Id3SupportingTag
public void setID3Tag(AbstractID3v2Tag t)
setID3Tag
in interface Id3SupportingTag
public boolean isID3Tag()
public String toString()
public Tag getActiveTag()
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... value) throws KeyNotFoundException, FieldDataInvalidException
Tag
setField
in interface Tag
KeyNotFoundException
FieldDataInvalidException
public void addField(FieldKey genericKey, String... value) throws KeyNotFoundException, FieldDataInvalidException
Tag
addField
in interface Tag
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 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 TagField createField(Artwork artwork) throws FieldDataInvalidException
createField
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 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(String id)
Tag
public TagField createCompilationField(boolean value) throws KeyNotFoundException, FieldDataInvalidException
Tag
createCompilationField
in interface Tag
KeyNotFoundException
FieldDataInvalidException
public List<Artwork> getArtworkList()
getArtworkList
in interface Tag
public void setField(Artwork artwork) throws FieldDataInvalidException
setField
in interface Tag
artwork
- FieldDataInvalidException
public void addField(Artwork artwork) throws FieldDataInvalidException
Tag
addField
in interface Tag
FieldDataInvalidException
public void setExistingId3Tag(boolean isExistingId3Tag)
public void setExistingInfoTag(boolean isExistingInfoTag)
public long getSizeOfID3TagOnly()
public long getSizeOfID3TagIncludingChunkHeader()
public long getStartLocationInFileOfId3Chunk()
public long getEndLocationInFileOfId3Chunk()
public void syncToId3FromInfoIfEmpty()
public void syncToInfoFromId3IfEmpty()
public void syncToId3FromInfoOverwrite()
public void syncToInfoFromId3Overwrite()
public void syncTagsAfterRead()
public void syncTagBeforeWrite()
public boolean isIncorrectlyAlignedTag()
public void setIncorrectlyAlignedTag(boolean isIncorrectlyAlignedTag)
public static AbstractID3v2Tag createDefaultID3Tag()
public boolean isBadChunkData()
public void setBadChunkData(boolean badChunkData)
public boolean isNonStandardPadding()
public void setNonStandardPadding(boolean nonStandardPadding)
Copyright © 2005–2020 jthink.net. All rights reserved.