コード例 #1
0
        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;
                }
            }
        }
コード例 #2
0
 public VideoFeedOptions()
 {
     //defaults
     EnableAlertSound  = false;
     EnableRecording   = false;
     AlertSoundFile    = null;
     RecordFolder      = null;
     UseGlobal         = true;
     Codec             = null;
     EnableMotionAlert = true;
     EnableAlwaysShow  = false;
     DetectorType      = RearViewMirror.VideoSource.DetectorType.FastBlock;
 }
コード例 #3
0
ファイル: OptionsForm.cs プロジェクト: Anupam-/RearViewMirror
        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; }
            }
        }
コード例 #4
0
ファイル: Options.cs プロジェクト: Anupam-/RearViewMirror
 public GlobalVideoFeedOptions()
 {
     //defaults
     globalOpacity = 1;
     globalEnableAlertSound = false;
     globalEnableRecording = false;
     globalAlertSoundFile = null;
     globalRecordFolder = null;
     globalCodec = null;
     globalEnableMotionAlert = true;
     globalEnableAlwaysShow = false;
     globalDetectorType = RearViewMirror.VideoSource.DetectorType.FastBlock;
 }