Наследование: NMaier.SimpleDlna.Utilities.Logging, IMediaCoverResource, IMetaInfo, ISerializable
Пример #1
0
 public virtual void LoadCover()
 {
     if (cover != null) {
     return;
       }
       cover = new Cover(Item);
       cover.OnCoverLazyLoaded += LazyLoadedCover;
       cover.ForceLoad();
       cover = null;
 }
Пример #2
0
 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);
     }
       }
 }