當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。