Beispiel #1
0
        private Thumbnail GetThumbnail(ArtworkFormat format, bool createNew)
        {
            FindCoverPhoto();

            if (coverPhoto == null)
            {
                if (!createNew)
                {
                    return(null);
                }


                if (db.ArtworkDatabase != null)
                {
                    coverPhoto = db.ArtworkDatabase.CreatePhoto();
                    coverPhoto.Record.TrackId = record.DatabaseId;
                    record.RightSideArtworkId = coverPhoto.Id;
                }
            }

            if (coverPhoto == null)
            {
                return(null);
            }

            Thumbnail thumbnail = coverPhoto.LookupThumbnail(format);

            if (thumbnail == null && createNew)
            {
                thumbnail        = coverPhoto.CreateThumbnail();
                thumbnail.Format = format;
                thumbnail.Width  = format.Width;
                thumbnail.Height = format.Height;
            }

            return(thumbnail);
        }
Beispiel #2
0
 public void RemoveThumbnail(Thumbnail thumbnail)
 {
     item.RemoveName(thumbnail.Record);
     thumbnails.Remove(thumbnail);
 }
Beispiel #3
0
 public void RemoveThumbnail(Thumbnail thumbnail)
 {
     item.RemoveName (thumbnail.Record);
     thumbnails.Remove (thumbnail);
 }
Beispiel #4
0
        public Thumbnail CreateThumbnail()
        {
            ImageNameRecord name = new ImageNameRecord (item.IsBE);
            item.AddName (name);

            Thumbnail thumbnail = new Thumbnail (this, name);
            thumbnails.Add (thumbnail);

            return thumbnail;
        }