Example #1
0
        public VideoViewModel(IRegionProvider RegionProvider,
                              IEnumerable <IImageWriterItem> ImageWriters,
                              Settings Settings,
                              LanguageManager LanguageManager,
                              FullScreenSourceProvider FullScreenProvider,
                              IIconSet Icons,
                              // ReSharper disable SuggestBaseTypeForParameter
                              ScreenSourceProvider ScreenSourceProvider,
                              WindowSourceProvider WindowSourceProvider,
                              RegionSourceProvider RegionSourceProvider,
                              NoVideoSourceProvider NoVideoSourceProvider,
                              DeskDuplSourceProvider DeskDuplSourceProvider,
                              FFmpegWriterProvider FFmpegWriterProvider,
                              SharpAviWriterProvider SharpAviWriterProvider,
                              GifWriterProvider GifWriterProvider,
                              StreamingWriterProvider StreamingWriterProvider,
                              DiscardWriterProvider DiscardWriterProvider
                              // ReSharper restore SuggestBaseTypeForParameter
                              ) : base(Settings, LanguageManager)
        {
            this.NoVideoSourceProvider = NoVideoSourceProvider;

            AvailableVideoWriters = new ReadOnlyObservableCollection <IVideoWriterItem>(_videoWriters);

            AvailableImageWriters = new ReadOnlyObservableCollection <IImageWriterItem>(_imageWriters);

            _regionProvider     = RegionProvider;
            _fullScreenProvider = FullScreenProvider;

            VideoSources.Add(new VideoSourceModel(NoVideoSourceProvider, nameof(Loc.OnlyAudio), NoVideoDescription, Icons.Video));
            VideoSources.Add(new VideoSourceModel(FullScreenProvider, nameof(Loc.FullScreen), FullScreenDescription, Icons.MultipleMonitor));
            VideoSources.Add(new VideoSourceModel(ScreenSourceProvider, nameof(Loc.Screen), ScreenDescription, Icons.Screen));
            VideoSources.Add(new VideoSourceModel(WindowSourceProvider, nameof(Loc.Window), WindowDescription, Icons.Window));
            VideoSources.Add(new VideoSourceModel(RegionSourceProvider, nameof(Loc.Region), RegionDescription, Icons.Region));

            if (Windows8OrAbove)
            {
                VideoSources.Add(new VideoSourceModel(DeskDuplSourceProvider, "Desktop Duplication", DeskDuplDescription, Icons.Game));
            }

            VideoWriterProviders.Add(FFmpegWriterProvider);
            VideoWriterProviders.Add(GifWriterProvider);
            VideoWriterProviders.Add(SharpAviWriterProvider);
            VideoWriterProviders.Add(StreamingWriterProvider);
            VideoWriterProviders.Add(DiscardWriterProvider);

            foreach (var imageWriter in ImageWriters)
            {
                _imageWriters.Add(imageWriter);
            }

            SetDefaultSource();

            if (!AvailableImageWriters.Any(M => M.Active))
            {
                AvailableImageWriters[0].Active = true;
            }

            SelectedVideoWriterKind = FFmpegWriterProvider;
        }
Example #2
0
 public ConsoleLister(WebcamModel Webcam,
                      IAudioSource AudioSource,
                      IPlatformServices PlatformServices,
                      FFmpegWriterProvider FfmpegWriterProvider,
                      SharpAviWriterProvider SharpAviWriterProvider)
 {
     _webcam                 = Webcam;
     _audioSource            = AudioSource;
     _platformServices       = PlatformServices;
     _ffmpegWriterProvider   = FfmpegWriterProvider;
     _sharpAviWriterProvider = SharpAviWriterProvider;
 }
 public MyRecordingViewModel(AudioSource audioSource) : base(new Settings(), LanguageManager.Instance)
 {
     _audioSource      = audioSource;
     VideoSourcePicker = new VideoSourcePicker();
     //_audioSource = new BassAudioSource(Settings.Audio);
     RegionProvider         = new RegionSelector(VideoSourcePicker);
     _webcamOverlay         = new WebcamOverlay(new WebCamProvider(), Settings);
     _previewWindow         = new PreviewWindowService();
     FullScreenProvider     = new FullScreenSourceProvider(LanguageManager, new FullScreenItem());
     ScreenSourceProvider   = new ScreenSourceProvider(LanguageManager, VideoSourcePicker);
     WindowSourceProvider   = new WindowSourceProvider(LanguageManager, VideoSourcePicker, new RegionSelector(VideoSourcePicker));
     RegionSourceProvider   = new RegionSourceProvider(LanguageManager, RegionProvider);
     NoVideoSourceProvider  = new NoVideoSourceProvider(LanguageManager);
     DeskDuplSourceProvider = new DeskDuplSourceProvider(LanguageManager, VideoSourcePicker);
     ImageWriters           = new IImageWriterItem[4] {
         new EditorWriter(), new ClipboardWriter(SystemTray, LanguageManager), null, null
     };
     SharpAviWriterProvider  = new SharpAviWriterProvider();
     DiscardWriterProvider   = new DiscardWriterProvider();
     FFmpegWriterProvider    = new FFmpegWriterProvider(new FFmpegSettings());
     GifWriterProvider       = new GifWriterProvider(LanguageManager, new GifItem(new GifSettings()));
     StreamingWriterProvider = new StreamingWriterProvider();
     _videoViewModel         = new VideoViewModel(
         RegionProvider,
         ImageWriters,
         Settings,
         LanguageManager,
         FullScreenProvider,
         ScreenSourceProvider,
         WindowSourceProvider,
         RegionSourceProvider,
         NoVideoSourceProvider,
         DeskDuplSourceProvider,
         FFmpegWriterProvider,
         SharpAviWriterProvider,
         GifWriterProvider,
         StreamingWriterProvider,
         DiscardWriterProvider
         );
 }
        public VideoWritersViewModel(IEnumerable <IVideoWriterProvider> WriterProviders,
                                     IEnumerable <IVideoConverter> PostWriters,
                                     SharpAviWriterProvider SharpAviWriterProvider)
        {
            VideoWriterProviders = WriterProviders.ToList();

            AvailableVideoWriters = new ReadOnlyObservableCollection <IVideoWriterItem>(_videoWriters);

            AvailablePostWriters = PostWriters;
            SelectedPostWriter   = PostWriters.FirstOrDefault();

            if (VideoWriterProviders.Count > 0)
            {
                SelectedVideoWriterKind = VideoWriterProviders[0];
            }

            AvailableStepWriters = new IVideoWriterItem[]
            {
                new StepsVideoWriterItem(SharpAviWriterProvider.First()),
                new ImageFolderWriterItem()
            };

            SelectedStepsWriter = AvailableStepWriters[0];
        }