Example #1
0
        public void TestRenderedCamera()
        {
            Project p = Utils.CreateProject();

            try {
                EditionJob job;

                job = PrepareEditon();

                TimelineEvent evt = p.Timeline [0] as TimelineEvent;
                evt.CamerasConfig = new RangeObservableCollection <CameraConfig> {
                    new CameraConfig(0)
                };
                PlaylistPlayElement element = new PlaylistPlayElement(evt);
                job.Playlist.Elements.Add(element);

                manager.Add(job);

                // Check that AddSegment is called with the right video file.
                editorMock.Verify(m => m.AddSegment(p.FileSet [0].FilePath,
                                                    evt.Start.MSeconds, evt.Stop.MSeconds, evt.Rate, evt.Name, true, new Area()), Times.Once());

                /* Test with a camera index bigger than the total cameras */
                manager.CancelAll();
                editorMock.ResetCalls();
                evt = p.Timeline [1] as TimelineEvent;
                evt.CamerasConfig = new RangeObservableCollection <CameraConfig> {
                    new CameraConfig(1)
                };
                element = new PlaylistPlayElement(evt);
                job.Playlist.Elements [0] = element;
                job.State = JobState.Pending;
                manager.Add(job);
                editorMock.Verify(m => m.AddSegment(p.FileSet [1].FilePath,
                                                    evt.Start.MSeconds, evt.Stop.MSeconds, evt.Rate, evt.Name, true, new Area()), Times.Once());

                /* Test with the secondary camera */
                manager.CancelAll();
                editorMock.ResetCalls();
                evt = p.Timeline [1] as TimelineEvent;
                evt.CamerasConfig = new RangeObservableCollection <CameraConfig> {
                    new CameraConfig(2)
                };
                element = new PlaylistPlayElement(evt);
                job.Playlist.Elements [0] = element;
                job.State = JobState.Pending;
                manager.Add(job);
                editorMock.Verify(m => m.AddSegment(p.FileSet [0].FilePath,
                                                    evt.Start.MSeconds, evt.Stop.MSeconds, evt.Rate, evt.Name, true, new Area()), Times.Once());
            } finally {
                Utils.DeleteProject(p);
            }
        }
Example #2
0
 static void HandleQuitApplicationEvent(QuitApplicationEvent e)
 {
     if (jobsManagerVM.IsBusy)
     {
         string msg = Catalog.GetString("A rendering job is running in the background. Do you really want to quit?");
         if (!App.Current.Dialogs.QuestionMessage(msg, null).Result)
         {
             return;
         }
         jobsManagerVM.CancelAll();
     }
     App.Current.GUIToolkit.Quit();
 }