Пример #1
0
        private void UpdateMediaInfo(MediaController.MediaInfo newInfo)
        {
            this.details.SetMediaInfo(newInfo);
            Image img = newInfo.Thumbnail;

            if (img == null)
            {
                return;
            }

            int height = __taskbar.Size.Height;
            //int height = 300;
            int    canvasMin = Math.Min(height, height);
            int    imageMin  = Math.Min(img.Width, img.Height);
            Bitmap newImg    = ImageHelper.ResizeImage(img, (float)imageMin / (float)canvasMin);

            if (!IsAnimating)
            {
                PictureBox animatorBox = new PictureBox();
                IsAnimating       = true;
                animatorBox.Size  = this.multimediaCover.Size;
                animatorBox.Image = this.multimediaCover.Image;
                this.Controls.Add(animatorBox);
                animatorBox.BringToFront();
                StartPictureBoxAnimation(animatorBox);
            }

            songInfo = "Song info";
            this.multimediaCover.Size  = new Size(newImg.Size.Height, newImg.Size.Height);
            this.multimediaCover.Image = newImg;
        }
Пример #2
0
        //private void UpdatePlaybackPosition()
        //{
        //    TimeSpan timeSpan = MediaController.Instance.CurrentPositon();
        //    if (timeSpan == TimeSpan.Zero)
        //        return;

        //    this.playbackProgressBar.Value = (int)Math.Floor(timeSpan.Milliseconds * 100 / timeSpan.TotalMilliseconds);
        //}

        private void OnMediaChanged(object sender, MediaController.MediaInfo newInfo)
        {
            this.Invoke((Action) delegate() { this.UpdateMediaInfo(newInfo); });
        }