public void AddJob(Job job)
 {
     if (job == null)
         return;
     jobs.Add(job);
     pendingJobs.Add(job);
     UpdateJobsStatus();
     if (pendingJobs.Count == 1)
         StartNextJob();
 }
        private void StartNextJob()
        {
            if (pendingJobs.Count == 0) {
                ResetGui();
                return;
            }

            videoEditor = multimediaToolkit.GetVideoEditor();
            videoEditor.Progress += OnProgress;
            currentJob = pendingJobs[0];
            LoadJob(currentJob);

            try {
                videoEditor.EncodingSettings = currentJob.EncodingSettings;
                videoEditor.EnableTitle = currentJob.OverlayTitle;
                videoEditor.EnableAudio = currentJob.EnableAudio;
                videoEditor.Start();
            }
            catch(Exception ex) {
                Log.Exception(ex);
                Log.Error("Error redering job: ", currentJob.Name);
                currentJob.State = JobState.Error;
            }
        }
 private void LoadJob(Job job)
 {
     foreach(PlayListPlay segment in job.Playlist) {
         if(segment.Valid)
             videoEditor.AddSegment(segment.MediaFile.FilePath,
                                    segment.Start.MSeconds,
                                    segment.Duration.MSeconds,
                                    segment.Rate,
                                    segment.Name,
                                    segment.MediaFile.HasAudio);
     }
 }
 public void DeleteJob(Job job)
 {
     job.State = JobState.Cancelled;
     CancelJob(job);
 }
        public void CancelJob(Job job)
        {
            if (currentJob != job)
                return;

            videoEditor.Progress -= OnProgress;
            videoEditor.Cancel();
            job.State = JobState.Cancelled;
            RemoveCurrentFromPending();
            UpdateJobsStatus();
            StartNextJob();
        }
Пример #6
0
        public Job ConfigureRenderingJob(IPlayList playlist)
        {
            VideoEditionProperties vep;
            Job job = null;
            int response;

            if (playlist.Count == 0) {
                WarningMessage(Catalog.GetString("The playlist you want to render is empty."));
                return null;
            }

            vep = new VideoEditionProperties();
            vep.TransientFor = mainWindow as Gtk.Window;
            response = vep.Run();
            while(response == (int)ResponseType.Ok && vep.EncodingSettings.OutputFile == "") {
                WarningMessage(Catalog.GetString("Please, select a video file."));
                response=vep.Run();
            }
            if(response ==(int)ResponseType.Ok)
                job = new Job(playlist, vep.EncodingSettings, vep.EnableAudio, vep.TitleOverlay);
            vep.Destroy();
            return job;
        }