本文整理汇总了Java中com.googlecode.mp4parser.boxes.apple.AppleArtistBox类的典型用法代码示例。如果您正苦于以下问题:Java AppleArtistBox类的具体用法?Java AppleArtistBox怎么用?Java AppleArtistBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AppleArtistBox类属于com.googlecode.mp4parser.boxes.apple包,在下文中一共展示了AppleArtistBox类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parse
import com.googlecode.mp4parser.boxes.apple.AppleArtistBox; //导入依赖的package包/类
@Override
public MetaData parse(Object object) {
Assert.isTrue(object instanceof MovieBox, "Support MovieBox class only.");
MovieBox moov = (MovieBox)object;
// Get metadata from the User Data Box
UserDataBox userData = getOrNull(moov, UserDataBox.class);
if (userData == null) {
return null;
}
MetaBox meta = getOrNull(userData, MetaBox.class);
// Check for iTunes Metadata
// See http://atomicparsley.sourceforge.net/mpeg-4files.html and
// http://code.google.com/p/mp4v2/wiki/iTunesMetadata for more on these
AppleItemListBox apple = getOrNull(meta, AppleItemListBox.class);
if (apple == null) {
return null;
}
MetaData metaData = new MetaData();
// Title
AppleNameBox title = getOrNull(apple, AppleNameBox.class);
addMetadata(metaData, Audio.MetaName.Title, title);
// Artist
AppleArtistBox artist = getOrNull(apple, AppleArtistBox.class);
addMetadata(metaData, Audio.MetaName.Artist, artist);
// Album
AppleAlbumBox album = getOrNull(apple, AppleAlbumBox.class);
addMetadata(metaData, Audio.MetaName.Album, album);
// Composer
//AppleTrackAuthorBox composer = getOrNull(apple, AppleTrackAuthorBox.class);
// Genre
AppleGenreBox genre = getOrNull(apple, AppleGenreBox.class);
addMetadata(metaData, Audio.MetaName.Genre, genre);
// AppleCustomGenreBox cGenre = getOrNull(apple, AppleCustomGenreBox.class);
// addMetadata(metaData, Audio.MetaName.Genre, cGenre);
// Year
// AppleRecordingYearBox year = getOrNull(apple, AppleRecordingYearBox.class);
// Track number
// AppleTrackNumberBox trackNum = getOrNull(apple, AppleTrackNumberBox.class);
// if (trackNum != null) {
// metadata.set(XMPDM.TRACK_NUMBER, trackNum.getTrackNumber());
// //metadata.set(XMPDM.NUMBER_OF_TRACKS, trackNum.getNumberOfTracks()); // TODO
// }
// Comment
// AppleCommentBox comment = getOrNull(apple, AppleCommentBox.class);
// Encoder
// AppleEncoderBox encoder = getOrNull(apple, AppleEncoderBox.class);
return metaData;
}