コード例 #1
0
ファイル: PlayerService.cs プロジェクト: ilynx/lmaml
 /// <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();
 }
コード例 #2
0
ファイル: PlayerService.cs プロジェクト: ilynx/lmaml
 /// <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);
 }