Пример #1
0
        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;
        }
Пример #2
0
 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);
 }
Пример #3
0
 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();
 }
Пример #4
0
 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();
 }
Пример #5
0
 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();
 }
Пример #6
0
        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;
                }
            }
        }