当前位置: 首页>>代码示例>>Java>>正文


Java AppleArtistBox类代码示例

本文整理汇总了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;
	}
 
开发者ID:ivarptr,项目名称:clobaframe,代码行数:66,代码来源:M4aMetaDataParser.java


注:本文中的com.googlecode.mp4parser.boxes.apple.AppleArtistBox类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。