Example #1
0
        static internal bool CreateAndShow(IEnumerable <CaptureOptions.ImageSize> imageSizes,
                                           IEnumerable <CaptureOptions.ImageContainer> imageContainers,
                                           IEnumerable <CaptureOptions.VideoCompression> videoCompressions,
                                           IEnumerable <CaptureOptions.VideoSize> videoSizes,
                                           IEnumerable <CaptureOptions.VideoFPS> videoFPSs,
                                           CaptureSettings settings)
        {
            List <String> _imageSizes, _imageContainers, _videoCompressions, _videoSizes, _videoFPSs;
            int           _selectedImageSize, _selectedImageContainer, _selectedVideoCompression,
                          _selectedVideoSize, _selectedVideoFPS;

            GenerateItems <CaptureOptions.ImageSize>(imageSizes, settings.ImageSize,
                                                     out _imageSizes, out _selectedImageSize);
            GenerateItems <CaptureOptions.ImageContainer>(imageContainers, settings.ImageContainer,
                                                          out _imageContainers, out _selectedImageContainer);
            GenerateItems <CaptureOptions.VideoCompression>(videoCompressions, settings.VideoCompression,
                                                            out _videoCompressions, out _selectedVideoCompression);
            GenerateItems <CaptureOptions.VideoSize>(videoSizes, settings.VideoSize,
                                                     out _videoSizes, out _selectedVideoSize);
            GenerateItems <CaptureOptions.VideoFPS>(videoFPSs, settings.VideoFPS,
                                                    out _videoFPSs, out _selectedVideoFPS);

            CaptureSettingsForm form = new CaptureSettingsForm(_imageSizes, _selectedImageSize,
                                                               _imageContainers, _selectedImageContainer,
                                                               _videoCompressions, _selectedVideoCompression,
                                                               _videoSizes, _selectedVideoSize,
                                                               _videoFPSs, _selectedVideoFPS,
                                                               settings.NamePrefix, settings.OutDirectory);

            form.ShowDialog();

            if (form._shouldApply)
            {
                settings.ImageSize
                    = new List <CaptureOptions.ImageSize>(imageSizes)[Math.Max(0, form.cbImageSize.SelectedIndex)];
                settings.ImageContainer
                    = new List <CaptureOptions.ImageContainer>(imageContainers)[Math.Max(0, form.cbImageContainer.SelectedIndex)];
                settings.VideoCompression
                    = new List <CaptureOptions.VideoCompression>(videoCompressions)[Math.Max(0, form.cbVideoCompression.SelectedIndex)];
                settings.VideoSize
                    = new List <CaptureOptions.VideoSize>(videoSizes)[Math.Max(0, form.cbVideoSize.SelectedIndex)];
                settings.VideoFPS
                    = new List <CaptureOptions.VideoFPS>(videoFPSs)[Math.Max(0, form.cbVideoFPS.SelectedIndex)];
                settings.NamePrefix   = form.tbNamePrefix.Text;
                settings.OutDirectory = form.tbOutFolder.Text;
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
 private void Action_ChangeCaptureSettings(Object arg)
 {
     if (_context != null &&
         CaptureSettingsForm.CreateAndShow(CaptureOptions.ImageSizes,
                                           CaptureOptions.ImageContainers,
                                           CaptureOptions.VideoCompressions,
                                           CaptureOptions.VideoSizes,
                                           CaptureOptions.VideoFPSs,
                                           SettingsManager.GetRef().CaptureSettings))
     {
         _context.Recreate(true);
     }
 }