private void PopulateStreamFormat() { lblColorSpace.Text = CameraLang.FormConfiguration_Properties_StreamFormat; // Get the intersection of camera and Kinovea supported formats. List <IDSEnum> streamFormats = IDSHelper.GetSupportedStreamFormats(camera, deviceId); // Get currently selected option. int currentColorMode = IDSHelper.ReadCurrentStreamFormat(camera); cmbFormat.Items.Clear(); foreach (IDSEnum streamFormat in streamFormats) { cmbFormat.Items.Add(streamFormat); if (streamFormat.Value == currentColorMode) { selectedStreamFormat = streamFormat; cmbFormat.SelectedIndex = cmbFormat.Items.Count - 1; } } // TODO: if the current camera format is not supported in Kinovea, force the camera to switch to a supported mode. // What if none of the Kinovea modes are supported by the camera ? }
private void cmbFormat_SelectedIndexChanged(object sender, EventArgs e) { IDSEnum selected = cmbFormat.SelectedItem as IDSEnum; if (selected == null || selectedStreamFormat.Value == selected.Value) { return; } selectedStreamFormat = selected; specificChanged = true; }