Ejemplo n.º 1
0
        public void SetSong(SongImageInfo info)
        {
            Refresh();
            if (info.IsNull)
            {
                return;
            }
            SongInfo = info;
            Audio    = new AudioFileReader(SongInfo.GetSongPath())
            {
                Volume = (float)SongVolume.Value
            };
            SongPosition.Maximum = Audio.TotalTime.TotalSeconds;
            SongLength.Text      = Audio.GetTotalTimeString();
            SongName.Text        = SongInfo.GetName();
            Wave.Init(Audio);
            BitmapImage image = new BitmapImage();

            image.BeginInit();
            image.UriSource        = new Uri(SongInfo.GetImagePath());
            image.DecodePixelWidth = 60;
            image.EndInit();
            Preview.Source = image;
            IsEnabled      = true;
            PlayOrPause_Click(null, new RoutedEventArgs());
        }
Ejemplo n.º 2
0
        public void Update(SongImageInfo info)
        {
            Dowload.IsEnabled = false;
            Music.IsEnabled   = false;
            if (info.IsNull)
            {
                Visibility = Visibility.Hidden;
                return;
            }
            else if (Visibility == Visibility.Hidden)
            {
                Visibility = Visibility.Visible;
            }
            ImageInfo         = info;
            ImageName.Content = ImageInfo.GetName();
            BitmapImage image = new BitmapImage();

            image.BeginInit();
            image.UriSource        = new Uri(ImageInfo.GetImagePath());
            image.DecodePixelWidth = 196;
            image.EndInit();
            Preview.Source    = image;
            Dowload.IsEnabled = true;
            Music.IsEnabled   = true;
        }
Ejemplo n.º 3
0
        private void SelectImage(SongImageInfo info)
        {
            DialogHeader.Header = info.GetName();
            BitmapImage image = new BitmapImage();

            image.BeginInit();
            image.UriSource = new Uri(info.GetImagePath());
            image.EndInit();
            DialogImage.Source = image;
            ImageDialog.IsOpen = true;
        }
Ejemplo n.º 4
0
 public static void SaveImage(SongImageInfo image)
 {
     Copy(image.GetImagePath(), DownloadImagePath, image.GetName());
 }