public SpaceRecordingViewModel(Space space, Project project) { InitCommands(); _setDurationBasedOnWpm = false; _description = null; Space = space; Project = project; ResetElapsedTime(); SetTimeLeft(); RecordDuration = Space.Duration; MaxWordsPerMinute = DefaultMaxWordsPerMinute; MinWordsPerMinute = DefaultMinWordsPerMinute; _recorder = new DescriptionRecorder(); _recorder.DescriptionRecorded += (sender, args) => Description = args.Value; _player = new DescriptionPlayer(); _player.DescriptionFinishedPlaying += (sender, args) => CommandManager.InvalidateRequerySuggested(); _recordingTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(CountdownTimerIntervalMsec) }; _recordingTimer.Tick += RecordingTimerOnTick; _stopwatch = new Stopwatch(); CountdownViewModel = new CountdownViewModel(); CountdownViewModel.CountdownFinished += (sender, args) => StartRecording(); SetWpmValuesBasedOnSpaceText(); }
public DescriptionRecordingViewModel(ILiveDescribePlayer mediaVideo, ProjectManager projectManager) { _mediaVideo = mediaVideo; _projectManager = projectManager; _recorder = GetDescriptionRecorder(); InitCommands(); Settings.Default.PropertyChanged += (sender, args) => { if (args.PropertyName != "Microphone") return; Recorder.MicrophoneDeviceNumber = Settings.Default.Microphone.DeviceNumber; try { Log.Info("Product Name of Apply Requested Microphone: " + WaveIn.GetCapabilities(Recorder.MicrophoneDeviceNumber).ProductName); } catch (MmException) { Log.Info("No Microphone is plugged in."); } }; }
private DescriptionRecorder GetDescriptionRecorder() { var dr = new DescriptionRecorder(); dr.DescriptionRecorded += (sender, args) => _projectManager.AddDescriptionAndTrackForUndo(args.Value); return dr; }