private void Form1_Load(object sender, RoutedEventArgs e) { Title += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")"; foreach (var codec in VideoCapture1.Audio_Codecs) { cbAudioCodecs.Items.Add(codec); } if (cbAudioCodecs.Items.Count > 0) { cbAudioCodecs.SelectedIndex = 0; cbAudioCodecs_SelectedIndexChanged(null, null); } foreach (var device in VideoCapture1.Audio_CaptureDevicesInfo) { cbAudioInputDevice.Items.Add(device.Name); } if (cbAudioInputDevice.Items.Count > 0) { cbAudioInputDevice.SelectedIndex = 0; cbAudioInputDevice_SelectedIndexChanged(null, null); } cbAudioInputLine.Items.Clear(); if (!string.IsNullOrEmpty(cbAudioInputDevice.Text)) { var deviceItem = VideoCapture1.Audio_CaptureDevicesInfo.First(device => device.Name == cbAudioInputDevice.Text); if (deviceItem != null) { foreach (var line in deviceItem.Lines) { cbAudioInputLine.Items.Add(line); } if (cbAudioInputLine.Items.Count > 0) { cbAudioInputLine.SelectedIndex = 0; cbAudioInputLine_SelectedIndexChanged(null, null); cbAudioInputFormat_SelectedIndexChanged(null, null); } } } foreach (var audioOutputDevice in VideoCapture1.Audio_OutputDevices) { cbAudioOutputDevice.Items.Add(audioOutputDevice); } if (cbAudioOutputDevice.Items.Count > 0) { cbAudioOutputDevice.SelectedIndex = 0; } if (cbAudioCodecs.Items.IndexOf("PCM") != -1) { cbAudioCodecs.SelectedIndex = cbAudioCodecs.Items.IndexOf("PCM"); } cbAudioCodecs_SelectedIndexChanged(null, null); foreach (var preset in VideoCapture1.Audio_Effects_Equalizer_Presets()) { cbAudEqualizerPreset.Items.Add(preset); } cbOutputFormat.SelectedIndex = 0; cbChannels.SelectedIndex = 0; cbSampleRate.SelectedIndex = 0; cbBPS.SelectedIndex = 0; cbLameCBRBitrate.SelectedIndex = 0; cbLameVBRMax.SelectedIndex = 0; cbLameVBRMin.SelectedIndex = 0; cbLameSampleRate.SelectedIndex = 0; cbAudEqualizerPreset.SelectedIndex = 0; cbAudEqualizerPreset_SelectedIndexChanged(null, null); edOutput.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.wav"; }
private void Form1_Load(object sender, EventArgs e) { Text += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")"; tmRecording.Elapsed += (senderx, args) => { UpdateRecordingTime(); }; cbOutputFormat.SelectedIndex = 7; foreach (var device in VideoCapture1.Video_CaptureDevicesInfo) { cbVideoInputDevice.Items.Add(device.Name); } if (cbVideoInputDevice.Items.Count > 0) { cbVideoInputDevice.SelectedIndex = 0; } cbVideoInputDevice_SelectedIndexChanged(null, null); foreach (var device in VideoCapture1.Audio_CaptureDevicesInfo) { cbAudioInputDevice.Items.Add(device.Name); } if (cbAudioInputDevice.Items.Count > 0) { cbAudioInputDevice.SelectedIndex = 0; cbAudioInputDevice_SelectedIndexChanged(null, null); } cbAudioInputLine.Items.Clear(); if (!string.IsNullOrEmpty(cbAudioInputDevice.Text)) { var deviceItem = VideoCapture1.Audio_CaptureDevicesInfo.First(device => device.Name == cbAudioInputDevice.Text); if (deviceItem != null) { foreach (string line in deviceItem.Lines) { cbAudioInputLine.Items.Add(line); } if (cbAudioInputLine.Items.Count > 0) { cbAudioInputLine.SelectedIndex = 0; cbAudioInputLine_SelectedIndexChanged(null, null); cbAudioInputFormat_SelectedIndexChanged(null, null); } } } string defaultAudioRenderer = string.Empty; foreach (string audioOutputDevice in VideoCapture1.Audio_OutputDevices) { cbAudioOutputDevice.Items.Add(audioOutputDevice); if (audioOutputDevice.Contains("Default DirectSound Device")) { defaultAudioRenderer = audioOutputDevice; } } if (cbAudioOutputDevice.Items.Count > 0) { if (string.IsNullOrEmpty(defaultAudioRenderer)) { cbAudioOutputDevice.SelectedIndex = 0; } else { cbAudioOutputDevice.Text = defaultAudioRenderer; } } foreach (string preset in VideoCapture1.Audio_Effects_Equalizer_Presets()) { cbAudEqualizerPreset.Items.Add(preset); } edOutput.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.mp4"; if (VideoCapture.Filter_Supported_EVR()) { VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR; } else if (VideoCapture.Filter_Supported_VMR9()) { VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VMR9; } else { VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VideoRenderer; } }
private void Form1_Load(object sender, EventArgs e) { Text += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")"; foreach (string codec in VideoCapture1.Video_Codecs) { cbVideoCodecs.Items.Add(codec); } if (cbVideoCodecs.Items.Count > 0) { cbVideoCodecs.SelectedIndex = 0; cbVideoCodecs_SelectedIndexChanged(null, null); } foreach (string codec in VideoCapture1.Audio_Codecs) { cbAudioCodecs.Items.Add(codec); } if (cbAudioCodecs.Items.Count > 0) { cbAudioCodecs.SelectedIndex = 0; cbAudioCodecs_SelectedIndexChanged(null, null); } if (cbVideoCodecs.Items.IndexOf("MJPEG Compressor") != -1) { cbVideoCodecs.SelectedIndex = cbVideoCodecs.Items.IndexOf("MJPEG Compressor"); } if (cbAudioCodecs.Items.IndexOf("PCM") != -1) { cbAudioCodecs.SelectedIndex = cbAudioCodecs.Items.IndexOf("PCM"); } foreach (string profile in VideoCapture1.WMV_Internal_Profiles()) { cbWMVInternalProfile9.Items.Add(profile); } if (cbWMVInternalProfile9.Items.Count > 0) { cbWMVInternalProfile9.SelectedIndex = 0; } foreach (var device in VideoCapture1.Video_CaptureDevicesInfo) { cbVideoInputDevice.Items.Add(device.Name); } if (cbVideoInputDevice.Items.Count > 0) { cbVideoInputDevice.SelectedIndex = 0; } cbVideoInputDevice_SelectedIndexChanged(null, null); foreach (var device in VideoCapture1.Audio_CaptureDevicesInfo) { cbAudioInputDevice.Items.Add(device.Name); } if (cbAudioInputDevice.Items.Count > 0) { cbAudioInputDevice.SelectedIndex = 0; cbAudioInputDevice_SelectedIndexChanged(null, null); } cbAudioInputLine.Items.Clear(); if (!string.IsNullOrEmpty(cbAudioInputDevice.Text)) { var deviceItem = VideoCapture1.Audio_CaptureDevicesInfo.First(device => device.Name == cbAudioInputDevice.Text); if (deviceItem != null) { foreach (string line in deviceItem.Lines) { cbAudioInputLine.Items.Add(line); } if (cbAudioInputLine.Items.Count > 0) { cbAudioInputLine.SelectedIndex = 0; cbAudioInputLine_SelectedIndexChanged(null, null); cbAudioInputFormat_SelectedIndexChanged(null, null); } } } foreach (string audioOutputDevice in VideoCapture1.Audio_OutputDevices) { cbAudioOutputDevice.Items.Add(audioOutputDevice); } if (cbAudioOutputDevice.Items.Count > 0) { cbAudioOutputDevice.SelectedIndex = 0; } foreach (string preset in VideoCapture1.Audio_Effects_Equalizer_Presets()) { cbAudEqualizerPreset.Items.Add(preset); } cbChannels.SelectedIndex = 1; cbBPS.SelectedIndex = 1; cbSampleRate.SelectedIndex = 0; cbImageType.SelectedIndex = 1; cbMode.SelectedIndex = 0; edScreenshotsFolder.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VisioForge\"; edOutput.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.avi"; if (VideoCapture.Filter_Supported_EVR()) { VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR; } else if (VideoCapture.Filter_Supported_VMR9()) { VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VMR9; } else { VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VideoRenderer; } }