コード例 #1
0
ファイル: PlayerService.cs プロジェクト: ilynx/lmaml
 /// <summary>
 /// Manages this instance.
 /// </summary>
 private void Manage()
 {
     while (doMange)
     {
         Thread.CurrentThread.Join(1);
         Action a;
         if (null != (a = managerQueue.RawDequeue()))
         {
             a();
         }
         if (null != CurrentTrack && (CurrentTrack.Length.TotalMilliseconds - CurrentTrack.CurrentPositionMillisecond) <= PlayNextThreshold.Value)
         {
             var pre = 0;
             DoTheNextOne(ref pre);
         }
         if (PlayingState.Playing != State || DateTime.Now - LastProgress < progressUpdateInterval || null == CurrentTrack)
         {
             continue;
         }
         SendProgress();
     }
     if (null == CurrentTrack)
     {
         return;
     }
     CurrentTrack.Dispose();
     CurrentTrack.Stop();
 }
コード例 #2
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         CurrentTrack.Dispose();
         Player = null;
     }
 }