/// <summary> /// Plays the pause. /// </summary> public virtual void PlayPause() { if (null == CurrentTrack) { var i = 0; DoTheNextOne(ref i); return; } if (CurrentTrack.IsPaused) { CurrentTrack.Play(1f); } else { CurrentTrack.Pause(); } UpdateState(); }
/// <summary> /// Swaps the channels. /// </summary> /// <param name="nextTrack">The next channel.</param> /// <returns></returns> private bool SwapChannels(TrackContainer nextTrack) { try { nextTrack.Play(0f); } catch (Exception e) { nextTrack.Dispose(); LogException(e, MethodBase.GetCurrentMethod()); return(false); } if (null != CurrentTrack) { CrossFade(CurrentTrack, nextTrack); } else { FadeIn(nextTrack); } CurrentTrack = nextTrack; NotifyNewTrack(CurrentTrack); UpdateState(); return(true); }