Ejemplo n.º 1
0
 public override void Shutdown()
 {
     CUESDK.SetLayerPriority(0);
     deviceInfos.Clear();
     CUESDK.ReleaseControl();
     IsInitialized = false;
 }
Ejemplo n.º 2
0
        public override bool Initialize()
        {
            CUESDK.PerformProtocolHandshake();
            var error = CUESDK.GetLastError();

            if (error != CorsairError.Success)
            {
                LogError("Error: " + error);
                return(IsInitialized = false);
            }

            for (int i = 0; i < CUESDK.GetDeviceCount(); i++)
            {
                deviceInfos.Add(CUESDK.GetDeviceInfo(i));
            }

            if (Global.Configuration.VarRegistry.GetVariable <bool>($"{DeviceName}_exclusive") && !CUESDK.RequestControl())
            {
                LogError("Error requesting cuesdk exclusive control:" + CUESDK.GetLastError());
            }
            CUESDK.SetLayerPriority(255);

            return(IsInitialized = true);
        }