public void CancelJob(Job job)
{
if (currentJob != job)
return;
if (job is EditionJob) {
videoEditor.Progress -= OnProgress;
videoEditor.Error -= OnError;
videoEditor.Cancel ();
} else {
videoConverter.Progress -= OnProgress;
videoConverter.Error -= OnError;
videoConverter.Cancel ();
}
job.State = JobState.Cancelled;
RemoveCurrentFromPending ();
UpdateJobsStatus ();
StartNextJob ();
}