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);
            }
        }
Exemplo n.º 2
0
        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++;
        }