Example #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());
        }
Example #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;
        }
Example #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;
        }
Example #4
0
 public static void SaveFolderSong(SongImageInfo folder)
 {
     try
     {
         CopyDir(OsuSong + '\\' + folder.Folder, DownloadFolderSongPath + '\\' + folder.Folder);
         Message("Сохранено: " + folder.Folder, DownloadFolderSongPath + '\\' + folder.Folder);
     }
     catch (Exception e)
     {
         Message(e.Message, "");
     }
 }
Example #5
0
 public static void SaveSong(SongImageInfo song)
 {
     Copy(song.GetSongPath(), DownloadSongPath, song.GetName());
 }
Example #6
0
 public static void SaveImage(SongImageInfo image)
 {
     Copy(image.GetImagePath(), DownloadImagePath, image.GetName());
 }