Beispiel #1
0
        private static void UpdateLightColors(Color LogoColor, Color KeyboardMiddleColor, Color KeyboardOuterColor, Color StatusColor)
        {
            if (LogoColor == AlienwareFXManager.LastLogoColor && KeyboardMiddleColor == AlienwareFXManager.LastMidKeyColor && KeyboardOuterColor == AlienwareFXManager.LastOutKeyColor && StatusColor == AlienwareFXManager.LastOtherColor || (DateTime.Now - AlienwareFXManager.LastUpdateTime).TotalSeconds < 0.1)
            {
                return;
            }
            for (uint devIndex = 0; devIndex < AlienwareFXManager.numDevices; ++devIndex)
            {
                for (uint lightIndex = 0; lightIndex < AlienwareFXManager.deviceLightCounts[(int)devIndex]; ++lightIndex)
                {
                    LFX_ColorStruct lightCol = AlienwareFXManager.Col2LFXC(LogoColor);
                    string          lower    = AlienwareFXManager.deviceLightDescriptions[(int)devIndex][(int)lightIndex].ToLower();
                    if (lower.Contains("keyboard"))
                    {
                        lightCol = !lower.Contains("middle") ? AlienwareFXManager.Col2LFXC(KeyboardOuterColor) : AlienwareFXManager.Col2LFXC(KeyboardMiddleColor);
                    }
                    else if (lower.Contains("status"))
                    {
                        lightCol = AlienwareFXManager.Col2LFXC(StatusColor);
                    }
                    int num = (int)AlienwareFXManager.LightFX.LFX_SetLightColor(devIndex, lightIndex, ref lightCol);
                }
            }
            int num1 = (int)AlienwareFXManager.LightFX.LFX_Update();

            AlienwareFXManager.LastLogoColor   = LogoColor;
            AlienwareFXManager.LastMidKeyColor = KeyboardMiddleColor;
            AlienwareFXManager.LastOutKeyColor = KeyboardOuterColor;
            AlienwareFXManager.LastOtherColor  = StatusColor;
            AlienwareFXManager.LastUpdateTime  = DateTime.Now;
        }
Beispiel #2
0
        private static void CycleAllLights(Color from, Color to, float time)
        {
            if ((DateTime.Now - AlienwareFXManager.LastUpdateTime).TotalSeconds < 0.1)
            {
                return;
            }
            for (uint devIndex = 0; devIndex < AlienwareFXManager.numDevices; ++devIndex)
            {
                for (uint lightIndex = 0; lightIndex < AlienwareFXManager.deviceLightCounts[(int)devIndex]; ++lightIndex)
                {
                    float           amount   = (float)((Math.Sin((double)time / ((double)lightIndex / 2.0)) + 1.0) / 2.0);
                    LFX_ColorStruct lightCol = AlienwareFXManager.Col2LFXC(Color.Lerp(from, to, amount));
                    int             num      = (int)AlienwareFXManager.LightFX.LFX_SetLightColor(devIndex, lightIndex, ref lightCol);
                }
            }
            int num1 = (int)AlienwareFXManager.LightFX.LFX_Update();

            AlienwareFXManager.LastUpdateTime = DateTime.Now;
        }