Publish LumaOps source

This commit is contained in:
LumaOps release export
2026-09-03 01:18:36 +02:00
commit 7f1c0e5f71
2363 changed files with 501543 additions and 0 deletions
@@ -0,0 +1,181 @@
/*---------------------------------------------------------*\
| AsusAuraMouseGen1Controller.cpp |
| |
| Driver for ASUS Aura gen 1 mouse |
| |
| Mola19 30 Nov 2021 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <cstring>
#include <chrono>
#include <thread>
#include "AsusAuraMouseGen1Controller.h"
#include "StringUtils.h"
AsusAuraMouseGen1Controller::AsusAuraMouseGen1Controller(hid_device* dev_handle, const char* path, uint16_t pid, std::string dev_name)
{
dev = dev_handle;
location = path;
device_pid = pid;
name = dev_name;
}
AsusAuraMouseGen1Controller::~AsusAuraMouseGen1Controller()
{
hid_close(dev);
}
std::string AsusAuraMouseGen1Controller::GetDeviceLocation()
{
return("HID: " + location);
}
std::string AsusAuraMouseGen1Controller::GetName()
{
return(name);
}
std::string AsusAuraMouseGen1Controller::GetSerialString()
{
wchar_t serial_string[HID_MAX_STR];
int ret = hid_get_serial_number_string(dev, serial_string, HID_MAX_STR);
if(ret != 0)
{
return("");
}
return(StringUtils::wstring_to_string(serial_string));
}
std::string AsusAuraMouseGen1Controller::GetVersion()
{
unsigned char usb_buf[9] = { 0x0C, 0xC4, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
usb_buf[3] = (device_pid == 0x1824) ? 0x02 : 0x00;
hid_send_feature_report(dev, usb_buf, 9);
unsigned char usb_buf_out[9] = { 0x0C };
hid_get_feature_report(dev, usb_buf_out, 9);
return std::string("1." + std::to_string(usb_buf_out[3]));
}
int AsusAuraMouseGen1Controller::GetActiveProfile()
{
unsigned char profile;
unsigned char profile_amount = 0;
unsigned char profile_key = 0;
switch(device_pid)
{
case 0x185B:
profile_amount = 3;
profile_key = 0xF0;
break;
case 0x181C:
case 0x1824:
default:
profile_amount = 6;
profile_key = 0x60;
break;
}
do
{
unsigned char usb_buf[9] = { 0x0C, 0xDF, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
hid_send_feature_report(dev, usb_buf, 9);
unsigned char usb_buf_out[9] = { 0x0C };
hid_get_feature_report(dev, usb_buf_out, 9);
profile = usb_buf_out[4];
} while(profile < profile_key || profile > profile_key + profile_amount - 1);
return (profile % 16) + 1;
}
void AsusAuraMouseGen1Controller::SendUpdate
(
unsigned char key,
unsigned char value
)
{
unsigned char usb_buf[9];
memset(usb_buf, 0x00, 9);
usb_buf[0x00] = 0x0C;
usb_buf[0x01] = 0xC4;
usb_buf[0x02] = 0x0F;
usb_buf[0x03] = 0x00;
usb_buf[0x04] = key;
usb_buf[0x05] = value;
hid_send_feature_report(dev, usb_buf, 9);
unsigned char buf_in[9];
buf_in[0] = 0x0C;
hid_get_feature_report(dev, buf_in, 9);
std::this_thread::sleep_for(std::chrono::milliseconds(15));
}
void AsusAuraMouseGen1Controller::UpdateProfile
(
unsigned char key,
unsigned char profile,
unsigned char value
)
{
unsigned char usb_buf[9];
memset(usb_buf, 0x00, 9);
usb_buf[0x00] = 0x0C;
usb_buf[0x01] = 0xDE;
usb_buf[0x02] = key;
usb_buf[0x03] = profile;
usb_buf[0x04] = value;
hid_send_feature_report(dev, usb_buf, 9);
unsigned char buf_in[9];
buf_in[0] = 0x0C;
hid_get_feature_report(dev, buf_in, 9);
}
void AsusAuraMouseGen1Controller::SendDirectSpatha(std::vector<RGBColor> colors)
{
unsigned char usb_buf[33];
memset(usb_buf, 0x00, 33);
usb_buf[0x00] = 0x10;
usb_buf[0x01] = 0x00;
usb_buf[0x02] = 0xF0;
usb_buf[0x03] = 0x00;
for(unsigned char i = 0; i < 3; i++)
{
usb_buf[4 + i * 3] = RGBGetRValue(colors[i]);
usb_buf[5 + i * 3] = RGBGetGValue(colors[i]);
usb_buf[6 + i * 3] = RGBGetBValue(colors[i]);
}
hid_send_feature_report(dev, usb_buf, 33);
}
void AsusAuraMouseGen1Controller::ResetToSavedLighting()
{
unsigned char usb_buf[9];
memset(usb_buf, 0x00, 9);
usb_buf[0x00] = 0x0C;
usb_buf[0x01] = 0xC4;
hid_send_feature_report(dev, usb_buf, 9);
}
@@ -0,0 +1,57 @@
/*---------------------------------------------------------*\
| AsusAuraMouseGen1Controller.h |
| |
| Driver for ASUS Aura gen 1 mouse |
| |
| Mola19 30 Nov 2021 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include <string>
#include <vector>
#include <hidapi.h>
#include "RGBController.h"
#define HID_MAX_STR 255
class AsusAuraMouseGen1Controller
{
public:
AsusAuraMouseGen1Controller(hid_device* dev_handle, const char* path, uint16_t pid, std::string dev_name);
virtual ~AsusAuraMouseGen1Controller();
std::string GetDeviceLocation();
std::string GetName();
std::string GetSerialString();
std::string GetVersion();
int GetActiveProfile();
void SendUpdate
(
unsigned char key,
unsigned char value
);
void UpdateProfile
(
unsigned char key,
unsigned char profile,
unsigned char value
);
void SendDirectSpatha(std::vector<RGBColor> colors);
void ResetToSavedLighting();
uint16_t device_pid;
private:
hid_device* dev;
std::string location;
std::string name;
};
@@ -0,0 +1,274 @@
/*---------------------------------------------------------*\
| RGBController_AsusROGSpatha.cpp |
| |
| RGBController for ASUS ROG Spatha |
| |
| Mola19 05 Nov 2023 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "RGBController_AsusROGSpatha.h"
/**------------------------------------------------------------------*\
@name Asus Aura Spatha
@category Mouse
@type USB
@save :white_check_mark:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectAsusAuraUSBSpatha
@comment This device allows indiviual modes for each zone,
which currently can't be implemented in OpenRGB.
Also there seem to be a firmware bug which causes static
to use a random colorand random to use a static color
that was previously set. This can be worked around by saving
\*-------------------------------------------------------------------*/
RGBController_AsusROGSpatha::RGBController_AsusROGSpatha(AsusAuraMouseGen1Controller* controller_ptr)
{
controller = controller_ptr;
name = controller->GetName();
vendor = "ASUS";
type = DEVICE_TYPE_MOUSE;
description = "ASUS Aura Mouse Device";
version = controller->GetVersion();
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = ASUS_ROG_SPATHA_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Static;
Static.name = "Static";
Static.value = ASUS_ROG_SPATHA_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Static.brightness_min = ASUS_ROG_SPATHA_BRIGHTNESS_MIN;
Static.brightness_max = ASUS_ROG_SPATHA_BRIGHTNESS_MAX;
Static.brightness = ASUS_ROG_SPATHA_BRIGHTNESS_DEFAULT;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = ASUS_ROG_SPATHA_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Breathing.brightness_min = ASUS_ROG_SPATHA_BRIGHTNESS_MIN;
Breathing.brightness_max = ASUS_ROG_SPATHA_BRIGHTNESS_MAX;
Breathing.brightness = ASUS_ROG_SPATHA_BRIGHTNESS_DEFAULT;
Breathing.colors_min = 2;
Breathing.colors_max = 2;
Breathing.colors.resize(2);
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
modes.push_back(Breathing);
mode ColorCycle;
ColorCycle.name = "Spectrum Cycle";
ColorCycle.value = ASUS_ROG_SPATHA_MODE_SPECTRUM_CYCLE;
ColorCycle.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
ColorCycle.brightness_min = ASUS_ROG_SPATHA_BRIGHTNESS_MIN;
ColorCycle.brightness_max = ASUS_ROG_SPATHA_BRIGHTNESS_MAX;
ColorCycle.brightness = ASUS_ROG_SPATHA_BRIGHTNESS_DEFAULT;
ColorCycle.colors_min = 12;
ColorCycle.colors_max = 12;
ColorCycle.colors.resize(12);
ColorCycle.color_mode = MODE_COLORS_MODE_SPECIFIC;
modes.push_back(ColorCycle);
mode Random;
Random.name = "Random";
Random.value = ASUS_ROG_SPATHA_MODE_RANDOM;
Random.flags = MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Random.brightness_min = ASUS_ROG_SPATHA_BRIGHTNESS_MIN;
Random.brightness_max = ASUS_ROG_SPATHA_BRIGHTNESS_MAX;
Random.brightness = ASUS_ROG_SPATHA_BRIGHTNESS_DEFAULT;
Random.color_mode = MODE_COLORS_NONE;
modes.push_back(Random);
mode Reactive;
Reactive.name = "Reactive";
Reactive.value = ASUS_ROG_SPATHA_MODE_REACTIVE;
Reactive.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Reactive.brightness_min = ASUS_ROG_SPATHA_BRIGHTNESS_MIN;
Reactive.brightness_max = ASUS_ROG_SPATHA_BRIGHTNESS_MAX;
Reactive.brightness = ASUS_ROG_SPATHA_BRIGHTNESS_DEFAULT;
Reactive.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Reactive);
mode Battery;
Battery.name = "Battery";
Battery.value = ASUS_ROG_SPATHA_MODE_BATTERY;
Battery.flags = MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Battery.brightness_min = ASUS_ROG_SPATHA_BRIGHTNESS_MIN;
Battery.brightness_max = ASUS_ROG_SPATHA_BRIGHTNESS_MAX;
Battery.brightness = ASUS_ROG_SPATHA_BRIGHTNESS_DEFAULT;
Battery.color_mode = MODE_COLORS_NONE;
modes.push_back(Battery);
SetupZones();
}
RGBController_AsusROGSpatha::~RGBController_AsusROGSpatha()
{
delete controller;
}
void RGBController_AsusROGSpatha::SetupZones()
{
std::string zones_names[3] = {"Side", "Scroll Wheel", "Logo"};
for(unsigned char i = 0; i < 3; i++)
{
zone spatha_zone;
spatha_zone.name = zones_names[i];
spatha_zone.type = ZONE_TYPE_SINGLE;
spatha_zone.leds_min = 1;
spatha_zone.leds_max = 1;
spatha_zone.leds_count = 1;
spatha_zone.matrix_map = NULL;
zones.push_back(spatha_zone);
led spatha_led;
spatha_led.name = zones_names[i];
spatha_led.value = 1;
leds.push_back(spatha_led);
}
SetupColors();
}
void RGBController_AsusROGSpatha::ResizeZone(int /*zone*/, int /*new_size*/)
{
}
void RGBController_AsusROGSpatha::DeviceUpdateLEDs()
{
if(modes[active_mode].value == ASUS_ROG_SPATHA_MODE_DIRECT)
{
controller->SendDirectSpatha(colors);
}
else
{
UpdateSingleLED(0);
UpdateSingleLED(1);
UpdateSingleLED(2);
}
}
void RGBController_AsusROGSpatha::UpdateZoneLEDs(int zone)
{
if(modes[active_mode].value == ASUS_ROG_SPATHA_MODE_DIRECT)
{
controller->SendDirectSpatha(colors);
}
else
{
UpdateSingleLED(zone);
}
}
void RGBController_AsusROGSpatha::UpdateSingleLED(int led)
{
if(modes[active_mode].value == ASUS_ROG_SPATHA_MODE_DIRECT)
{
controller->SendDirectSpatha(colors);
}
else
{
controller->SendUpdate(0x13 + led * 38, RGBGetRValue(colors[led]));
controller->SendUpdate(0x14 + led * 38, RGBGetGValue(colors[led]));
controller->SendUpdate(0x15 + led * 38, RGBGetBValue(colors[led]));
}
}
void RGBController_AsusROGSpatha::DeviceUpdateMode()
{
if(modes[active_mode].value == ASUS_ROG_SPATHA_MODE_DIRECT)
{
return;
}
/*-----------------------------------------------------*\
| Needed to overwrite direct |
\*-----------------------------------------------------*/
controller->ResetToSavedLighting();
/*-----------------------------------------------------*\
| Send data to all 3 zones |
\*-----------------------------------------------------*/
for(int i = 0; i < 3; i++)
{
controller->SendUpdate(0x11 + i * 38, modes[active_mode].value);
/*------------------------------------------------------------------*\
| This mouse has independent brightness for wired and wireless. |
| Each is 4-bit in the same byte (wireless is the first/bigger one). |
| OpenRGB misses that feature, hence both are the same |
\*------------------------------------------------------------------*/
controller->SendUpdate(0x12 + i * 38, (modes[active_mode].brightness << 4) + modes[active_mode].brightness);
if(modes[active_mode].value == ASUS_ROG_SPATHA_MODE_SPECTRUM_CYCLE || modes[active_mode].value == ASUS_ROG_SPATHA_MODE_BREATHING)
{
for(unsigned int j = 0; j < modes[active_mode].colors.size(); j++)
{
controller->SendUpdate(0x13 + j * 3 + i * 38, RGBGetRValue(modes[active_mode].colors[j]));
controller->SendUpdate(0x14 + j * 3 + i * 38, RGBGetGValue(modes[active_mode].colors[j]));
controller->SendUpdate(0x15 + j * 3 + i * 38, RGBGetBValue(modes[active_mode].colors[j]));
}
}
}
}
void RGBController_AsusROGSpatha::DeviceSaveMode()
{
if(modes[active_mode].value == ASUS_ROG_SPATHA_MODE_DIRECT)
{
return;
}
unsigned int profile = controller->GetActiveProfile();
/*-----------------------------------------------------*\
| Send data to all 3 zones |
\*-----------------------------------------------------*/
for(int i = 0; i < 3; i++)
{
controller->UpdateProfile(0x11 + i * 38, profile, modes[active_mode].value);
/*------------------------------------------------------------------*\
| This mouse has independent brightness for wired and wireless. |
| Each is 4-bit in the same byte (wireless is the first/bigger one). |
| OpenRGB misses that feature, hence both are the same |
\*------------------------------------------------------------------*/
controller->UpdateProfile(0x12 + i * 38, profile, (modes[active_mode].brightness << 4) + modes[active_mode].brightness);
if(modes[active_mode].value == ASUS_ROG_SPATHA_MODE_SPECTRUM_CYCLE || modes[active_mode].value == ASUS_ROG_SPATHA_MODE_BREATHING)
{
for(unsigned int j = 0; j < modes[active_mode].colors.size(); j++)
{
controller->UpdateProfile(0x13 + j * 3 + i * 38, profile, RGBGetRValue(modes[active_mode].colors[j]));
controller->UpdateProfile(0x14 + j * 3 + i * 38, profile, RGBGetGValue(modes[active_mode].colors[j]));
controller->UpdateProfile(0x15 + j * 3 + i * 38, profile, RGBGetBValue(modes[active_mode].colors[j]));
}
}
else if(modes[active_mode].value == ASUS_ROG_SPATHA_MODE_STATIC || modes[active_mode].value == ASUS_ROG_SPATHA_MODE_REACTIVE)
{
controller->UpdateProfile(0x13 + i * 38, profile, RGBGetRValue(colors[i]));
controller->UpdateProfile(0x14 + i * 38, profile, RGBGetGValue(colors[i]));
controller->UpdateProfile(0x15 + i * 38, profile, RGBGetBValue(colors[i]));
}
}
controller->ResetToSavedLighting();
}
@@ -0,0 +1,54 @@
/*---------------------------------------------------------*\
| RGBController_AsusROGSpatha.h |
| |
| RGBController for ASUS ROG Spatha |
| |
| Mola19 05 Nov 2023 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include "RGBController.h"
#include "AsusAuraMouseGen1Controller.h"
enum
{
ASUS_ROG_SPATHA_BRIGHTNESS_MIN = 0,
ASUS_ROG_SPATHA_BRIGHTNESS_MAX = 15,
ASUS_ROG_SPATHA_BRIGHTNESS_DEFAULT = 15
};
enum
{
ASUS_ROG_SPATHA_MODE_DIRECT = 0xFF,
ASUS_ROG_SPATHA_MODE_STATIC = 0x01,
ASUS_ROG_SPATHA_MODE_SPECTRUM_CYCLE = 0x05,
ASUS_ROG_SPATHA_MODE_RANDOM = 0x06,
ASUS_ROG_SPATHA_MODE_BREATHING = 0x0A,
ASUS_ROG_SPATHA_MODE_BATTERY = 0x0B,
ASUS_ROG_SPATHA_MODE_REACTIVE = 0x0C,
};
class RGBController_AsusROGSpatha : public RGBController
{
public:
RGBController_AsusROGSpatha(AsusAuraMouseGen1Controller* controller_ptr);
~RGBController_AsusROGSpatha();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
void DeviceSaveMode();
private:
AsusAuraMouseGen1Controller* controller;
};
@@ -0,0 +1,152 @@
/*---------------------------------------------------------*\
| RGBController_AsusROGStrixEvolve.cpp |
| |
| RGBController for ASUS ROG Evolve |
| |
| Mola19 30 Nov 2021 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "RGBController_AsusROGStrixEvolve.h"
/**------------------------------------------------------------------*\
@name Asus Aura Strix Evolve
@category Mouse
@type USB
@save :white_check_mark:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectAsusAuraUSBStrixEvolve
@comment
\*-------------------------------------------------------------------*/
RGBController_AsusROGStrixEvolve::RGBController_AsusROGStrixEvolve(AsusAuraMouseGen1Controller* controller_ptr)
{
controller = controller_ptr;
name = controller->GetName();
vendor = "ASUS";
type = DEVICE_TYPE_MOUSE;
description = "ASUS Aura Mouse Device";
version = controller->GetVersion();
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = ASUS_ROG_STRIX_EVOLVE_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Direct.brightness_min = ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_MIN;
Direct.brightness_max = ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_MAX;
Direct.brightness = ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_DEFAULT;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = ASUS_ROG_STRIX_EVOLVE_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Breathing.brightness_min = ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_MIN;
Breathing.brightness_max = ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_MAX;
Breathing.brightness = ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_DEFAULT;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
mode ColorCycle;
ColorCycle.name = "Spectrum Cycle";
ColorCycle.value = ASUS_ROG_STRIX_EVOLVE_MODE_SPECTRUM_CYCLE;
ColorCycle.flags = MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
ColorCycle.brightness_min = ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_MIN;
ColorCycle.brightness_max = ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_MAX;
ColorCycle.brightness = ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_DEFAULT;
ColorCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(ColorCycle);
mode Reactive;
Reactive.name = "Reactive";
Reactive.value = ASUS_ROG_STRIX_EVOLVE_MODE_REACTIVE;
Reactive.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Reactive.brightness_min = ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_MIN;
Reactive.brightness_max = ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_MAX;
Reactive.brightness = ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_DEFAULT;
Reactive.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Reactive);
SetupZones();
}
RGBController_AsusROGStrixEvolve::~RGBController_AsusROGStrixEvolve()
{
delete controller;
}
void RGBController_AsusROGStrixEvolve::SetupZones()
{
zone mouse_zone;
mouse_zone.name = "Underglow";
mouse_zone.type = ZONE_TYPE_SINGLE;
mouse_zone.leds_min = 1;
mouse_zone.leds_max = 1;
mouse_zone.leds_count = 1;
mouse_zone.matrix_map = NULL;
zones.push_back(mouse_zone);
led mouse_led;
mouse_led.name = "Underglow";
mouse_led.value = 1;
leds.push_back(mouse_led);
SetupColors();
}
void RGBController_AsusROGStrixEvolve::ResizeZone(int /*zone*/, int /*new_size*/)
{
}
void RGBController_AsusROGStrixEvolve::DeviceUpdateLEDs()
{
UpdateSingleLED(0);
}
void RGBController_AsusROGStrixEvolve::UpdateZoneLEDs(int zone)
{
UpdateSingleLED(zone);
}
void RGBController_AsusROGStrixEvolve::UpdateSingleLED(int /*led*/)
{
controller->SendUpdate(0x1C, RGBGetRValue(colors[0]));
controller->SendUpdate(0x1D, RGBGetGValue(colors[0]));
controller->SendUpdate(0x1E, RGBGetBValue(colors[0]));
}
void RGBController_AsusROGStrixEvolve::DeviceUpdateMode()
{
controller->SendUpdate(0x19, modes[active_mode].value);
controller->SendUpdate(0x1A, modes[active_mode].brightness);
}
void RGBController_AsusROGStrixEvolve::DeviceSaveMode()
{
unsigned int profile = controller->GetActiveProfile();
controller->UpdateProfile(0x19, profile, modes[active_mode].value);
controller->UpdateProfile(0x1A, profile, modes[active_mode].brightness);
if(modes[active_mode].value != ASUS_ROG_STRIX_EVOLVE_MODE_SPECTRUM_CYCLE)
{
controller->UpdateProfile(0x1C, profile, RGBGetRValue(colors[0]));
controller->UpdateProfile(0x1D, profile, RGBGetGValue(colors[0]));
controller->UpdateProfile(0x1E, profile, RGBGetBValue(colors[0]));
}
controller->ResetToSavedLighting();
}
@@ -0,0 +1,51 @@
/*---------------------------------------------------------*\
| RGBController_AsusROGStrixEvolve.h |
| |
| RGBController for ASUS ROG Evolve |
| |
| Mola19 30 Nov 2021 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include "RGBController.h"
#include "AsusAuraMouseGen1Controller.h"
enum
{
ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_MIN = 0,
ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_MAX = 255,
ASUS_ROG_STRIX_EVOLVE_BRIGHTNESS_DEFAULT = 255,
};
enum
{
ASUS_ROG_STRIX_EVOLVE_MODE_DIRECT = 0x01,
ASUS_ROG_STRIX_EVOLVE_MODE_BREATHING = 0x02,
ASUS_ROG_STRIX_EVOLVE_MODE_SPECTRUM_CYCLE = 0x03,
ASUS_ROG_STRIX_EVOLVE_MODE_REACTIVE = 0x04,
};
class RGBController_AsusROGStrixEvolve : public RGBController
{
public:
RGBController_AsusROGStrixEvolve(AsusAuraMouseGen1Controller* controller_ptr);
~RGBController_AsusROGStrixEvolve();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
void DeviceSaveMode();
private:
AsusAuraMouseGen1Controller* controller;
};