private static Mp3Info GetInfo(string file) { var mp3 = new Mp3Info(); mp3.FullPath = file; mp3.FileName = file.Substring(file.LastIndexOf("\\") + 1, file.Length - file.LastIndexOf("\\")-1); mp3.Name = mp3.FileName.Replace(".mp3", string.Empty).Replace(".m4a", string.Empty); return mp3; }
private static Mp3Info GetInfo(string file) { var mp3 = new Mp3Info(); mp3.FullPath = file; mp3.FileName = file.Substring(file.LastIndexOf("\\") + 1, file.Length - file.LastIndexOf("\\") - 1); mp3.Name = mp3.FileName.Replace(".mp3", string.Empty).Replace(".m4a", string.Empty); return(mp3); }
private void Previous() { if (library.PlayedSongs.Count > 0) { Pause(); currSong = library.Previous(); Player.Source = new Uri(currSong.FullPath); lblCurrentlyPlaying.Content = currSong.Name; //vrd lblCount.Content = library.songcount; // Player.Play(); isPlaying = true; } }
private void Play(bool next = false) { Pause(); if (library.Songs != null && library.Songs.Count > 0) { if (currSong == null || next) { currSong = library.Next(isShuffle, isRepeat); Player.Source = new Uri(currSong.FullPath); lblCurrentlyPlaying.Content = currSong.Name; //vrd lblCount.Content = library.songcount; //vrd } if (Player.NaturalDuration.HasTimeSpan) songLength = (int)Player.NaturalDuration.TimeSpan.Seconds; Player.Play(); isPlaying = true; GreaseMainWindow.Title = currSong.Name; } }