private void NavigateToRandomType(int index) { switch (index) { case 0: ColorGradientFrame.Visibility = Visibility.Visible; ColorGradientFrame.Navigate(typeof(ColorGradientTwo)); break; case 1: ColorGradientFrame.Visibility = Visibility.Visible; ColorGradientFrame.Navigate(typeof(ColorGradientThree)); break; case 2: PartyOptions.activePartyOption.changeColorCompletelyRandom = true; ColorGradientFrame.Visibility = Visibility.Collapsed; break; } if (ColorGradientFrame.Visibility == Visibility.Visible) { PartyOptions.activePartyOption.changeColorCompletelyRandom = false; colorGradient = Convert.ChangeType(ColorGradientFrame.Content, ColorGradientFrame.CurrentSourcePageType); LightProcessingColor lightProcessingColor = new LightProcessingColor(); colorGradient.GiveVariables <PartyControl, LightProcessingColor>(partyControl, lightProcessingColor, PartyOptions.GetColorGradientInformation()); } }
private static void UpdateLights() { int?newBrightness = null; ColorInformation colorInformation = new ColorInformation(); switch (PartyOptions.activePartyOption.brightnessOptionIndex) { case 1: newBrightness = SetRandomBrightness(); break; } switch (PartyOptions.activePartyOption.colorOptionIndex) { case 2: colorInformation = LightProcessingColor.SetRandomColorFromUIInput(); break; } if (BridgeInformation.usedLights.Count > 0) { BasicLightController.SendCommonCommond(); } if (newBrightness != null || colorInformation.rgbColor != null || colorInformation.colorTemperature != null) { PartyUIUpdater.UpdateOutputDisplay(newBrightness, colorInformation.rgbColor, colorInformation.colorTemperature); } }
private static ColorInformation ProcessInputDifferenceColor(double soundLevel) { ColorInformation colorInformation = new ColorInformation(); double inputDifference = soundLevel - savedSoundLevel; if (inputDifference > PartyOptions.activePartyOption.colorDifferencePercent) { colorInformation = LightProcessingColor.SetRandomColorFromUIInput(); } PartyUIUpdater.NewInputDifference(inputDifference); savedSoundLevel = soundLevel; return(colorInformation); }
private void NavigateToColorGradient(int index) { switch (index) { case 0: ColorGradientFrame.Navigate(typeof(ColorGradientTwo)); break; case 1: ColorGradientFrame.Navigate(typeof(ColorGradientThree)); break; } colorGradient = Convert.ChangeType(ColorGradientFrame.Content, ColorGradientFrame.CurrentSourcePageType); LightProcessingColor lightProcessingColor = new LightProcessingColor(); colorGradient.GiveVariables <PartyControl, LightProcessingColor>(partyControl, lightProcessingColor, PartyOptions.GetColorGradientInformation()); }
public static void NewSoundLevel(double soundLevel) { if (callCount > 8) { int?newBrightness = null; ColorInformation colorInformation = new ColorInformation(); switch (PartyOptions.activePartyOption.brightnessOptionIndex) { case 0: newBrightness = ProcessSoundLevelBrightness(soundLevel); break; } switch (PartyOptions.activePartyOption.colorOptionIndex) { case 0: colorInformation = LightProcessingColor.SetColorGradienStep((float)soundLevel / 100f); break; case 1: colorInformation = ProcessInputDifferenceColor(soundLevel); break; } if (BridgeInformation.usedLights.Count > 0) { BasicLightController.SendCommonCommond(); } if (newBrightness != null || colorInformation.rgbColor != null || colorInformation.colorTemperature != null) { PartyUIUpdater.UpdateOutputDisplay(newBrightness, colorInformation.rgbColor, colorInformation.colorTemperature); } callCount = 0; } callCount++; }