private void CancelClicked(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result =
                MessageBox.Show("Are you sure you want to cancel?",
                                "Cancel?", MessageBoxButton.YesNo);

            if (result == MessageBoxResult.Yes)
            {
                converter.Cancel();
                setTaskbarManagerNoProgress();
                if (Cancelled != null)
                {
                    Cancelled(this, new EventArgs());
                }
            }
        }
Esempio n. 2
0
        private void LoadConversionJob(ConversionJob job)
        {
            videoConverter                  = multimediaToolkit.GetVideoConverter(job.EncodingSettings.OutputFile);
            videoConverter.Progress        += OnProgress;
            videoConverter.EncodingSettings = job.EncodingSettings;
            videoConverter.Error           += OnError;

            foreach (MediaFile file in job.InputFiles)
            {
                videoConverter.AddFile(file.FilePath, file.Length);
            }

            try {
                videoConverter.Start();
            } catch (Exception ex) {
                videoConverter.Cancel();
                job.State = JobState.Error;
                Log.Exception(ex);
                Log.Error("Error rendering job: ", job.Name);
                guiToolkit.ErrorMessage(Catalog.GetString("Error rendering job: ") + ex.Message);
            }
        }
Esempio n. 3
0
        public void CancelJob(Job job)
        {
            if (currentJob != job)
            {
                return;
            }

            if (job is EditionJob)
            {
                videoEditor.Progress -= OnProgress;
                videoEditor.Cancel();
            }
            else
            {
                videoConverter.Progress -= OnProgress;
                videoConverter.Error    -= OnError;
                videoConverter.Cancel();
            }
            job.State = JobState.Cancelled;
            RemoveCurrentFromPending();
            UpdateJobsStatus();
            StartNextJob();
        }
Esempio n. 4
0
        private void LoadConversionJob(ConversionJob job)
        {
            videoConverter = multimediaToolkit.GetVideoConverter (job.EncodingSettings.OutputFile);
            videoConverter.Progress += OnProgress;
            videoConverter.EncodingSettings = job.EncodingSettings;
            videoConverter.Error += OnError;

            foreach (MediaFile file in job.InputFiles) {
                videoConverter.AddFile (file.FilePath, file.Duration.MSeconds,
                    file.VideoWidth, file.VideoHeight, file.Par);
            }

            try {
                videoConverter.Start ();
            } catch (Exception ex) {
                videoConverter.Cancel ();
                job.State = JobState.Error;
                Log.Exception (ex);
                Log.Error ("Error rendering job: ", job.Name);
                guiToolkit.ErrorMessage (Catalog.GetString ("Error rendering job: ") + ex.Message);
            }
        }