private void flopGlobals() { Control[] controls = { tbOpacity, cbRecord, cbAlertSound, bBrowseAudioFile, bBrowseRecordFolder, tbAudioFile, tbRecordFolder, cbCodec, cbDetectorType, cbEnableMotionAlarm, cbAlwaysShow }; if (cbGlobalOptions.Checked) { //save undo undoAlertSoundEnabled = cbAlertSound.Checked; undoRecordEnabled = cbRecord.Checked; undoRecordFolder = tbRecordFolder.Text; undoAudioFile = tbAudioFile.Text; undoOpacity = tbOpacity.Value; undoCodec = cbCodec.SelectedItem; undoAlwaysShow = cbAlwaysShow.Checked; undoEnableMotion = cbEnableMotionAlarm.Checked; undoDetectorType = options.DetectorType; //pull in all globals GlobalVideoFeedOptions globals = Program.globalSettings; cbAlertSound.Checked = globals.EnableAlertSound; cbRecord.Checked = globals.EnableRecording; tbRecordFolder.Text = globals.RecordFolder; tbAudioFile.Text = globals.AlertSoundFile; cbCodec.SelectedItem = globals.Codec; tbOpacity.Value = (int)(globals.Opacity * 100); options.Opacity = ((double)tbOpacity.Value) / 100.0; cbAlwaysShow.Checked = globals.EnableAlwaysShow; cbEnableMotionAlarm.Checked = globals.EnableMotionAlert; cbDetectorType.SelectedItem = globals.DetectorType; foreach (Control c in controls) { c.Enabled = false; } } else { //undo changes cbAlertSound.Checked = undoAlertSoundEnabled; cbRecord.Checked = undoRecordEnabled; tbRecordFolder.Text = undoRecordFolder; tbAudioFile.Text = undoAudioFile; tbOpacity.Value = undoOpacity; options.Opacity = ((double)tbOpacity.Value) / 100.0; cbCodec.SelectedItem = undoCodec; cbAlwaysShow.Checked = undoAlwaysShow; cbEnableMotionAlarm.Checked = undoEnableMotion; cbDetectorType.SelectedItem = undoDetectorType; foreach (Control c in controls) { c.Enabled = true; } } }
public VideoFeedOptions() { //defaults EnableAlertSound = false; EnableRecording = false; AlertSoundFile = null; RecordFolder = null; UseGlobal = true; Codec = null; EnableMotionAlert = true; EnableAlwaysShow = false; DetectorType = RearViewMirror.VideoSource.DetectorType.FastBlock; }
public GlobalVideoFeedOptions() { //defaults globalOpacity = 1; globalEnableAlertSound = false; globalEnableRecording = false; globalAlertSoundFile = null; globalRecordFolder = null; globalCodec = null; globalEnableMotionAlert = true; globalEnableAlwaysShow = false; globalDetectorType = RearViewMirror.VideoSource.DetectorType.FastBlock; }