Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
 public static void changeToGreen()
 {
     uint num;
     LightFXController lightFXController = new LightFXController();
     LFX_Result lFXResult = lightFXController.LFX_Initialize();
     if (lFXResult == LFX_Result.LFX_Success)
     {
         lightFXController.LFX_Reset();
         Color red = Color.Red;
         LFX_ColorStruct lFXColor = Color.Aqua.ColorToLFXColor();
         LFX_ColorStruct lFXColorStruct = new LFX_ColorStruct(255, red.R, red.G, red.B);
         lightFXController.LFX_Light(LFX_Position.LFX_All, lFXColor);
         StringBuilder stringBuilder = new StringBuilder();
         lightFXController.LFX_GetVersion(out stringBuilder, 1000);
         lightFXController.LFX_Update();
         lightFXController.LFX_GetNumLights(0, out num);
         lightFXController.LFX_ActionColorEx(LFX_Position.LFX_All, LFX_ActionEnum.Pulse, Color.Red.ColorToLFXColor(), Color.White.ColorToLFXColor());
         lightFXController.LFX_Update();
         Thread.Sleep(1000);
         lightFXController.LFX_ActionColor(LFX_Position.LFX_All, LFX_ActionEnum.Pulse, Color.Violet.ColorToLFXColor());
         lightFXController.LFX_Update();
         Thread.Sleep(1000);
         lightFXController.LFX_Release();
     }
     else if (lFXResult == LFX_Result.LFX_Error_NoDevs)
     {
         Console.WriteLine("There is not AlienFX device available.");
     }
     else
     {
         Console.WriteLine("There was an error initializing the AlienFX device.");
     }
 }
Ejemplo n.º 3
0
 public LightDevice(uint deviceID, string name, LFX_Position position, LFX_ColorStruct lightColor)
 {
     _deviceID   = deviceID;
     _name       = name;
     _position   = position;
     _lightColor = lightColor;
     Console.WriteLine($"{Name} Attached with Lights Set to {LightColor} color Lights.");
 }
Ejemplo n.º 4
0
        public static void SetColor(Color themeColor)
        {
            if(lightFX == null)
                Initialize();

            var color = new LFX_ColorStruct(255, themeColor.R, themeColor.G, themeColor.B);
            lightFX.LFX_Light(LFX_Position.LFX_All, color);
            lightFX.LFX_Update();
        }
Ejemplo n.º 5
0
        public int resetZone(string deviceName)
        {
            LFX_ColorStruct color  = new LFX_ColorStruct(0, 0, 0, 0);
            uint            light  = idForDeviceName(deviceName);
            int             result = lfxController.LFX_SetLightColor(AFX_Device, light, color) == LFX_Result.LFX_Success ? 0 : 1;

            lfxController.LFX_Update();
            return(result);
        }
Ejemplo n.º 6
0
        private void fxMusicAnalyse(LightFXController lightFX)
        {
            var c1 = new LFX_ColorStruct(255, 0, 0, 0);

            if (comboBox1.SelectedItem != null)
            {
                Random rnd     = new Random();
                var    device  = (MMDevice)comboBox1.SelectedItem;
                var    varPuls = device.AudioMeterInformation.MasterPeakValue;

                int varRed   = (int)(varPuls * 10);
                int varGreen = (int)(varPuls * 7);
                int varBlue  = (int)(varPuls * 3);

                int intRed   = varRed * rnd.Next(varRed, 100);
                int intGreen = varGreen * rnd.Next(varGreen, 100);
                int intBlue  = varBlue * rnd.Next(varBlue, 100);

                byte red   = Convert.ToByte(intRed >= 255? 255 : intRed);
                byte green = Convert.ToByte(intGreen >= 255 ? 255 : intGreen);
                byte blue  = Convert.ToByte(intBlue >= 255 ? 255 : intBlue);

                //label1.Content = "R__" + intRed.ToString()+ "  G__"+ intGreen.ToString() + "  B__" + intBlue.ToString();

                c1 = new LFX_ColorStruct(255, red, green, blue);

                /*
                 * if (varPuls > 5)
                 *  c1 = new LFX_ColorStruct(255, 0, 0, 0);
                 * if (varPuls > 10)
                 *  c1 = new LFX_ColorStruct(255, 255, 233, 0);
                 * if (varPuls > 20)
                 *  c1 = new LFX_ColorStruct(255, 255, 255, 0);
                 * if (varPuls > 30)
                 *  c1 = new LFX_ColorStruct(255, 255, 0, 255);
                 * if (varPuls > 35)
                 *  c1 = new LFX_ColorStruct(255, 40, 255, 0);
                 * if (varPuls > 40)
                 *  c1 = new LFX_ColorStruct(255, 200, 200, 255);
                 * if (varPuls > 45)
                 *  c1 = new LFX_ColorStruct(255, 0, 0, 100);
                 * if (varPuls > 48)
                 *  c1 = new LFX_ColorStruct(255, 0, 255, 100);
                 * if (varPuls > 50)
                 *  c1 = new LFX_ColorStruct(255, 255, 0, 255);
                 * if (varPuls > 53)
                 *  c1 = new LFX_ColorStruct(255, 255, 233, 0);
                 * if (varPuls > 56)
                 *  c1 = new LFX_ColorStruct(255, 255, 255, 0);
                 * if (varPuls > 57)
                 *  c1 = new LFX_ColorStruct(255, 255, 0, 255);
                 * if (varPuls > 60)
                 *  c1 = new LFX_ColorStruct(255, 40, 255, 0);
                 */
                useLFXLights(lightFX, c1);
            }
        }
Ejemplo n.º 7
0
        public static int addDevice(string lightName, string ColorCSV)
        {
            string[]        components = ColorCSV.Split(',');
            LFX_ColorStruct color      = new LFX_ColorStruct(Convert.ToByte(components[0]), Convert.ToByte(components[1]), Convert.ToByte(components[2]), Convert.ToByte(components[3]));
            LightDevice     device     = Lights.getLightForName(lightName) as LightDevice;

            device.LightColor = color;
            lights.Add(device);
            return(0);
        }
Ejemplo n.º 8
0
        private static int Colorize(uint DeviceID, uint LightID, LFX_ColorStruct Color)
        {
            if (disable)
            {
                return(-1);
            }
            LFX_Result result = lightFXController.LFX_SetLightColor(DeviceID, LightID, Color);

            lightFXController.LFX_Update();
            return(result == LFX_Result.LFX_Success ? 0 : -1);
        }
Ejemplo n.º 9
0
        static void Main()
        {
            var lightFX = new LightFXController();

            var result = lightFX.LFX_Initialize();

            if (result == LFX_Result.LFX_Success)
            {
                lightFX.LFX_SetTiming(100);

                lightFX.LFX_Reset();
                var primaryColor = new LFX_ColorStruct(255, 0, 255, 0);
                lightFX.LFX_Light(LFX_Position.LFX_All, primaryColor);
                Console.WriteLine(string.Format("Setting all lights color: {0}", primaryColor));
                lightFX.LFX_Update();

                Thread.Sleep(5000);

                lightFX.LFX_Reset();
                var secondaryColor = new LFX_ColorStruct(255, 255, 0, 0);
                lightFX.LFX_ActionColor(LFX_Position.LFX_All, LFX_ActionEnum.Pulse, secondaryColor);
                Console.WriteLine(string.Format("Pulsing all lights in color: {0}", secondaryColor));
                lightFX.LFX_Update();

                Thread.Sleep(5000);

                lightFX.LFX_Reset();
                lightFX.LFX_ActionColorEx(LFX_Position.LFX_All, LFX_ActionEnum.Morph, primaryColor, secondaryColor);
                Console.WriteLine(string.Format("Morphing all lights from color {0} to {1}.", primaryColor, secondaryColor));
                lightFX.LFX_Update();

                Console.WriteLine("Done.\r\rPress ENTER key to finish ...");
                Console.ReadLine();
                lightFX.LFX_Release();
            }
            else
            {
                switch (result)
                {
                case LFX_Result.LFX_Error_NoDevs:
                    Console.WriteLine("There is not AlienFX device available.");
                    break;

                default:
                    Console.WriteLine("There was an error initializing the AlienFX device.");
                    break;
                }
            }
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            var result = lightFX.LFX_Initialize();
            if (result == LFX_Result.LFX_Success)
            {

                var server = new Server();

                lightFX.LFX_SetTiming(100);
                lightFX.LFX_Reset();

                var Green = new LFX_ColorStruct(255, 0, 255, 0);
                var Red = new LFX_ColorStruct(255, 255, 0, 0);

                System.Threading.Thread.Sleep(3000);

                while (!server.ClientConnected)
                {

                    lightFX.LFX_ActionColorEx(LFX_Position.LFX_All, LFX_ActionEnum.Morph, Green, Red);
                    //Console.WriteLine(string.Format("Morphing all lights from color {0} to {1}.", Green, Red));
                    lightFX.LFX_Update();

                    System.Threading.Thread.Sleep(FadeTime);

                    lightFX.LFX_ActionColorEx(LFX_Position.LFX_All, LFX_ActionEnum.Morph, Red, Green);
                    //Console.WriteLine(string.Format("Morphing all lights from color {0} to {1}.", Red, Green));
                    lightFX.LFX_Update();

                    lightFX.LFX_Light(LFX_Position.LFX_All, Green);
                    System.Threading.Thread.Sleep(FadeTime);
                    lightFX.LFX_Update();
                }

            }
            else
            {
                switch (result)
                {
                    case LFX_Result.LFX_Error_NoDevs:
                        Console.WriteLine("There is not AlienFX device available.");
                    default:
                        Console.WriteLine("There was an error initializing the AlienFX device.");
                        break;
                }
            }
        }
Ejemplo n.º 11
0
        public int setZoneToColor(string deviceName, bool randomColor)
        {
            LFX_ColorStruct color;

            if (!randomColor)
            {
                color = new LFX_ColorStruct(255, 255, 0, 0);
            }
            else
            {
                color = newRandomColor();
            }
            uint light  = idForDeviceName(deviceName);
            int  result = lfxController.LFX_SetLightColor(AFX_Device, light, color) == LFX_Result.LFX_Success ? 0:1;

            lfxController.LFX_Update();
            return(result);
        }
Ejemplo n.º 12
0
        private void setWinColor(LightFXController lightFX)
        {
            string colorStr = SystemParameters.WindowGlassBrush.ToString();

            colorStr = colorStr.Replace("#", string.Empty);
            var a = (byte)System.Convert.ToUInt32(colorStr.Substring(0, 2), 16);
            var r = (byte)System.Convert.ToUInt32(colorStr.Substring(2, 2), 16);
            var g = (byte)System.Convert.ToUInt32(colorStr.Substring(4, 2), 16);
            var b = (byte)System.Convert.ToUInt32(colorStr.Substring(6, 2), 16);

            var c1 = new LFX_ColorStruct(255, r, g, b);

            label1.Content = "A : " + a + " RED :" + r + " Green :" + g + " Blue :" + b + "    HEX :" + colorStr;
            Brush SpeedColor = new SolidColorBrush(Color.FromRgb(r, g, b));

            label1.Foreground = SpeedColor;
            useLFXLights(lightFX, c1);
        }
Ejemplo n.º 13
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;
        }
Ejemplo n.º 14
0
        static void Main()
        {
            var lightFX = new LightFXController();

            var result = lightFX.LFX_Initialize();

            if (result == LFX_Result.LFX_Success)
            {
                for (int i = 0; i <= 255; i++)
                {
                    var color = new LFX_ColorStruct(0xFF, (byte)(0xFF - i), (byte)i, 0x00);

                    lightFX.LFX_Reset();
                    lightFX.LFX_Light(LFX_Position.LFX_All, color);
                    Console.Clear();
                    Console.Write("Color:" + color);
                    lightFX.LFX_Update();

                    Thread.Sleep(150);
                }

                Console.WriteLine();
                Console.WriteLine("Done.\r\rPress ENTER key to finish ...");
                Console.ReadLine();
                lightFX.LFX_Release();
            }
            else
            {
                switch (result)
                {
                case LFX_Result.LFX_Error_NoDevs:
                    Console.WriteLine("There is not AlienFX device available.");
                    break;

                default:
                    Console.WriteLine("There was an error initializing the AlienFX device.");
                    break;
                }
            }
        }
Ejemplo n.º 15
0
        static void Main()
        {
            var lightFX = new LightFXController();

            var result = lightFX.LFX_Initialize();

            if (result == LFX_Result.LFX_Success)
            {
                lightFX.LFX_Reset();

                uint numDevs;
                lightFX.LFX_GetNumDevices(out numDevs);

                for (uint devIndex = 0; devIndex < numDevs; devIndex++)
                {
                    uint numLights;
                    lightFX.LFX_GetNumLights(devIndex, out numLights);

                    var green = new LFX_ColorStruct(255, 0, 255, 0);
                    var red   = new LFX_ColorStruct(255, 255, 0, 0);
                    for (uint lightIndex = 0; lightIndex < numLights; lightIndex++)
                    {
                        if (lightIndex % 2 == 0)
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, red);
                        }
                        else
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, green);
                        }
                    }
                }


                for (uint devIndex = 0; devIndex < numDevs; devIndex++)
                {
                    StringBuilder  devDescription;
                    LFX_DeviceType type;

                    result = lightFX.LFX_GetDeviceDescription(devIndex, out devDescription, 255, out type);
                    if (result != LFX_Result.LFX_Success)
                    {
                        continue;
                    }

                    Console.WriteLine(string.Format("Device: {0} \tDescription: {1} \tType: {2}", devIndex, devDescription, type));

                    uint numLights;
                    lightFX.LFX_GetNumLights(devIndex, out numLights);
                    for (uint lightIndex = 0; lightIndex < numLights; lightIndex++)
                    {
                        StringBuilder description;
                        result = lightFX.LFX_GetLightDescription(devIndex, lightIndex, out description, 255);
                        if (result != LFX_Result.LFX_Success)
                        {
                            continue;
                        }

                        LFX_ColorStruct color;
                        result = lightFX.LFX_GetLightColor(devIndex, lightIndex, out color);
                        if (result != LFX_Result.LFX_Success)
                        {
                            continue;
                        }

                        Console.WriteLine(string.Format("\tLight: {0} \tDescription: {1} \tColor: {2}", lightIndex, description, color));
                    }
                }

                lightFX.LFX_Update();
                Console.WriteLine("Done.\r\rPress ENTER key to finish ...");
                Console.ReadLine();
                lightFX.LFX_Release();
            }
            else
            {
                switch (result)
                {
                case LFX_Result.LFX_Error_NoDevs:
                    Console.WriteLine("There is not AlienFX device available.");
                    break;

                default:
                    Console.WriteLine("There was an error initializing the AlienFX device.");
                    break;
                }
            }
        }
Ejemplo n.º 16
0
        private void ColorTrigger(double val)
        {
            if (result == LFX_Result.LFX_Success)
            {
                lightFX.LFX_Reset();

                uint numDevs;
                lightFX.LFX_GetNumDevices(out numDevs);

                //  txtConsole.Text = "";

                for (uint devIndex = 0; devIndex < numDevs; devIndex++)
                {
                    uint numLights;
                    lightFX.LFX_GetNumLights(devIndex, out numLights);

                    var green  = new LFX_ColorStruct(255, 255, 255, 0);
                    var red    = new LFX_ColorStruct(255, 255, 0, 0);
                    var blue   = new LFX_ColorStruct(255, 0, 255, 255);
                    var yellow = new LFX_ColorStruct(255, 0, 0, 255);
                    var alter  = new LFX_ColorStruct(255, 255, 0, 255);
                    var alter2 = new LFX_ColorStruct(255, 0, 255, 0);


                    for (uint lightIndex = 0; lightIndex < numLights; lightIndex++)
                    {
                        if (val < 5)
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, yellow);
                        }
                        else if (val > 5 && val < 10)
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, blue);
                        }
                        else if (val > 10 && val < 15)
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, green);
                        }
                        else if (val > 15 && val < 20)
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, red);
                        }
                        else if (val > 20 && val < 25)
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, alter2);
                        }
                        else if (val > 25 && val < 30)
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, alter);
                        }
                        else if (val > 30 && val < 35)
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, yellow);
                        }
                        else if (val > 35 && val < 40)
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, blue);
                        }
                        else if (val > 40 && val < 45)
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, green);
                        }
                        else if (val > 50)
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, red);
                        }
                        else
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, alter2);
                        }
                        //if (ddLights.SelectedIndex == 0)
                        //{
                        //    lightFX.LFX_SetLightColor(devIndex, lightIndex, lightIndex % 2 == 0 ? red : green);
                        //    //txtConsole.Text += "\nDev Index :" + devIndex.ToString() + "; LightIndex :" + lightIndex.ToString();
                        //}
                        //else if (Convert.ToInt32(ddLights.SelectedValue) == lightIndex)
                        //{
                        //    lightFX.LFX_SetLightColor(devIndex, lightIndex, lightIndex % 2 == 0 ? red : green);
                        //    //txtConsole.Text += "\nDev Index :" + devIndex.ToString() + "; LightIndex :" + lightIndex.ToString();
                        //}
                    }
                }


                for (uint devIndex = 0; devIndex < numDevs; devIndex++)
                {
                    StringBuilder  devDescription;
                    LFX_DeviceType type;

                    result = lightFX.LFX_GetDeviceDescription(devIndex, out devDescription, 255, out type);
                    if (result != LFX_Result.LFX_Success)
                    {
                        continue;
                    }

                    Console.WriteLine(string.Format("Device: {0} \tDescription: {1} \tType: {2}", devIndex, devDescription, type));

                    uint numLights;
                    lightFX.LFX_GetNumLights(devIndex, out numLights);
                    for (uint lightIndex = 0; lightIndex < numLights; lightIndex++)
                    {
                        StringBuilder description;
                        result = lightFX.LFX_GetLightDescription(devIndex, lightIndex, out description, 255);
                        if (result != LFX_Result.LFX_Success)
                        {
                            continue;
                        }

                        LFX_ColorStruct color;
                        result = lightFX.LFX_GetLightColor(devIndex, lightIndex, out color);
                        if (result != LFX_Result.LFX_Success)
                        {
                            continue;
                        }

                        //       Console.WriteLine(string.Format("\tLight: {0} \tDescription: {1} \tColor: {2}", lightIndex, description, color));
                    }
                }

                lightFX.LFX_Update();
                // Console.WriteLine("Done.\r\rPress ENTER key to finish ...");
                // Console.ReadLine();
                //lightFX.LFX_Release();
            }
            else
            {
                switch (result)
                {
                case LFX_Result.LFX_Error_NoDevs:
                    // Console.WriteLine("There is not AlienFX device available.");
                    break;

                default:
                    // Console.WriteLine("There was an error initializing the AlienFX device.");
                    break;
                }
            }
        }
Ejemplo n.º 17
0
 public static LFX_ColorStruct ColorToLFXColor(this Color color)
 {
     LFX_ColorStruct lFXColorStruct = new LFX_ColorStruct(255, color.R, color.G, color.B);
     return lFXColorStruct;
 }
Ejemplo n.º 18
0
 private static void useLFXLights(LightFXController lightFX, LFX_ColorStruct color)
 {
     lightFX.LFX_Light(LFX_Position.LFX_All, color);
     lightFX.LFX_Update();
 }
Ejemplo n.º 19
0
        private void btnTest_Click(object sender, RoutedEventArgs e)
        {
            var lightFX = new LightFXController();

            var result = lightFX.LFX_Initialize();

            if (result == LFX_Result.LFX_Success)
            {
                lightFX.LFX_Reset();

                uint numDevs;
                lightFX.LFX_GetNumDevices(out numDevs);

                txtConsole.Text = "";

                for (uint devIndex = 0; devIndex < numDevs; devIndex++)
                {
                    uint numLights;
                    lightFX.LFX_GetNumLights(devIndex, out numLights);

                    var green = new LFX_ColorStruct(255, Convert.ToByte(txtRed.Text), Convert.ToByte(txtGreen.Text), 0);
                    var red   = new LFX_ColorStruct(255, Convert.ToByte(txtRed.Text), Convert.ToByte(txtGreen.Text), 0);
                    for (uint lightIndex = 0; lightIndex < numLights; lightIndex++)
                    {
                        if (ddLights.SelectedIndex == 0)
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, lightIndex % 2 == 0 ? red : green);
                            //txtConsole.Text += "\nDev Index :" + devIndex.ToString() + "; LightIndex :" + lightIndex.ToString();
                        }
                        else if (Convert.ToInt32(ddLights.SelectedValue) == lightIndex)
                        {
                            lightFX.LFX_SetLightColor(devIndex, lightIndex, lightIndex % 2 == 0 ? red : green);
                            //txtConsole.Text += "\nDev Index :" + devIndex.ToString() + "; LightIndex :" + lightIndex.ToString();
                        }
                    }
                }


                for (uint devIndex = 0; devIndex < numDevs; devIndex++)
                {
                    StringBuilder  devDescription;
                    LFX_DeviceType type;

                    result = lightFX.LFX_GetDeviceDescription(devIndex, out devDescription, 255, out type);
                    if (result != LFX_Result.LFX_Success)
                    {
                        continue;
                    }

                    Console.WriteLine(string.Format("Device: {0} \tDescription: {1} \tType: {2}", devIndex, devDescription, type));

                    uint numLights;
                    lightFX.LFX_GetNumLights(devIndex, out numLights);
                    for (uint lightIndex = 0; lightIndex < numLights; lightIndex++)
                    {
                        StringBuilder description;
                        result = lightFX.LFX_GetLightDescription(devIndex, lightIndex, out description, 255);
                        if (result != LFX_Result.LFX_Success)
                        {
                            continue;
                        }

                        LFX_ColorStruct color;
                        result = lightFX.LFX_GetLightColor(devIndex, lightIndex, out color);
                        if (result != LFX_Result.LFX_Success)
                        {
                            continue;
                        }

                        //       Console.WriteLine(string.Format("\tLight: {0} \tDescription: {1} \tColor: {2}", lightIndex, description, color));
                    }
                }

                lightFX.LFX_Update();
                // Console.WriteLine("Done.\r\rPress ENTER key to finish ...");
                // Console.ReadLine();
                lightFX.LFX_Release();
            }
            else
            {
                switch (result)
                {
                case LFX_Result.LFX_Error_NoDevs:
                    // Console.WriteLine("There is not AlienFX device available.");
                    break;

                default:
                    // Console.WriteLine("There was an error initializing the AlienFX device.");
                    break;
                }
            }
        }
Ejemplo n.º 20
0
 public void ChangeLights(LFX_ColorStruct color)
 {
     throw new NotImplementedException();
 }