Beispiel #1
0
        public static EffectArray1dInput CreateColors1D(ChromaDevice1DEnum device)
        {
            int maxLeds = ChromaUtils.GetMaxLeds(device);
            EffectArray1dInput effectArray1dInput = new EffectArray1dInput();

            for (int i = 0; i < maxLeds; i++)
            {
                effectArray1dInput.Add(new int?(0));
            }
            return(effectArray1dInput);
        }
Beispiel #2
0
        private static EffectResponseId CreateEffectCustom1D(ChromaApi api, ChromaDevice1DEnum device, EffectArray1dInput input)
        {
            if (api == null)
            {
                Debug.LogError("CreateEffectCustom1D: Parameter api is null!");
                return(null);
            }
            if (input == null)
            {
                Debug.LogError("CreateEffectCustom1D: Parameter input is null!");
                return(null);
            }
            int maxLeds = ChromaUtils.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);
        }