* @param source
* The asf header which contains the information. <br>
* @return A Tag with all its values.
*/
public static Tag createTagOf(AsfHeader source) {
GenericTag result = new GenericTag();
/*
* It is possible that the file contains no content description, since
* that some informations aren't available.
*/
if (source.getContentDescription() != null) {
result.setArtist(source.getContentDescription().getAuthor());
result.setComment(source.getContentDescription().getComment());
result.setTitle(source.getContentDescription().getTitle());
AsfCopyrightField cpField = new AsfCopyrightField();
/*
* I know I said use the setString() method. However, the value is
* already a "UTF-16LE" string within is bounds. So Nothing could
* happen.
*/
cpField.setContent(source.getContentDescription().getCopyRight());
result.set(cpField);
}
/*
* It is possible that the file contains no extended content
* description. In that case some informations cannot be provided.
*/
if (source.getExtendedContentDescription() != null) {
result.setTrack(source.getExtendedContentDescription().getTrack());
result.setYear(source.getExtendedContentDescription().getYear());
result.setGenre(source.getExtendedContentDescription().getGenre());
result.setAlbum(source.getExtendedContentDescription().getAlbum());
/*
* Now any properties, which don't belong to the common section of
* entagged.
*/
ExtendedContentDescription extDesc = source
.getExtendedContentDescription();
Iterator it = extDesc.getDescriptors().iterator();
while (it.hasNext()) {
ContentDescriptor current = (ContentDescriptor) it.next();
// If common, it has been added to the result some lines upward.
if (!current.isCommon()) {
result.add(new ContentDescriptorTagField(current));
}
}
}
return result;
}