public void Run(WaitHandle waitBeforePlayHandle, CancellationToken token) { var res = RunInternal(waitBeforePlayHandle, token); if (!res.Ok) { Log.Trace($"{this}: Failed ({res.Error})."); OnLoadFailure?.Invoke(this, new LoadFailureEventArgs(res.Error, QueueItem)); } else { Log.Trace($"{this}: Finished."); } }
private void RunActualTask(CancellationToken token) { var timer = new Stopwatch(); timer.Start(); var res = StartBackground(QueueItem, waitForStartPlayHandle, token); if (!res.Ok) { Log.Debug($"Task {GetHashCode()}: Failed ({res.Error})"); OnLoadFailure?.Invoke(this, new LoadFailureEventArgs(res.Error)); } else { Log.Debug($"Task {GetHashCode()}: Start song took {timer.ElapsedMilliseconds}ms"); } }
protected void InvokeOnLoadFailure(object sender, LoadFailureTaskEventArgs e) { RemoveFinishedTask(); OnLoadFailure?.Invoke(sender, e); }