コード例 #1
0
        private void AddNewPlay(Time start, Time stop, Category category)
        {
            Image miniature;

            Log.Debug(String.Format("New play created start:{0} stop:{1} category:{2}",
                                    start, stop, category));
            /* Get the current frame and get a thumbnail from it */
            if (projectType == ProjectType.CaptureProject || projectType == ProjectType.URICaptureProject)
            {
                if (!capturer.Capturing)
                {
                    guiToolkit.InfoMessage(Catalog.GetString("You can't create a new play if the capturer " +
                                                             "is not recording."));
                    return;
                }
                miniature = capturer.CurrentMiniatureFrame;
            }
            else if (projectType == ProjectType.FileProject)
            {
                miniature = player.CurrentMiniatureFrame;
                player.Pause();
            }
            else
            {
                miniature = null;
            }

            /* Add the new created play to the project and update the GUI*/
            var play = openedProject.AddPlay(category, start, stop, miniature);

            /* Tag subcategories of the new play */
            if (!Config.FastTagging)
            {
                LaunchPlayTagger(play, false);
            }
            mainWindow.AddPlay(play);
            filter.Update();
            if (projectType == ProjectType.FileProject)
            {
                player.Play();
            }
            Save(openedProject);

            if (projectType == ProjectType.CaptureProject ||
                projectType == ProjectType.URICaptureProject)
            {
                if (Config.AutoRenderPlaysInLive)
                {
                    RenderPlay(openedProject, play, openedProject.Description.File);
                }
            }
        }