Fields Summary |
---|
public static final Set | ALLOWEDStores the only allowed keys of this metadata container. |
public static final String | KEY_AUTHORField key for author. |
public static final String | KEY_COPYRIGHTField key for copyright. |
public static final String | KEY_DESCRIPTIONField key for description. |
public static final String | KEY_RATINGField key for rating. |
public static final String | KEY_TITLEField key for title. |
Methods Summary |
---|
public java.lang.String | getAuthor()
return getValueFor(KEY_AUTHOR);
|
public java.lang.String | getComment()
return getValueFor(KEY_DESCRIPTION);
|
public java.lang.String | getCopyRight()
return getValueFor(KEY_COPYRIGHT);
|
public long | getCurrentAsfChunkSize(){@inheritDoc}
long result = 44; // GUID + UINT64 for size + 5 times string length
// (each
// 2 bytes) + 5 times zero term char (2 bytes each).
result += getAuthor().length() * 2; // UTF-16LE
result += getComment().length() * 2;
result += getRating().length() * 2;
result += getTitle().length() * 2;
result += getCopyRight().length() * 2;
return result;
|
public java.lang.String | getRating()
return getValueFor(KEY_RATING);
|
public java.lang.String | getTitle()
return getValueFor(KEY_TITLE);
|
public boolean | isAddSupported(MetadataDescriptor descriptor){@inheritDoc}
return ALLOWED.contains(descriptor.getName())
&& super.isAddSupported(descriptor);
|
public java.lang.String | prettyPrint(java.lang.String prefix){@inheritDoc}
final StringBuilder result = new StringBuilder(super.prettyPrint(prefix));
result.append(prefix).append(" |->Title : ").append(getTitle())
.append(Utils.LINE_SEPARATOR);
result.append(prefix).append(" |->Author : ").append(getAuthor())
.append(Utils.LINE_SEPARATOR);
result.append(prefix).append(" |->Copyright : ").append(
getCopyRight()).append(Utils.LINE_SEPARATOR);
result.append(prefix).append(" |->Description: ").append(getComment())
.append(Utils.LINE_SEPARATOR);
result.append(prefix).append(" |->Rating :").append(getRating())
.append(Utils.LINE_SEPARATOR);
return result.toString();
|
public void | setAuthor(java.lang.String fileAuthor)
setStringValue(KEY_AUTHOR, fileAuthor);
|
public void | setComment(java.lang.String tagComment)
setStringValue(KEY_DESCRIPTION, tagComment);
|
public void | setCopyright(java.lang.String cpright)
setStringValue(KEY_COPYRIGHT, cpright);
|
public void | setRating(java.lang.String ratingText)
setStringValue(KEY_RATING, ratingText);
|
public void | setTitle(java.lang.String songTitle)
setStringValue(KEY_TITLE, songTitle);
|
public long | writeInto(java.io.OutputStream out){@inheritDoc}
final long chunkSize = getCurrentAsfChunkSize();
out.write(this.getGuid().getBytes());
Utils.writeUINT64(getCurrentAsfChunkSize(), out);
// write the sizes of the string representations plus 2 bytes zero term
// character
Utils.writeUINT16(getTitle().length() * 2 + 2, out);
Utils.writeUINT16(getAuthor().length() * 2 + 2, out);
Utils.writeUINT16(getCopyRight().length() * 2 + 2, out);
Utils.writeUINT16(getComment().length() * 2 + 2, out);
Utils.writeUINT16(getRating().length() * 2 + 2, out);
// write the Strings
out.write(Utils.getBytes(getTitle(), AsfHeader.ASF_CHARSET));
out.write(AsfHeader.ZERO_TERM);
out.write(Utils.getBytes(getAuthor(), AsfHeader.ASF_CHARSET));
out.write(AsfHeader.ZERO_TERM);
out.write(Utils.getBytes(getCopyRight(), AsfHeader.ASF_CHARSET));
out.write(AsfHeader.ZERO_TERM);
out.write(Utils.getBytes(getComment(), AsfHeader.ASF_CHARSET));
out.write(AsfHeader.ZERO_TERM);
out.write(Utils.getBytes(getRating(), AsfHeader.ASF_CHARSET));
out.write(AsfHeader.ZERO_TERM);
return chunkSize;
|