Exemplo n.º 1
0
        public E <LocalStr> Next(InvokerData invoker, bool manually = true)
        {
            PlaylistItem pli = null;

            for (int i = 0; i < 10; i++)
            {
                if ((pli = PlaylistManager.Next(manually)) is null)
                {
                    break;
                }
                var result = Play(invoker, pli);
                if (result.Ok)
                {
                    return(result);
                }
                Log.Warn("Skipping: {0} because {1}", pli.DisplayString, result.Error.Str);
            }
            if (pli is null)
            {
                return(new LocalStr(strings.info_playmgr_no_next_song));
            }
            else
            {
                return(new LocalStr(string.Format(strings.error_playmgr_many_songs_failed, "!next")));
            }
        }
Exemplo n.º 2
0
        public R Next(InvokerData invoker)
        {
            PlaylistItem pli = null;

            for (int i = 0; i < 10; i++)
            {
                if ((pli = PlaylistManager.Next()) == null)
                {
                    break;
                }
                var result = Play(invoker, pli);
                if (result.Ok)
                {
                    return(result);
                }
                Log.Warn("Skipping: {0} because {1}", pli.DisplayString, result.Error);
            }
            if (pli == null)
            {
                return("No next song could be played");
            }
            else
            {
                return("A few songs failed to start, use !next to continue");
            }
        }
Exemplo n.º 3
0
        public R Next(InvokerData invoker)
        {
            PlaylistItem pli = null;

            for (int i = 0; i < 10; i++)
            {
                if ((pli = PlaylistManager.Next()) == null)
                {
                    break;
                }
                if (Play(invoker, pli))
                {
                    return(R.OkR);
                }
                // optional message here that playlist entry has been skipped
            }
            if (pli == null)
            {
                return("No next song could be played");
            }
            else
            {
                return("A few songs failed to start, use !next to continue");
            }
        }
Exemplo n.º 4
0
        /// <summary>Plays the next song in the playlist or queue.</summary>
        public void Next()
        {
            var next = PlaylistManager.Next();

            if (next != null)
            {
                CurrentPlayData = next;
                StartResource(CurrentPlayData);
            }
            else
            {
                Stop(false);
            }
        }