コード例 #1
0
        public static bool FlashLighting(LedSdk sdk, int red, int green, int blue, int duration, int interval)
        {
            bool set = false;

            CheckRgbValues(red, green, blue);

            if (sdk == LedSdk.Logitech)
            {
                set = LogitechGSDK.LogiLedFlashLighting(red, green, blue, duration, interval);
            }

            else if (sdk == LedSdk.Corsair)
            {
                CueSDK.HeadsetSDK.Brush.Effects.Clear();
                byte[]          rgb = ConvertPercentagesToRgbValues(red, green, blue);
                SolidColorBrush b   = new SolidColorBrush(new CorsairColor(rgb[0], rgb[1], rgb[2]));
                b.AddEffect(new FlashEffect()
                {
                    Attack      = 0f,
                    Sustain     = (float)interval / 2f,
                    Release     = 0f,
                    Interval    = (float)interval / 2f,
                    Repetitions = duration / interval
                });
                CueSDK.HeadsetSDK.Brush = b;
                b.UpdateEffects();
                set = true;
            }
            if (set)
            {
                Debug.WriteLine($"Lights flashing {red}, {green}, {blue} for {sdk}!");
            }
            return(set);
        }
コード例 #2
0
        public static bool SetLighting(LedSdk sdk, int red, int green, int blue)
        {
            bool set = false;

            CheckRgbValues(red, green, blue);

            if (sdk == LedSdk.Logitech)
            {
                LogitechGSDK.LogiLedStopEffects();
                set = LogitechGSDK.LogiLedSetLighting(red, green, blue);
            }

            else if (sdk == LedSdk.Corsair)
            {
                CueSDK.HeadsetSDK.Brush.Effects.Clear();
                byte[] rgb = ConvertPercentagesToRgbValues(red, green, blue);
                CueSDK.HeadsetSDK.Brush = new SolidColorBrush(new CorsairColor(rgb[0], rgb[1], rgb[2]));
                set = true;
            }
            if (set)
            {
                Debug.WriteLine($"Lighting set to {red}, {green}, {blue} for {sdk}!");
            }
            return(set);
        }
コード例 #3
0
 public static void Shutdown(LedSdk sdk)
 {
     if (sdk == LedSdk.Logitech)
     {
         LogitechGSDK.LogiLedShutdown();
     }
     else if (sdk == LedSdk.Corsair)
     {
         CueSDK.Reinitialize();
     }
     Debug.WriteLine("SDK is shutdown!");
 }
コード例 #4
0
 public static bool Initialize(LedSdk sdk)
 {
     if (sdk == LedSdk.Logitech)
     {
         return(LogitechGSDK.LogiLedInit());
     }
     else if (sdk == LedSdk.Corsair)
     {
         CueSDK.Initialize(true);
         return(true);
     }
     return(false);
 }
コード例 #5
0
        public static bool Initialize(LedSdk sdk, string name)
        {
            bool set = false;

            if (sdk == LedSdk.Logitech)
            {
                set = LogitechGSDK.LogiLedInitWithName(name);
            }
            else if (sdk == LedSdk.Corsair)
            {
                CueSDK.Initialize(true);
                CueSDK.UpdateMode       = CUE.NET.Devices.Generic.Enums.UpdateMode.Continuous;
                CueSDK.HeadsetSDK.Brush = new SolidColorBrush(new CorsairColor(0, 0, 0));
                set = true;
            }
            if (set)
            {
                Debug.WriteLine("SDK is Started!");
            }
            return(set);
        }