Exemple #1
0
        /// <inheritdoc/>
        public List <byte[]> BuildBytes(NZXTDeviceType Type, IChannel Channel_)
        {
            switch (Type)
            {
            case NZXTDeviceType.HuePlus:
                List <byte[]> outList = new List <byte[]>();
                for (int colorIndex = 0; colorIndex < Colors.Length; colorIndex++)
                {
                    byte[] SettingsBytes = new byte[] { 0x4b, (byte)Channel_.ChannelByte, 0x01, 0x03, new CISS(colorIndex, this._Speed) };
                    byte[] final         = SettingsBytes.ConcatenateByteArr(Channel_.BuildColorBytes(Colors[colorIndex]));
                    outList.Add(final);
                }
                return(outList);

            case NZXTDeviceType.KrakenX:
                List <byte[]> KrakenXOutList = new List <byte[]>();
                for (int colorIndex = 0; colorIndex < Colors.Length; colorIndex++)
                {
                    byte[] SettingsBytes = new byte[] { 0x02, 0x4c, (byte)Channel_.ChannelByte, 0x01, new CISS(colorIndex, this._Speed) };
                    byte[] KrakenXfinal  = SettingsBytes.ConcatenateByteArr(Channel_.BuildColorBytes(Colors[colorIndex]));
                    KrakenXOutList.Add(KrakenXfinal);
                }
                return(KrakenXOutList);

            default:
                return(null);
            }
        }
        /// <inheritdoc/>
        public List <byte[]> BuildBytes(NZXTDeviceType Type, IChannel Channel)
        {
            switch (Type)
            {
            case NZXTDeviceType.HuePlus:
                List <byte[]> outList = new List <byte[]>();
                for (int colorIndex = 0; colorIndex < _Colors.Length; colorIndex++)
                {
                    byte[] SettingsBytes = new byte[] { 0x4b, (byte)Channel.ChannelByte, 0x04, Param1, new CISS(colorIndex, this._Speed) };
                    byte[] final         = SettingsBytes.ConcatenateByteArr(Channel.BuildColorBytes(_Colors[colorIndex]));
                    outList.Add(final);
                }

                return(outList);

            case NZXTDeviceType.KrakenX:
                List <byte[]> KrakenOutList = new List <byte[]>();
                DCB           param         = new DCB(Channel.ChannelByte, Param1.IsForward);
                for (int colorIndex = 0; colorIndex < _Colors.Length; colorIndex++)
                {
                    byte[] KrakenSettingsBytes = new byte[] { 0x2, 0x4c, (byte)param.GetValue(), 0x04, new CISS(colorIndex, _Speed) };
                    byte[] KrakenFinal         = KrakenSettingsBytes.ConcatenateByteArr(Channel.BuildColorBytes(_Colors[colorIndex]));
                    KrakenOutList.Add(KrakenFinal);
                }
                return(KrakenOutList);

            default:
                return(null);
            }
        }
Exemple #3
0
        /// <inheritdoc/>
        public List <byte[]> BuildBytes(NZXTDeviceType Type, IChannel Channel)
        {
            switch (Type)
            {
            case NZXTDeviceType.HuePlus:
                List <byte[]> outList = new List <byte[]>();
                for (int colorIndex = 0; colorIndex < Colors.Length; colorIndex++)
                {
                    byte[] SettingsBytes = new byte[] { 0x4b, (byte)Channel.ChannelByte, 0x05, _Param1, new CISS(colorIndex, this.speed) };
                    byte[] final         = SettingsBytes.ConcatenateByteArr(Channel.BuildColorBytes(Colors[colorIndex]));
                    outList.Add(final);
                }
                return(outList);

            case NZXTDeviceType.KrakenX:
                DCBWM         direction      = new DCBWM(Channel.ChannelByte, _Param1.IsForward, _Param1.WithMovement);
                List <byte[]> KrakenXOutList = new List <byte[]>();
                for (int colorIndex = 0; colorIndex < Colors.Length; colorIndex++)
                {
                    byte[] KrakenXSettingsBytes = new byte[] { 0x2, 0x4c, direction, 0x05, new CISS(colorIndex, this.speed) };
                    byte[] final = KrakenXSettingsBytes.ConcatenateByteArr(Channel.BuildColorBytes(Colors[colorIndex]));
                    KrakenXOutList.Add(final);
                }
                return(KrakenXOutList);

            default:
                return(null);
            }
        }
Exemple #4
0
        /// <inheritdoc/>
        public List <byte[]> BuildBytes(NZXTDeviceType Type, IChannel Channel)
        {
            switch (Type)
            {
            case NZXTDeviceType.HuePlus:
                List <byte[]> outList = new List <byte[]>();
                for (int colorIndex = 0; colorIndex < Colors.Length; colorIndex++)
                {
                    byte[] SettingsBytes = new byte[] { 0x4b, (byte)Channel.ChannelByte, 0x06, 0x03, new CISS(colorIndex, this.speed) };
                    byte[] final         = SettingsBytes.ConcatenateByteArr(Channel.BuildColorBytes(Colors[colorIndex]));
                    outList.Add(final);
                }
                return(outList);

            case NZXTDeviceType.KrakenX:
                List <byte[]> KrakenOutList = new List <byte[]>();
                Console.WriteLine("ColorsLength - " + Colors.Length);
                for (int colorIndex = 0; colorIndex < Colors.Length; colorIndex++)
                {
                    byte[] KrakenSettingsBytes = new byte[] { 0x02, 0x4c, (byte)Channel.ChannelByte, 0x07, new CISS(colorIndex, this.speed) };
                    byte[] KrakenFinal         = KrakenSettingsBytes.ConcatenateByteArr(Channel.BuildColorBytes(Colors[colorIndex]));
                    KrakenOutList.Add(KrakenFinal);
                }
                Console.WriteLine("OutList Length - " + KrakenOutList.Count);
                return(KrakenOutList);

            default:
                return(null);
            }
        }
Exemple #5
0
        /// <inheritdoc/>
        public List <byte[]> BuildBytes(NZXTDeviceType Type, IChannel Channel)
        {
            switch (Type)
            {
            case NZXTDeviceType.HuePlus:
                byte[] SettingsBytes = new byte[] { 0x4b, (byte)Channel.ChannelByte, 0x02, Param1, Param2 };
                byte[] final         = SettingsBytes.ConcatenateByteArr(Channel.BuildColorBytes(new Color(0, 0, 255)));
                return(new List <byte[]>()
                {
                    final
                });

            case NZXTDeviceType.KrakenX:
                DCB    param = new DCB(Channel.ChannelByte, Param1.IsForward);
                byte[] KrakenSettingsBytes = new byte[] { 0x2, 0x4c, (byte)param.GetValue(), 0x02, (byte)speed };
                byte[] KrakenFinal         = KrakenSettingsBytes.ConcatenateByteArr(Channel.BuildColorBytes(new Color(0, 0, 255)));
                return(new List <byte[]>()
                {
                    KrakenFinal
                });

            default:
                return(null);
            }
        }
Exemple #6
0
        /// <inheritdoc/>
        public List <byte[]> BuildBytes(NZXTDeviceType Type, IChannel Channel)
        {
            if (Channel.ChannelByte == 0x00 || Channel.ChannelByte == 0x01)
            {
                throw new IncompatibleParamException("TaiChi channel can only be Ring or 0x02");
            }

            List <byte[]> KrakenOutList = new List <byte[]>();

            for (int ColorIndex = 0; ColorIndex < Colors.Length; ColorIndex++)
            {
                byte[] KrakenSettingsBytes = new byte[] { 0x02, 0x4c, (byte)Channel.ChannelByte, 0x08, new CISS(ColorIndex, Speed) };
                byte[] KrakenFinal         = KrakenSettingsBytes.ConcatenateByteArr(Channel.BuildColorBytes(Colors[ColorIndex]));
                KrakenOutList.Add(KrakenFinal);
            }
            return(KrakenOutList);
        }
Exemple #7
0
        /// <inheritdoc/>
        public List <byte[]> BuildBytes(NZXTDeviceType Type, IChannel Channel_)
        {
            switch (Type)
            {
            case NZXTDeviceType.HuePlus:
                this._Channel = Channel_;
                byte[] SettingsBytes = new byte[] { 0x4b, (byte)Channel_.ChannelByte, 0x00, 0x02, 0x03 };
                byte[] final;
                if (IsCustom)
                {
                    final = SettingsBytes.ConcatenateByteArr(Channel_.BuildColorBytes(CustomBytes));
                }
                else
                {
                    final = SettingsBytes.ConcatenateByteArr(Channel_.BuildColorBytes(_Color));
                }
                return(new List <byte[]>()
                {
                    final
                });

            case NZXTDeviceType.KrakenX:
                this._Channel = Channel_;
                byte[] KrakenSettingsBytes = new byte[] { 0x02, 0x4c, (byte)Channel_.ChannelByte, 0x00, 0x02 };
                byte[] KrakenFinal;
                if (IsCustom)
                {
                    KrakenFinal = KrakenSettingsBytes.ConcatenateByteArr(Channel_.BuildColorBytes(CustomBytes));
                }
                else
                {
                    KrakenFinal = KrakenSettingsBytes.ConcatenateByteArr(Channel_.BuildColorBytes(_Color));
                }
                byte[] TrueFinal = KrakenFinal.ConcatenateByteArr(new byte[] { 0x00 });
                return(new List <byte[]> {
                    TrueFinal
                });

            default:
                return(null);
            }
        }
Exemple #8
0
        /// <inheritdoc/>
        public List <byte[]> BuildBytes(NZXTDeviceType Type, IChannel Channel)
        {
            switch (Type)
            {
            case NZXTDeviceType.HuePlus:
                List <byte[]> outList       = new List <byte[]>();
                byte[]        SettingsBytes = new byte[] { 0x4b, (byte)Channel.ChannelByte, 0x03, Param1, Param2 };
                byte[]        final         = SettingsBytes.ConcatenateByteArr(Channel.State == false ? Color.AllOff() : Channel.BuildColorBytes(_Color));
                outList.Add(final);

                return(outList);

            case NZXTDeviceType.KrakenX:
                List <byte[]> KrakenXOutList       = new List <byte[]>();
                byte[]        KrakenXSettingsBytes = new byte[] { 0x02, 0x4c, 0x02, 0x03, Param2 };
                byte[]        KrakenXfinal         = KrakenXSettingsBytes.ConcatenateByteArr(Channel.State == false ? Color.AllOff() : Channel.BuildColorBytes(_Color));
                KrakenXOutList.Add(KrakenXfinal);
                return(KrakenXOutList);

            default:
                return(null);
            }
        }
Exemple #9
0
        /// <inheritdoc/>
        public List <byte[]> BuildBytes(NZXTDeviceType Type, IChannel Channel)
        {
            switch (Type)
            {
            case NZXTDeviceType.HuePlus:
                List <byte[]> outList       = new List <byte[]>();
                byte[]        SettingsBytes = new byte[] { 0x4b, (byte)Channel.ChannelByte, 0x0c, 0x03, new CISS(0, this.speed) };
                byte[]        final         = SettingsBytes.ConcatenateByteArr(Channel.BuildColorBytes(Color));
                outList.Add(final);

                return(outList);

            case NZXTDeviceType.KrakenX:
                List <byte[]> KrakenXOutBytes      = new List <byte[]>();
                byte[]        KrakenXSettingsBytes = new byte[] { 0x02, 0x4c, (byte)Channel.ChannelByte, 0x0c, (byte)speed };
                byte[]        KrakenXFinal         = KrakenXSettingsBytes.ConcatenateByteArr(Channel.BuildColorBytes(Color));
                KrakenXOutBytes.Add(KrakenXFinal);

                return(KrakenXOutBytes);

            default:
                return(null);
            }
        }
Exemple #10
0
 /// <inheritdoc/>
 public bool IsCompatibleWith(NZXTDeviceType Type)
 {
     return(CompatibleWith.Contains(Type) ? true : false);
 }