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"))); } }
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"); } }
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"); } }
/// <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); } }