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."); } }
public static void Release() { if (lightFX != null) { lightFX.LFX_Release(); lightFX = null; } }
private static void Initialize() { lightFX = new LightFXController(); var result = lightFX.LFX_Initialize(); if (result == LFX_Result.LFX_Success) { lightFX.LFX_Reset(); lightFX.LFX_GetNumDevices(out numDevs); } }
public Wardevil() { try { this._lightFX = new LightFXController(); LFX_Result lFXResult = this._lightFX.LFX_Initialize(); if (lFXResult != LFX_Result.LFX_Success) { if (lFXResult == LFX_Result.LFX_Error_NoDevs) { throw new Exception("There is not AlienFX device available."); } throw new Exception("There was an error initializing the AlienFX device."); } this._lightFX.LFX_Reset(); } catch (Exception exception) { Trace.WriteLine(exception.ToString()); } }