コード例 #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();
 }