private void RemoveListeners(StartSongTaskHandler task) { var songTask = task.StartSongTask; songTask.BeforeResourceStarted -= InvokeBeforeResourceStarted; songTask.AfterResourceStarted -= InvokeAfterResourceStarted; songTask.OnAudioResourceUpdated -= InvokeOnAudioResourceUpdated; songTask.OnLoadFailure -= InvokeOnLoadFailure; }
protected override void CancelTask() { RemoveListeners(currentTask); currentTask.Cancel(); currentTask = null; }
protected override void RemoveFinishedTask() { currentTask = null; }
protected override void SetTask(QueueItem item, TimeSpan?remaining) { currentTask = constructor(item); AddListeners(currentTask); StartCurrentIfRemaining(remaining); }