Esempio n. 1
0
        public static void RazerAttrWriteModeStarlight(HidDevice device, RazerRgb rgb1, RazerRgb rgb2)
        {
            RazerReport report =
                RazerChromaStandardMatrixEffectStarlightDual(LED_STORAGE.VARSTORE, LEDS.BACKLIGHT_LED, 0x01, rgb1, rgb2);

            RazerSendPayload(device, report);
        }
Esempio n. 2
0
        public static void RazerAttrWriteModeReactive(HidDevice device, byte speed, RazerRgb rgb)
        {
            RazerReport report =
                RazerChromaStandardMatrixEffectReactive(LED_STORAGE.VARSTORE, LEDS.BACKLIGHT_LED, speed, rgb);

            RazerSendPayload(device, report);
        }
Esempio n. 3
0
        private void button4_Click(object sender, EventArgs e)
        {
            RazerRgb rgb1 = new RazerRgb(button2.BackColor), rgb2 = new RazerRgb(button3.BackColor);
            byte     speed = (byte)((double)numericUpDown1.Value / 100.0 * 255.0);

            switch (comboBox2.SelectedIndex)
            {
            case 0:
                RazerKeyboard.RazerAttrWriteModeStatic(selectedDevice, rgb1);
                break;

            case 1:
                RazerKeyboard.RazerAttrWriteModeReactive(selectedDevice, speed, rgb1);
                break;

            case 2:
                RazerKeyboard.RazerAttrWriteModeBreath(selectedDevice, rgb1, rgb2);
                break;

            case 3:
                RazerKeyboard.RazerAttrWriteModeWave(selectedDevice, RazerChroma.WAVE_DIRECTION.LEFT);
                break;

            case 4:
                RazerKeyboard.RazerAttrWriteModeStarlight(selectedDevice);
                break;

            case 5:
                RazerKeyboard.RazerAttrWriteModeStarlight(selectedDevice, rgb1);
                break;

            case 6:
                RazerKeyboard.RazerAttrWriteModeStarlight(selectedDevice, rgb1, rgb2);
                break;
            }
            RazerKeyboard.RazerAttrWriteSetBrightness(selectedDevice, (byte)((double)numericUpDown2.Value / 100.0 * 255.0));
        }
Esempio n. 4
0
        public static RazerReport RazerChromaStandardSetLedRgb(LED_STORAGE storage, LEDS led_id, RazerRgb rgb)
        {
            RazerReport report = GetRazerReport(0x03, 0x01, 0x05);

            report.arguments[0] = (byte)storage;
            report.arguments[1] = (byte)led_id;
            report.arguments[2] = rgb.r;
            report.arguments[3] = rgb.g;
            report.arguments[4] = rgb.b;
            return(report);
        }
Esempio n. 5
0
        public static RazerReport RazerChromaStandardMatrixEffectBreathingDual(LED_STORAGE storage, LEDS led_id, RazerRgb rgb1, RazerRgb rgb2)
        {
            RazerReport report = GetRazerReport(0x03, 0x0A, 0x08);

            report.arguments[0] = 0x03; // Effect ID
            report.arguments[1] = 0x02; // Breathing type
            report.arguments[2] = rgb1.r;
            report.arguments[3] = rgb1.g;
            report.arguments[4] = rgb1.b;
            report.arguments[5] = rgb2.r;
            report.arguments[6] = rgb2.g;
            report.arguments[7] = rgb2.b;

            return(report);
        }
Esempio n. 6
0
        public static RazerReport RazerChromaStandardMatrixEffectStarlightDual(LED_STORAGE storage, LEDS led_id, byte speed, RazerRgb rgb1, RazerRgb rgb2)
        {
            RazerReport report = GetRazerReport(0x03, 0x0A, 0x01);

            speed = clamp_u8(speed, 0x01, 0x03); // For now only seen

            report.arguments[0] = 0x19;          // Effect ID
            report.arguments[1] = 0x02;          // Type two color
            report.arguments[2] = speed;         // Speed

            report.arguments[3] = rgb1.r;        // Red 1
            report.arguments[4] = rgb1.g;        // Green 1
            report.arguments[5] = rgb1.b;        // Blue 1

            // For now havent seen any chroma using this, seen the extended version
            report.arguments[6] = rgb2.r; // Red 2
            report.arguments[7] = rgb2.g; // Green 2
            report.arguments[8] = rgb2.b; // Blue 2

            return(report);
        }
Esempio n. 7
0
        public static RazerReport RazerChromaStandardMatrixEffectStatic(LED_STORAGE storage, LEDS led_id, RazerRgb rgb1)
        {
            RazerReport report = GetRazerReport(0x03, 0x0A, 0x04);

            report.arguments[0] = 0x06;   // Effect ID
            report.arguments[1] = rgb1.r; /*rgb color definition*/
            report.arguments[2] = rgb1.g;
            report.arguments[3] = rgb1.b;

            return(report);
        }
Esempio n. 8
0
        public static RazerReport RazerChromaStandardMatrixEffectReactive(LED_STORAGE storage, LEDS led_id, byte speed, RazerRgb rgb1)
        {
            RazerReport report = GetRazerReport(0x03, 0x0A, 0x05);

            report.arguments[0] = 0x02;                        // Effect ID
            report.arguments[1] = clamp_u8(speed, 0x01, 0x04); // Time
            report.arguments[2] = rgb1.r;                      /*rgb color definition*/
            report.arguments[3] = rgb1.g;
            report.arguments[4] = rgb1.b;

            return(report);
        }