LMMediaItem.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // LMMediaItem.h
  3. // iPodMusicSample
  4. //
  5. // Created by Akira Matsuda on 2014/01/27.
  6. // Copyright (c) 2014年 Akira Matsuda. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. extern NSString *LMMediaItemInfoTitleKey;
  11. extern NSString *LMMediaItemInfoAlubumTitleKey;
  12. extern NSString *LMMediaItemInfoArtistKey;
  13. extern NSString *LMMediaItemInfoArtworkKey;
  14. extern NSString *LMMediaItemInfoURLKey;
  15. extern NSString *LMMediaItemInfoContentTypeKey;
  16. typedef NS_ENUM(NSUInteger, LMMediaItemContentType) {
  17. LMMediaItemContentTypeUnknown = -1,
  18. LMMediaItemContentTypeAudio = 0,
  19. LMMediaItemContentTypeVideo = 1
  20. };
  21. @interface LMMediaItem : NSObject <NSCoding, NSCopying>
  22. - (instancetype)initWithMetaMedia:(id)media contentType:(LMMediaItemContentType)type;
  23. - (instancetype)initWithInfo:(NSDictionary *)info;
  24. - (UIImage *)artworkImageWithSize:(CGSize)size;
  25. - (void)setArtworkImage:(UIImage *)image;
  26. - (BOOL)isVideo;
  27. @property (nonatomic, copy) NSString *title;
  28. @property (nonatomic, copy) NSString *albumTitle;
  29. @property (nonatomic, copy) NSString *artist;
  30. @property (nonatomic, copy) id metaMedia;
  31. @property (nonatomic, copy) NSURL *assetURL;
  32. @property (nonatomic, readonly) LMMediaItemContentType contentType;
  33. @end