/// ------------------------------------------------------------------------------------ public void InitializeAnnotationRecorder(PeakMeterCtrl peakMeter, RecordingDeviceIndicator recordingDeviceIndicator, Action <TimeSpan> recordingProgressAction) { try { Recorder = new OralAnnotationRecorder(peakMeter, recordingProgressAction); } catch { return; } _recordingDeviceIndicator = recordingDeviceIndicator; if (_recordingDeviceIndicator != null) { _recordingDeviceIndicator.Recorder = Recorder; } Recorder.RecordingStarted += (s, e) => InvokeUpdateDisplayAction(); Recorder.Stopped += (sender, args) => { if (args != null && RecordingErrorAction != null) { RecordingErrorAction(args.GetException()); } AnnotationRecordingFinished(args != null); InvokeUpdateDisplayAction(); }; Recorder.SelectedDeviceChanged += SelectedRecordingDeviceChanged; Recorder.BeginMonitoring(); }
/// ------------------------------------------------------------------------------------ private void SetupRecordingDeviceButton() { _recDeviceIndicator = new RecordingDeviceIndicator(); _recDeviceIndicator.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; _recDeviceIndicator.AutoSize = true; _recDeviceIndicator.AutoSizeMode = AutoSizeMode.GrowAndShrink; _recDeviceIndicator.Margin = new Padding(0); tableLayoutPanel1.Controls.Add(_recDeviceIndicator, 0, 3); tableLayoutPanel1.ColumnStyles[0].SizeType = SizeType.AutoSize; _recDeviceIndicator.Recorder = _viewModel.Recorder; }