コード例 #1
0
        public override void Execute(object sender, HandledEventArgs e)
        {
            var playQueue = buffers[0];

            if (playQueue.Count > 0)
            {
                playbackManager.AddCurrentTrackToPreviousTracks();
                ClearCurrentlyPlayingTrack();
                playQueue.RemoveAt(0);

                if (playQueue.Count > 0)
                {
                    var nextTrack = playQueue[0] as TrackBufferItem;
                    if (nextTrack == null)
                    {
                        return;
                    }

                    PlayNewTrackBufferItem(nextTrack);
                    if (playQueue.Any())
                    {
                        playQueue.CurrentItemIndex = 0;
                    }
                }
            }
        }
コード例 #2
0
 private void HandleEndOfCurrentTrack()
 {
     playbackManager.AddCurrentTrackToPreviousTracks();
     playbackManager.PlayingTrack = null;
     _playQueueBuffer.RemoveAt(0);
     PlayNextQueuedTrack();
 }
コード例 #3
0
        private void PlayNewTrackBufferItem(TrackBufferItem item)
        {
            var response = Session.LoadPlayer(item.Model.TrackPtr);

            if (response.IsError && !UserSettings.Instance.SkipUnplayableTracks)
            {
                _output.OutputMessage(StringStore.UnableToPlayTrack + response.Message, false);
                return;
            }
            if (response.IsError && UserSettings.Instance.SkipUnplayableTracks)
            {
                playbackManager.AddCurrentTrackToPreviousTracks();
                playbackManager.PlayingTrack = null;
                buffers[0].RemoveAt(0);
                PlayNextQueuedTrack();
                return;                 // don't carry on with this, as it got handled in a recursive call
            }
            Session.Play();
            playbackManager.PlayingTrack    = item.Model;
            playbackManager.fullyDownloaded = false;
            playbackManager.Play();
        }