示例#1
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="MainForm"/> class.
        /// </summary>
        /// 
        public MainForm()
        {
            InitializeComponent();

            viewModel = new MainViewModel(videoSourcePlayer1);
            regionWindow = new CaptureRegion(viewModel.Recorder);
            windowWindow = new CaptureWindow(viewModel.Recorder);
        }
示例#2
0
 /// <summary>
 ///   Initializes a new instance of the <see cref="CameraForm"/> class.
 /// </summary>
 /// 
 /// <param name="viewModel">The view model.</param>
 /// 
 public CameraForm(MainViewModel viewModel)
     : this()
 {
     this.viewModel = viewModel;
 }
示例#3
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="MainViewModel"/> class.
        /// </summary>
        /// 
        public RecorderViewModel(MainViewModel main, VideoSourcePlayer player)
        {
            if (main == null)
                throw new ArgumentNullException("main");

            if (player == null)
                throw new ArgumentNullException("player");

            this.main = main;
            this.videoPlayer = player;
            this.videoPlayer.NewFrame += Player_NewFrame;

            this.CaptureMode = CaptureRegionOption.Primary;
            this.CaptureRegion = new Rectangle(0, 0, 640, 480);

            this.clickCapture = new CaptureClick();
            this.cursorCapture = new CaptureCursor();
            this.keyCapture = new CaptureKeyboard();

            if (Settings.Default.CaptureAudio)
                this.CaptureAudioDevice = new AudioDeviceCollection(AudioDeviceCategory.Capture).Default;
        }
        /// <summary>
        ///   Initializes a new instance of the <see cref="ConvertViewModel" /> class.
        /// </summary>
        /// 
        public ConvertViewModel(MainViewModel main)
        {
            if (main == null)
                throw new ArgumentNullException("main");

            this.main = main;

            this.InputPath = String.Empty;
            this.LastExecutionLog = String.Empty;

            this.logger = new StringBuilder();
            this.worker = new BackgroundWorker();
            this.worker.DoWork += new DoWorkEventHandler(worker_DoWork);
            this.worker.ProgressChanged += new ProgressChangedEventHandler(worker_ProgressChanged);
            this.worker.WorkerReportsProgress = true;
            this.worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
        }
        /// <summary>
        ///   Initializes a new instance of the <see cref="MainViewModel"/> class.
        /// </summary>
        /// 
        public RecorderViewModel(MainViewModel main, VideoSourcePlayer2 player)
        {
            if (main == null)
                throw new ArgumentNullException("main");

            if (player == null)
                throw new ArgumentNullException("player");

            this.main = main;
            this.videoPlayer = player;
            this.videoPlayer.NewFrame += Player_NewFrame;

            this.CaptureMode = CaptureRegionOption.Primary;
            this.CaptureRegion = new Rectangle(0, 0, 640, 480);

            this.clickCapture = new CaptureClick();
            this.cursorCapture = new CaptureCursor();
            this.keyCapture = new CaptureKeyboard();

            this.AudioCaptureDevices = new AudioViewModelCollection(RecorderViewModel.AudioDevices);


            // Search and mark last selected devices
            foreach (var dev in AudioCaptureDevices)
                dev.Checked = Settings.Default.LastAudioDevices
                    .Contains(dev.DeviceInfo.Guid.ToString());
        }