/// <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());
        }
Esempio n. 2
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="MainViewModel"/> class.
        /// </summary>
        /// 
        public MainViewModel(VideoSourcePlayer2 player)
        {
            if (player == null) throw new ArgumentNullException("player");

            Recorder = new RecorderViewModel(this, player);
            Notifier = new NotifyViewModel(Recorder);
            Converter = new ConvertViewModel(this);

            IsPreviewVisible = true;
            CurrentDirectory = Settings.Default.DefaultFolder;
            StatusText = Resources.Status_Ready;



            PropertyChanged += MainViewModel_PropertyChanged;
            Recorder.PropertyChanged += recorder_PropertyChanged;
            Converter.PropertyChanged += Convert_PropertyChanged;
        }