/// <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(); }
protected virtual void Dispose(bool disposing) { if (disposing) { CurrentTrack.Dispose(); Player = null; } }