/// <summary> /// Play from the current item in the playlist. /// </summary> /// <returns>True if there was anything to play.</returns> private bool Play() { if (mNowPlaying < mPlaylist.Count) { mPlayer.Stop(); mPlayer.Play(mPlaylist[mNowPlaying]); return(true); } else { return(false); } }
/// <summary> /// Move to the next asset in the playlist or stop if at the end. /// </summary> private void mPlayer_EndOfAudioAsset(Audio.Player player, EventArgs e) { ++mNowPlaying; if (!Play()) { player.EndOfAudioAsset -= new Audio.EndOfAudioAssetHandler(mPlayer_EndOfAudioAsset); player.Stop(); } }