Esempio n. 1
0
        public void PlayFromPlayListByIndex(int index)
        {
            Stop();
            string current = Files[index];

            CurrentTrackNumber = index;
            Play(current, Properties.Settings.Default.UserVolume);
            GetFullMusicInfo.GetTrackInfo();
            PlayerLocal.Instance.PlayList.SelectedIndex = index;
        }
Esempio n. 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();
             PlayerLocal.Instance.SetSongInfo();
             EndPlayList = false;
             return(true);
         }
         else
         {
             EndPlayList = true;
         }
     }
     return(false);
 }
Esempio n. 3
0
 public void PreviousSongButton()
 {
     Stop();
     if (CurrentTrackNumber - 1 < 0)
     {
         TimerStart();
         SpTimerStart();
         CurrentTrackNumber = 0;
         string current = Files[CurrentTrackNumber];
         Play(current, Properties.Settings.Default.UserVolume);
         GetFullMusicInfo.GetTrackInfo();
         PlayerLocal.Instance.PlayList.SelectedIndex = CurrentTrackNumber;
     }
     else
     {
         TimerStart();
         CurrentTrackNumber -= 1;
         string current = Files[CurrentTrackNumber];
         Play(current, Properties.Settings.Default.UserVolume);
         GetFullMusicInfo.GetTrackInfo();
         PlayerLocal.Instance.PlayList.SelectedIndex = CurrentTrackNumber;
     }
 }
Esempio n. 4
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();
         SpTimerStart();
         playlistcl.PlayListFill();
         string current = Files[CurrentTrackNumber];
         Play(current, Properties.Settings.Default.UserVolume);
         GetFullMusicInfo.GetTrackInfo();
     }
 }
Esempio n. 5
0
 public void NextSongButton()
 {
     Stop();
     if (alltrackscount > CurrentTrackNumber + 1)
     {
         TimerStart();
         SpTimerStart();
         CurrentTrackNumber += 1;
         string current = Files[CurrentTrackNumber];
         Play(current, Properties.Settings.Default.UserVolume);
         GetFullMusicInfo.GetTrackInfo();
         PlayerLocal.Instance.PlayList.SelectedIndex = CurrentTrackNumber;
     }
     else
     {
         TimerStart();
         SpTimerStart();
         CurrentTrackNumber = alltrackscount - 1;
         string current = Files[alltrackscount - 1];
         Play(current, Properties.Settings.Default.UserVolume);
         GetFullMusicInfo.GetTrackInfo();
         PlayerLocal.Instance.PlayList.SelectedIndex = CurrentTrackNumber;
     }
 }