Exemplo n.º 1
0
        protected void OnLast()
        {
            if (PlayListItem == null || PlayListItem.Count == 0)
            {
                return;
            }
            var songList     = PlayListItem.Select(i => i.Song).ToList();
            var playingIndex = songList.IndexOf(PlayingSong);

            if (PlayMode == PlayMode.随机播放 && IsPlayListChanged)
            {
                PlayModeService.ChangeRandomList(songList);
                IsPlayListChanged = false;
            }
            PlayingSong = PlayModeService.OnLastExecute(PlayMode, songList, playingIndex);

            if (ControlService.PlayState != PlayState.播放)
            {
                ControlService.PlayState = PlayState.播放;
            }
            else
            {
                ControlService.PlayService.MediaPlayer.Play();
            }
        }
Exemplo n.º 2
0
 private void OnModeChange()
 {
     PlayMode = PlayModeService.OnModeChange(PlayMode);
     if (PlayMode == PlayMode.随机播放)
     {
         PlayModeService.ChangeRandomList(PlayListItem.Select(i => i.Song).ToList());
     }
 }
Exemplo n.º 3
0
        private void MediaEnd(object sender, EventArgs e)
        {
            if (PlayListItem == null || PlayListItem.Count == 0)
            {
                return;
            }
            var songList     = PlayListItem.Select(i => i.Song).ToList();
            var playingIndex = songList.IndexOf(PlayingSong);

            if (PlayMode == PlayMode.随机播放 && IsPlayListChanged)
            {
                PlayModeService.ChangeRandomList(songList);
                IsPlayListChanged = false;
            }
            PlayingSong = PlayModeService.GetNextSong(PlayMode, songList, playingIndex);
            ControlService.PlayService.MediaPlayer.Play();
        }