public void Save(double _fPlaybackFrameInterval, double _fSlowmotionPercentage, Int64 _iSelStart, Int64 _iSelEnd, DelegateGetOutputBitmap _DelegateOutputBitmap)
        {
            // Let the user select what he wants to save exactly.
            // Note: _iSelStart, _iSelEnd, _Metadata, should ultimately be taken from local members.

            formVideoExport fve = new formVideoExport(m_VideoFile.FilePath, m_Metadata, _fSlowmotionPercentage);

            if (fve.Spawn() == DialogResult.OK)
            {
                if (fve.SaveAnalysis)
                {
                    // Save analysis.
                    m_Metadata.ToXmlFile(fve.Filename);
                }
                else
                {
                    DoSave(fve.Filename,
                           fve.MuxDrawings ? m_Metadata : null,
                           fve.UseSlowMotion ? _fPlaybackFrameInterval : m_VideoFile.Infos.fFrameInterval,
                           _iSelStart,
                           _iSelEnd,
                           fve.BlendDrawings,
                           false,
                           false,
                           _DelegateOutputBitmap);
                }
            }

            // Release configuration form.
            fve.Dispose();
        }
Exemple #2
0
        /// <summary>
        /// Main video export.
        /// </summary>
        public void SaveVideo(double playbackFrameInterval, double slowmotionPercentage, ImageRetriever imageRetriever)
        {
            // Show the intermediate dialog for export options.
            formVideoExport fve = new formVideoExport(videoReader.FilePath, slowmotionPercentage);

            if (fve.ShowDialog() != DialogResult.OK)
            {
                fve.Dispose();
                return;
            }

            if (!FilesystemHelper.CanWrite(fve.Filename))
            {
                DisplayErrorMessage(ScreenManagerLang.Error_SaveMovie_FileError);
                fve.Dispose();
                return;
            }

            DoSave(fve.Filename,
                   fve.UseSlowMotion ? playbackFrameInterval : metadata.UserInterval,
                   true,
                   false,
                   false,
                   imageRetriever);

            // Save this as the "preferred" format for video exports.
            PreferencesManager.PlayerPreferences.VideoFormat = FilesystemHelper.GetVideoFormat(fve.Filename);
            PreferencesManager.Save();

            fve.Dispose();
        }
Exemple #3
0
        /// <summary>
        /// Main video saving pipeline. Saves either a video or the analysis data.
        /// </summary>
        public void Save(double playbackFrameInterval, double slowmotionPercentage, ImageRetriever imageRetriever)
        {
            // Let the user select what he wants to save exactly.
            formVideoExport fve = new formVideoExport(videoReader.FilePath, metadata, slowmotionPercentage);

            if (fve.ShowDialog() != DialogResult.OK)
            {
                fve.Dispose();
                return;
            }

            if (!FilesystemHelper.CanWrite(fve.Filename))
            {
                DisplayErrorMessage(ScreenManagerLang.Error_SaveMovie_FileError);
                fve.Dispose();
                return;
            }

            if (fve.SaveAnalysis)
            {
                MetadataSerializer serializer = new MetadataSerializer();
                serializer.SaveToFile(metadata, fve.Filename);
                metadata.AfterManualExport();
            }
            else
            {
                DoSave(fve.Filename,
                       fve.UseSlowMotion ? playbackFrameInterval : metadata.UserInterval,
                       fve.BlendDrawings,
                       false,
                       false,
                       imageRetriever);

                PreferencesManager.PlayerPreferences.VideoFormat = FilesystemHelper.GetVideoFormat(fve.Filename);
                PreferencesManager.Save();
            }

            fve.Dispose();
        }