示例#1
0
        public NextTrack GetNext(Track track, bool autoPlay)
        {
            var nextIndex = GetNextIndex(track);

            if ((nextIndex == -1) || ((nextIndex == 0) && !autoPlay))
            {
                return(NextTrack.None);
            }

            return(NextTrack.PlayTrack(_Tracks[nextIndex]));
        }
示例#2
0
        public NextTrack GetNext(Track track, bool autoPlay)
        {
            if (_Tracks.Count == 0)
            {
                return(NextTrack.None);
            }

            var tracks    = _Tracks.Where(t => !_PlayedTracks.Contains(t)).ToList();
            var nextTrack = GetNext(tracks);

            if (nextTrack != null)
            {
                return(NextTrack.PlayTrack(nextTrack));
            }

            _PlayedTracks.Clear();
            return(autoPlay ? NextTrack.PlayTrack(GetFirst()) : NextTrack.None);
        }