Inheritance: IRenderingJobsManager
Exemple #1
0
        public static void StartServices(MainWindow mainWindow)
        {
            RenderingJobsManager videoRenderer;
            ProjectsManager      projectsManager;

            /* Start TemplatesService */
            ts = new TemplatesService(Config.configDirectory);

            /* Start DB services */
            db = new DataBase(Path.Combine(Config.DBDir(), Constants.DB_FILE));

            /* Start the events manager */
            eManager = new EventsManager(mainWindow);

            /* Start the hotkeys manager */
            hkManager = new HotKeysManager();
            hkManager.newMarkEvent += eManager.OnNewTag;

            /* Start the rendering jobs manager */
            videoRenderer = new RenderingJobsManager(mainWindow.RenderingStateBar);
            mainWindow.RenderPlaylistEvent += (playlist) => {
                videoRenderer.AddJob(RenderingJobsManager.ConfigureRenderingJob(playlist, mainWindow));
            };

            /* Start Game Units manager */
            guManager = new GameUnitsManager(mainWindow, mainWindow.Player);

            projectsManager = new ProjectsManager(mainWindow);
            projectsManager.OpenedProjectChanged += OnOpenedProjectChanged;
        }
Exemple #2
0
        public static void RegisterServices(IGUIToolkit guiToolkit, IMultimediaToolkit multimediaToolkit)
        {
            ts = new TemplatesService(new FileStorage(Config.DBDir));
            RegisterService(ts);
            Config.TeamTemplatesProvider       = ts.TeamTemplateProvider;
            Config.CategoriesTemplatesProvider = ts.CategoriesTemplateProvider;

            /* Start DB services */
            dbManager = new DataBaseManager(Config.DBDir, guiToolkit);
            RegisterService(dbManager);
            Config.DatabaseManager = dbManager;

            /* Start the rendering jobs manager */
            videoRenderer = new RenderingJobsManager(multimediaToolkit, guiToolkit);
            RegisterService(videoRenderer);
            Config.RenderingJobsManger = videoRenderer;

            projectsManager = new ProjectsManager(guiToolkit, multimediaToolkit, ts);
            RegisterService(projectsManager);

            /* State the tools manager */
            toolsManager = new ToolsManager(guiToolkit, dbManager);
            RegisterService(toolsManager);
            ProjectsImporter = toolsManager;

            /* Start the events manager */
            eManager = new EventsManager(guiToolkit, videoRenderer);
            RegisterService(eManager);

            /* Start the hotkeys manager */
            hkManager = new HotKeysManager();
            RegisterService(hkManager);

            /* Start playlists manager */
            plManager = new PlaylistManager(Config.GUIToolkit, videoRenderer);
            RegisterService(plManager);

            /* Start the Update Notifier */
            updatesNotifier = new UpdatesNotifier();
            RegisterService(updatesNotifier);
        }
Exemple #3
0
        public static void StartServices(IGUIToolkit guiToolkit, IMultimediaToolkit multimediaToolkit)
        {
            ProjectsManager projectsManager;

            /* Start TemplatesService */
            ts = new TemplatesService(Config.TemplatesDir);
            Core.mainWindow.TemplatesService = ts;

            /* Start DB services */
            dbManager = new DataBaseManager(Config.DBDir, guiToolkit);
            dbManager.SetActiveByName(Config.CurrentDatabase);

            /* Start Migration */
            MigrationsManager migration = new MigrationsManager(ts, dbManager);

            migration.StartMigration();

            /* Start the rendering jobs manager */
            videoRenderer = new RenderingJobsManager(multimediaToolkit, guiToolkit);

            /* Start the events manager */
            eManager = new EventsManager(guiToolkit, videoRenderer);

            /* Start the hotkeys manager */
            hkManager = new HotKeysManager(guiToolkit.MainWindow);
            hkManager.newMarkEvent += eManager.OnNewTag;

            /* Start Game Units manager */
            guManager = new GameUnitsManager(mainWindow, mainWindow.Player);

            /* Start playlists manager */
            plManager = new PlaylistManager(guiToolkit, videoRenderer);

            projectsManager = new ProjectsManager(guiToolkit, multimediaToolkit);
            projectsManager.OpenedProjectChanged += OnOpenedProjectChanged;
        }
Exemple #4
0
        public static void StartServices(IGUIToolkit guiToolkit, IMultimediaToolkit multimediaToolkit)
        {
            ProjectsManager projectsManager;

            /* Start TemplatesService */
            ts = new TemplatesService(Config.configDirectory);
            Core.mainWindow.TemplatesService = ts;

            /* Start DB services */
            db = new DataBase(Path.Combine(Config.DBDir(),Constants.DB_FILE));

            /* Start the events manager */
            eManager = new EventsManager(guiToolkit);

            /* Start the hotkeys manager */
            hkManager = new HotKeysManager(guiToolkit.MainWindow);
            hkManager.newMarkEvent += eManager.OnNewTag;

            /* Start the rendering jobs manager */
            videoRenderer = new RenderingJobsManager(multimediaToolkit, guiToolkit);

            /* Start Game Units manager */
            guManager = new GameUnitsManager(mainWindow, mainWindow.Player);

            /* Start playlists manager */
            plManager = new PlaylistManager(guiToolkit, videoRenderer);

            projectsManager = new ProjectsManager(guiToolkit, multimediaToolkit);
            projectsManager.OpenedProjectChanged += OnOpenedProjectChanged;
        }
        public void TestRenderedCamera()
        {
            Project p = Utils.CreateProject ();

            try {
                TimelineEvent evt = p.Timeline [0];
                evt.CamerasConfig = new List<CameraConfig> { new CameraConfig (0) };
                PlaylistPlayElement element = new PlaylistPlayElement (evt, p.Description.FileSet);

                // Playlist with one event
                var playlist = new Playlist ();
                playlist.Elements.Add (element);

                // Create a job
                const string outputFile = "path";
                EncodingSettings settings = new EncodingSettings (VideoStandards.P720, EncodingProfiles.MP4, EncodingQualities.Medium,
                                                25, 1, outputFile, true, true, 20);
                EditionJob job = new EditionJob (playlist, settings);

                // Mock IMultimediaToolkit and video editor
                var mtk = Mock.Of<IMultimediaToolkit> (m => m.GetVideoEditor () == Mock.Of<IVideoEditor> ());
                // and guitoolkit
                var gtk = Mock.Of<IGUIToolkit> (g => g.RenderingStateBar == Mock.Of<IRenderingStateBar> ());
                // and a video editor
                Mock<IVideoEditor> mock = Mock.Get<IVideoEditor> (mtk.GetVideoEditor ());
                // And eventbroker
                Config.EventsBroker = Mock.Of<EventsBroker> ();

                // Create a rendering object with mocked interfaces
                RenderingJobsManager renderer = new RenderingJobsManager (mtk, gtk);
                // Start service
                renderer.Start ();

                renderer.AddJob (job);

                // Check that AddSegment is called with the right video file.
                mock.Verify (m => m.AddSegment (p.Description.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 */
                renderer.CancelAllJobs ();
                mock.ResetCalls ();
                evt = p.Timeline [1];
                evt.CamerasConfig = new List<CameraConfig> { new CameraConfig (1) };
                element = new PlaylistPlayElement (evt, p.Description.FileSet);
                playlist.Elements [0] = element;
                job = new EditionJob (playlist, settings);
                renderer.AddJob (job);
                mock.Verify (m => m.AddSegment (p.Description.FileSet [1].FilePath,
                    evt.Start.MSeconds, evt.Stop.MSeconds, evt.Rate, evt.Name, true, new Area ()), Times.Once ());

                /* Test with the secondary camera */
                renderer.CancelAllJobs ();
                mock.ResetCalls ();
                evt = p.Timeline [1];
                evt.CamerasConfig = new List<CameraConfig> { new CameraConfig (2) };
                element = new PlaylistPlayElement (evt, p.Description.FileSet);
                playlist.Elements [0] = element;
                job = new EditionJob (playlist, settings);
                renderer.AddJob (job);
                mock.Verify (m => m.AddSegment (p.Description.FileSet [0].FilePath,
                    evt.Start.MSeconds, evt.Stop.MSeconds, evt.Rate, evt.Name, true, new Area ()), Times.Once ());
            } finally {
                Utils.DeleteProject (p);
            }
        }