예제 #1
0
        private static EffectResponseId CreateEffectCustom1D(ChromaApi api, ChromaDevice1DEnum device, EffectArray1dInput input)
        {
            if (null == api)
            {
                Debug.LogError("CreateEffectCustom1D: Parameter api is null!");
                return(null);
            }
            if (null == input)
            {
                Debug.LogError("CreateEffectCustom1D: Parameter input is null!");
                return(null);
            }
            int maxLeds = GetMaxLeds(device);

            if (maxLeds != input.Count)
            {
                Debug.LogError(string.Format("CreateEffectCustom1D Array size mismatch element: %d==%d!",
                                             maxLeds,
                                             input.Count));
            }

            try
            {
                switch (device)
                {
                case ChromaDevice1DEnum.ChromaLink:
                    return(api.PostChromaLinkCustom(input));

                case ChromaDevice1DEnum.Headset:
                    return(api.PostHeadsetCustom(input));

                case ChromaDevice1DEnum.Mousepad:
                    return(api.PostMousepadCustom(input));
                }
            }
            catch (Exception)
            {
            }
            return(null);
        }