Methods Summary |
---|
public void | addField(FieldKey genericKey, java.lang.String value)
TagField tagfield = createField(genericKey,value);
addField(tagfield);
|
public void | addField(java.lang.String vorbisCommentKey, java.lang.String value)Create and add field with name of vorbisCommentkey
TagField tagfield = createField(vorbisCommentKey,value);
addField(tagfield);
|
public void | addField(org.jaudiotagger.tag.images.Artwork artwork)
this.addField(createField(artwork));
|
public void | addField(TagField field)
if (field instanceof MetadataBlockDataPicture)
{
images.add((MetadataBlockDataPicture) field);
}
else
{
tag.addField(field);
}
|
public TagField | createArtworkField(byte[] imageData, int pictureType, java.lang.String mimeType, java.lang.String description, int width, int height, int colourDepth, int indexedColouredCount)
return new MetadataBlockDataPicture(imageData, pictureType, mimeType, description, width, height, colourDepth, indexedColouredCount);
|
public TagField | createField(FieldKey genericKey, java.lang.String value)
if (genericKey.equals(FieldKey.COVER_ART))
{
throw new UnsupportedOperationException(ErrorMessage.ARTWORK_CANNOT_BE_CREATED_WITH_THIS_METHOD.getMsg());
}
else
{
return tag.createField(genericKey, value);
}
|
public TagField | createField(org.jaudiotagger.tag.vorbiscomment.VorbisCommentFieldKey vorbisCommentFieldKey, java.lang.String value)Create Tag Field using ogg key
if (vorbisCommentFieldKey.equals(VorbisCommentFieldKey.COVERART))
{
throw new UnsupportedOperationException(ErrorMessage.ARTWORK_CANNOT_BE_CREATED_WITH_THIS_METHOD.getMsg());
}
return tag.createField(vorbisCommentFieldKey,value);
|
public TagField | createField(java.lang.String vorbisCommentFieldKey, java.lang.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.
if (vorbisCommentFieldKey.equals(VorbisCommentFieldKey.COVERART.getFieldName()))
{
throw new UnsupportedOperationException(ErrorMessage.ARTWORK_CANNOT_BE_CREATED_WITH_THIS_METHOD.getMsg());
}
return tag.createField(vorbisCommentFieldKey,value);
|
public TagField | createField(org.jaudiotagger.tag.images.Artwork artwork)Create artwork field
if(artwork.isLinked())
{
return new MetadataBlockDataPicture(
Utils.getDefaultBytes(artwork.getImageUrl(), TextEncoding.CHARSET_ISO_8859_1),
artwork.getPictureType(),
MetadataBlockDataPicture.IMAGE_IS_URL,
"",
0,
0,
0,
0);
}
else
{
if(!artwork.setImageFromData())
{
throw new FieldDataInvalidException("Unable to createField buffered image from the image");
}
return new MetadataBlockDataPicture(artwork.getBinaryData(),
artwork.getPictureType(),
artwork.getMimeType(),
artwork.getDescription(),
artwork.getWidth(),
artwork.getHeight(),
0,
0);
}
|
public 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.
//Add to image list
return new MetadataBlockDataPicture(Utils.getDefaultBytes(url, TextEncoding.CHARSET_ISO_8859_1), PictureTypes.DEFAULT_ID, MetadataBlockDataPicture.IMAGE_IS_URL, "", 0, 0, 0, 0);
|
public void | deleteArtworkField()Delete all instance of artwork Field
this.deleteField(FieldKey.COVER_ART);
|
public void | deleteField(FieldKey fieldKey)Delete any instance of tag fields with this key
if (fieldKey.equals(FieldKey.COVER_ART))
{
images.clear();
}
else
{
tag.deleteField(fieldKey);
}
|
public void | deleteField(java.lang.String id)
if (id.equals(FieldKey.COVER_ART.name()))
{
images.clear();
}
else
{
tag.deleteField(id);
}
|
public java.util.List | getArtworkList()
List<Artwork> artworkList = new ArrayList<Artwork>(images.size());
for(MetadataBlockDataPicture coverArt:images)
{
Artwork artwork= ArtworkFactory.createArtworkFromMetadataBlockDataPicture(coverArt);
artworkList.add(artwork);
}
return artworkList;
|
public int | getFieldCount()
return tag.getFieldCount() + images.size();
|
public int | getFieldCountIncludingSubValues()
return getFieldCount();
|
public java.util.Iterator | getFields()
return tag.getFields();
|
public java.util.List | getFields(FieldKey id)
if (id.equals(FieldKey.COVER_ART))
{
List<TagField> castImages = new ArrayList<TagField>();
for (MetadataBlockDataPicture image : images)
{
castImages.add(image);
}
return castImages;
}
else
{
return tag.getFields(id);
}
|
public java.util.List | getFields(java.lang.String id)
if (id.equals(FieldKey.COVER_ART.name()))
{
List<TagField> castImages = new ArrayList<TagField>();
for (MetadataBlockDataPicture image : images)
{
castImages.add(image);
}
return castImages;
}
else
{
return tag.getFields(id);
}
|
public java.lang.String | getFirst(java.lang.String id)
if (id.equals(FieldKey.COVER_ART.name()))
{
throw new UnsupportedOperationException(ErrorMessage.ARTWORK_CANNOT_BE_CREATED_WITH_THIS_METHOD.getMsg());
}
else
{
return tag.getFirst(id);
}
|
public java.lang.String | getFirst(FieldKey id)
return getValue(id,0);
|
public org.jaudiotagger.tag.images.Artwork | getFirstArtwork()
List<Artwork> artwork = getArtworkList();
if(artwork.size()>0)
{
return artwork.get(0);
}
return null;
|
public TagField | getFirstField(java.lang.String id)
if (id.equals(FieldKey.COVER_ART.name()))
{
if (images.size() > 0)
{
return images.get(0);
}
else
{
return null;
}
}
else
{
return tag.getFirstField(id);
}
|
public TagField | getFirstField(FieldKey genericKey)
if (genericKey == null)
{
throw new KeyNotFoundException();
}
if(genericKey == FieldKey.COVER_ART )
{
return getFirstField(FieldKey.COVER_ART.name());
}
else
{
return tag.getFirstField(genericKey);
}
|
public java.util.List | getImages()
return images;
|
public java.lang.String | getSubValue(FieldKey id, int n, int m)The m parameter is effectively ignored
return getValue(id,n);
|
public java.lang.String | getValue(FieldKey id, int index)
if (id.equals(FieldKey.COVER_ART))
{
throw new UnsupportedOperationException(ErrorMessage.ARTWORK_CANNOT_BE_RETRIEVED_WITH_THIS_METHOD.getMsg());
}
else
{
return tag.getValue(id, index);
}
|
public org.jaudiotagger.tag.vorbiscomment.VorbisCommentTag | getVorbisCommentTag()
return tag;
|
public boolean | hasCommonFields()
return tag.hasCommonFields();
|
public boolean | hasField(FieldKey genericKey)
if (genericKey==FieldKey.COVER_ART)
{
return images.size() > 0;
}
else
{
return tag.hasField(genericKey);
}
|
public boolean | hasField(org.jaudiotagger.tag.vorbiscomment.VorbisCommentFieldKey vorbisFieldKey)
return tag.hasField(vorbisFieldKey);
|
public boolean | hasField(java.lang.String id)
if (id.equals(FieldKey.COVER_ART.name()))
{
return images.size() > 0;
}
else
{
return tag.hasField(id);
}
|
public boolean | isEmpty()Determines whether the tag has no fields specified.
If there are no images we return empty if either there is no VorbisTag or if there is a
VorbisTag but it is empty
return (tag == null || tag.isEmpty()) && images.size() == 0;
|
public boolean | setEncoding(java.lang.String enc)
return tag.setEncoding(enc);
|
public void | setField(java.lang.String vorbisCommentKey, java.lang.String value)Create and set field with name of vorbisCommentkey
TagField tagfield = createField(vorbisCommentKey,value);
setField(tagfield);
|
public void | setField(TagField field)
if (field instanceof MetadataBlockDataPicture)
{
if (images.size() == 0)
{
images.add(0, (MetadataBlockDataPicture) field);
}
else
{
images.set(0, (MetadataBlockDataPicture) field);
}
}
else
{
tag.setField(field);
}
|
public void | setField(org.jaudiotagger.tag.images.Artwork artwork)
this.setField(createField(artwork));
|
public void | setField(FieldKey genericKey, java.lang.String value)
TagField tagfield = createField(genericKey,value);
setField(tagfield);
|