예제 #1
0
        private void LoadEditionJob(EditionJob job)
        {
            videoEditor = multimediaToolkit.GetVideoEditor();
            videoEditor.EncodingSettings = job.EncodingSettings;
            videoEditor.Progress        += OnProgress;

            foreach (PlayListPlay segment in job.Playlist)
            {
                if (!ProcessSegment(segment))
                {
                    continue;
                }
            }

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

            videoEditor.Progress -= OnProgress;
            videoEditor.Cancel();
            job.State = JobState.Cancelled;
            RemoveCurrentFromPending();
            UpdateJobsStatus();
            StartNextJob();
        }
예제 #3
0
        void CleanVideoEditor(bool cancel = false)
        {
            if (videoEditor == null)
            {
                return;
            }

            videoEditor.Progress -= OnProgress;
            videoEditor.Error    -= OnError;
            if (cancel)
            {
                videoEditor.Cancel();
            }
            videoEditor = null;
        }
예제 #4
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();
        }
예제 #5
0
        private void LoadEditionJob(EditionJob job)
        {
            videoEditor = multimediaToolkit.GetVideoEditor();
            videoEditor.EncodingSettings = job.EncodingSettings;
            videoEditor.Progress        += OnProgress;
            videoEditor.Error           += OnError;

            foreach (IPlaylistElement segment in job.Playlist.Elements)
            {
                if (segment is PlaylistPlayElement)
                {
                    ProcessPlay(segment as PlaylistPlayElement);
                }
                else if (segment is PlaylistVideo)
                {
                    ProcessVideo(segment as PlaylistVideo);
                }
                else if (segment is PlaylistImage)
                {
                    ProcessImage(segment as PlaylistImage);
                }
                else if (segment is PlaylistDrawing)
                {
                    ProcessDrawing(segment as PlaylistDrawing);
                }
            }

            try {
                videoEditor.Start();
            } catch (Exception ex) {
                videoEditor.Cancel();
                job.State = JobState.Error;
                Log.Exception(ex);
                Log.Error("Error rendering job: ", job.Name);
                guiToolkit.ErrorMessage(Catalog.GetString("Error rendering job: ") + ex.Message);
            }
        }
예제 #6
0
        private void LoadEditionJob(EditionJob job)
        {
            videoEditor = multimediaToolkit.GetVideoEditor ();
            videoEditor.EncodingSettings = job.EncodingSettings;
            videoEditor.Progress += OnProgress;
            videoEditor.Error += OnError;

            foreach (IPlaylistElement segment in job.Playlist.Elements) {
                if (segment is PlaylistPlayElement) {
                    ProcessPlay (segment as PlaylistPlayElement);
                } else if (segment is PlaylistVideo) {
                    ProcessVideo (segment as PlaylistVideo);
                } else if (segment is PlaylistImage) {
                    ProcessImage (segment as PlaylistImage);
                } else if (segment is PlaylistDrawing) {
                    ProcessDrawing (segment as PlaylistDrawing);
                }
            }

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