public static CodecOption[] getAvailableCodecs() { FilterInfoCollection codecs = new FilterInfoCollection(FilterCategory.VideoCompressorCategory); CodecOption[] retval = new CodecOption[codecs.Count + 1]; retval[0] = new CodecOption() { Name = "Raw\\Uncompressed", Moniker = "DIB " }; Log.info("Installed Codecs"); for (int i = 0; i < codecs.Count; i++) { Log.info(String.Format("Name: {0}\n\tMoniker:{1}", codecs[i].Name, codecs[i].MonikerString)); retval[i + 1] = new CodecOption() { Name = codecs[i].Name, Moniker = codecs[i].MonikerString }; } return(retval); }
public GlobalVideoFeedOptions() { //defaults globalOpacity = 1; globalEnableAlertSound = false; globalEnableRecording = false; globalAlertSoundFile = null; globalRecordFolder = null; globalCodec = null; globalEnableMotionAlert = true; globalEnableAlwaysShow = false; globalDetectorType = RearViewMirror.VideoSource.DetectorType.FastBlock; }
public static CodecOption[] getAvailableCodecs() { FilterInfoCollection codecs = new FilterInfoCollection(FilterCategory.VideoCompressorCategory); CodecOption[] retval = new CodecOption[codecs.Count+1]; retval[0] = new CodecOption() { Name = "Raw\\Uncompressed", Moniker = "DIB " }; Log.info("Installed Codecs"); for(int i=0; i < codecs.Count; i++){ Log.info(String.Format("Name: {0}\n\tMoniker:{1}", codecs[i].Name, codecs[i].MonikerString)); retval[i+1] = new CodecOption() { Name = codecs[i].Name, Moniker = codecs[i].MonikerString }; } return retval; }
public OptionsForm(AbstractFeedOptions options) { InitializeComponent(); this.options = options; Log.debug(String.Format("Current Options {0}", options)); //prevent manual input cbDetectorType.DropDownStyle = ComboBoxStyle.DropDownList; lCameraName.Text = options.Name; tbOpacity.Minimum = 0; tbOpacity.Maximum = 100; //undos motionUndoRecord = options.EnableRecording; motionUndoAlertsound = options.EnableAlertSound; //pull values from options cbAlwaysShow.Checked = options.EnableAlwaysShow; cbRecord.Checked = options.EnableRecording; tbRecordFolder.Text = options.RecordFolder; cbAlertSound.Checked = options.EnableAlertSound; tbAudioFile.Text = options.AlertSoundFile; cbEnableMotionAlarm.Checked = options.EnableMotionAlert; flopFileSelectionBoxes(); flopAlerts(); tbOpacity.Value = (int)(options.Opacity * 100); //Global Check if (options is GlobalVideoFeedOptions) { cbGlobalOptions.Visible = false; } else { cbGlobalOptions.Checked = options.UseGlobal; initialUseGlobal = options.UseGlobal; //for cancel } //for cancel initialOpacity = options.Opacity; this.MaximumSize = this.Size; //prevent resizin' this.MinimumSize = this.Size; this.MaximizeBox = false; //motion detector types cbDetectorType.DataSource = Enum.GetValues(typeof(VideoSource.DetectorType)); cbDetectorType.FormattingEnabled = true; cbDetectorType.Format += delegate(object sender, ListControlConvertEventArgs e) { if (((VideoSource.DetectorType)e.Value) == VideoSource.DetectorType.FastBlock) { e.Value = "Block (Optimized)"; } else { e.Value = e.Value; } }; cbDetectorType.SelectedItem = options.DetectorType; //prevents window disposal this.FormClosing += new FormClosingEventHandler(OptionsForm_FormClosing); //Log cbCodec.Items.AddRange(CodecOption.getAvailableCodecs()); cbCodec.SelectedItem = options.Codec; Log.debug("Selected Codec: " + options.Codec); }