public void PlayFromPlayList(int index)
        {
            Stop();
            string current = Files[index];

            CurrentTrackNumber = index;
            Play(current, Properties.Settings.Default.UserVolume);
            GetFullMusicInfo.GetTrackInfo();
            MainWindow.Instance.SetSongInfo();
            MainWindow.Instance.PlayList.SelectedIndex = index;
        }
 protected bool ToNextTrack()
 {
     if (Bass.BASS_ChannelIsActive(Stream) == BASSActive.BASS_ACTIVE_STOPPED && (!isStopped))
     {
         if (alltrackscount > CurrentTrackNumber + 1)
         {
             Play(Files[++CurrentTrackNumber], Properties.Settings.Default.UserVolume);
             GetFullMusicInfo.GetTrackInfo();
             MainWindow.Instance.SetSongInfo();
             EndPlayList = false;
             return(true);
         }
         else
         {
             EndPlayList = true;
         }
     }
     return(false);
 }
 public void PreviousSongButton()
 {
     Stop();
     if (CurrentTrackNumber - 1 < 0)
     {
         TimerStart();
         CurrentTrackNumber = 0;
         string current = Files[CurrentTrackNumber];
         Play(current, Properties.Settings.Default.UserVolume);
         GetFullMusicInfo.GetTrackInfo();
         MainWindow.Instance.PlayList.SelectedIndex = CurrentTrackNumber;
     }
     else
     {
         TimerStart();
         CurrentTrackNumber -= 1;
         string current = Files[CurrentTrackNumber];
         Play(current, Properties.Settings.Default.UserVolume);
         GetFullMusicInfo.GetTrackInfo();
         MainWindow.Instance.PlayList.SelectedIndex = CurrentTrackNumber;
     }
     MainWindow.Instance.SetSongInfo();
 }
 public void NextSongButton()
 {
     Stop();
     if (alltrackscount > CurrentTrackNumber + 1)
     {
         TimerStart();
         CurrentTrackNumber += 1;
         string current = Files[CurrentTrackNumber];
         Play(current, Properties.Settings.Default.UserVolume);
         GetFullMusicInfo.GetTrackInfo();
         MainWindow.Instance.PlayList.SelectedIndex = CurrentTrackNumber;
     }
     else
     {
         TimerStart();
         CurrentTrackNumber = alltrackscount - 1;
         string current = Files[alltrackscount - 1];
         Play(current, Properties.Settings.Default.UserVolume);
         GetFullMusicInfo.GetTrackInfo();
         MainWindow.Instance.PlayList.SelectedIndex = CurrentTrackNumber;
     }
     MainWindow.Instance.SetSongInfo();
 }
 public void PlayButton()
 {
     if (Files.Count == 0)
     {
         DirectoryInfo dr = new DirectoryInfo(Properties.Settings.Default.MusicFolder);
         foreach (var d in dr.GetFiles("*mp3*"))
         {
             Files.Add(d.FullName);
         }
         alltrackscount     = Files.Count;
         CurrentTrackNumber = 0;
     }
     if (Files.Count != 0)
     {
         PlayListMethods playlistcl = new PlayListMethods();
         TimerStart();
         playlistcl.PlayListFill();
         string current = Files[CurrentTrackNumber];
         Play(current, Properties.Settings.Default.UserVolume);
         GetFullMusicInfo.GetTrackInfo();
     }
     MainWindow.Instance.SetSongInfo();
 }
        public void timerTick(object sender, EventArgs e)
        {
            if (MainVars.IsRadioOn == false)
            {
                MainWindow.Instance.TabTimeNow.Content = TimeSpan.FromSeconds(GetStreamPos(Stream)).ToString();
                MainWindow.Instance.sliderTrack.Value  = GetStreamPos(Stream);
                if (ToNextTrack())
                {
                }
                if (MainWindow.Instance.TabTimeNow.Content.ToString() == "00:01:00")
                {
                    var audioFile = TagLib.File.Create(Files[CurrentTrackNumber]);
                    if (audioFile.Tag.FirstGenre != null)
                    {
                        GetFullMusicInfo.PopularMusicGanre(audioFile.Tag.FirstGenre.ToLower());
                    }
                }

                if (EndPlayList)
                {
                    CurrentTrackNumber = 0; EndPlayList = false;
                }
            }
        }