private async void initHeadset() { HeadSetCoolingModes coolingMode = GetCoolingLevelFromRegistry(); Color staticColor = GetColorRegistry(); staticColorPanel.BackColor = staticColor; CoolingBar.Value = (int)coolingMode; await setCooling(coolingMode); HeadsetLightingEnum lightMode = GetLightModeRegistry(); colorModeBox.SelectedIndex = (int)lightMode; ResultCodes result = AccessoryHeadsetDriverHelper.InitializeDriverWithGuid(currentHeadset, new Guid("{947D0033-02A6-48FB-AD23-47407B97D158}")); checkErrors(result); updateVolumes(); surroundCheckBox.Checked = getSpeakerFeature(SpeakerFeatures.Surround); surroundMaxCheckBox.Checked = getSpeakerFeature(SpeakerFeatures.SurroundMax); dynamicBassCheckBox.Checked = getSpeakerFeature(SpeakerFeatures.DynamicBass); encCheckBox.Checked = getMicFeature(MicrophoneFeatures.EnvironmentalNoiseCancellation); encCheckBox.Visible = currentHeadset == OMENHeadsets.MindframePrime; AccessoryHeadsetDriverHelper.RegisterAudioVolumeCallBack(currentHeadset, new OMENAudioVolumeCallback(this.AudioLevelCallBack)); this.Text = "HP Omen Mindframe Control - " + (currentHeadset == OMENHeadsets.MindframePrime ? "OMEN Prime" : "OMEN"); }
private async void colorLengthBox_ValueChanged(object sender, EventArgs e) { HeadsetLightingEnum mode = (HeadsetLightingEnum)colorModeBox.SelectedIndex; if (mode == HeadsetLightingEnum.ColorShift) { await setBlinkingAnimation(GetColorListRegistry("BlinkingColors")); } }
private async void btnColorList_Click(object sender, EventArgs e) { HeadsetLightingEnum mode = (HeadsetLightingEnum)colorModeBox.SelectedIndex; if (mode == HeadsetLightingEnum.ColorShift) { ColorList list = new ColorList(GetColorListRegistry("BlinkingColors")); DialogResult result = list.ShowDialog(); if (result == DialogResult.OK) { await setBlinkingAnimation(list.colors); } } }
private async void btnStaticColor_Click(object sender, EventArgs e) { HeadsetLightingEnum mode = (HeadsetLightingEnum)colorModeBox.SelectedIndex; if (mode == HeadsetLightingEnum.Static) { ColorPicker picker = new ColorPicker(this, staticColorPanel.BackColor); DialogResult result = picker.ShowDialog(); // reset to original color if cancel hit if (result == DialogResult.Cancel) { if (picker.color != null) { await setStaticColor(picker.color); } } } }
private async void colorModeBox_SelectedIndexChanged(object sender, EventArgs e) { HeadsetLightingEnum mode = (HeadsetLightingEnum)colorModeBox.SelectedIndex; SetLightModeRegistry(mode); switch (mode) { case HeadsetLightingEnum.ColorShift: btnStaticColor.Enabled = false; btnColorList.Enabled = true; colorLengthBox.Enabled = true; await setBlinkingAnimation(GetColorListRegistry("BlinkingColors")); break; case HeadsetLightingEnum.Audio: btnStaticColor.Enabled = false; btnColorList.Enabled = false; colorLengthBox.Enabled = false; await setAudioAnimation(); break; case HeadsetLightingEnum.Static: btnStaticColor.Enabled = true; btnColorList.Enabled = false; colorLengthBox.Enabled = false; await setStaticColor(GetColorRegistry()); break; case HeadsetLightingEnum.OFF: btnStaticColor.Enabled = false; btnColorList.Enabled = false; colorLengthBox.Enabled = false; HeadSetErrorCode error = await AccessoryHeadSetHelper.SetHeadsetStaticColorAsync(hidIndex, toHeadSetColor(Color.Black)); if (checkErrors(error)) { staticColorPanel.BackColor = Color.Black; } break; } }
public void SetLightModeRegistry(HeadsetLightingEnum mode) { Registry.CurrentUser.CreateSubKey(REGISTRY_PATH).SetValue("LightMode", (int)mode, RegistryValueKind.DWord); }