Inheritance: NMaier.SimpleDlna.Utilities.Logging, IMediaCoverResource, IMetaInfo, ISerializable
コード例 #1
0
ファイル: BaseFile.cs プロジェクト: Rawrpwnzl/simpleDLNA
 public virtual void LoadCover()
 {
     if (cover != null) {
     return;
       }
       cover = new Cover(Item);
       cover.OnCoverLazyLoaded += LazyLoadedCover;
       cover.ForceLoad();
       cover = null;
 }
コード例 #2
0
ファイル: AudioFile.cs プロジェクト: Nirad/simpleDLNA
 private void InitCover(TagLib.Tag tag)
 {
     TagLib.IPicture pic = null;
       foreach (var p in tag.Pictures) {
     if (p.Type == TagLib.PictureType.FrontCover) {
       pic = p;
       break;
     }
     switch (p.Type) {
       case TagLib.PictureType.Other:
       case TagLib.PictureType.OtherFileIcon:
       case TagLib.PictureType.FileIcon:
     pic = p;
     break;
       default:
     if (pic == null) {
       pic = p;
     }
     break;
     }
       }
       if (pic != null) {
     try {
       cover = new Cover(Item, pic.Data.ToStream());
     }
     catch (Exception ex) {
       Debug("Failed to generate thumb for " + Item.FullName, ex);
     }
       }
 }