Compare commits

...
Author SHA1 Message Date
Shenghao Yang 6db00be29a Add support for Acer monitors with rear RGB strips
Amended for code style by Adam Honse <[email protected]>
2023-07-31 11:50:06 -05:00
morg b7747a37d1 Add support for iGame GeForce RTX 3070 Ultra W OC-V 2023-07-31 04:50:07 +00:00
Adam Honse 888b292d73 Fix Razer matrix map initialization for non-keyboard zones 2023-07-30 13:26:34 -05:00
Peter Vazny 9c01593ba8 Fixes some Y740 15" keys 2023-07-30 07:45:03 +00:00
Adam Honse 9cf453008d Initial commit for scsiapi and Seagate FireCuda Gaming External HDD controller 2023-07-30 06:12:21 +00:00
morg f6e0996250 Fix crash on save for AsusAuraCoreLaptop. Closes #3174 2023-07-25 13:21:50 +02:00
Adam Honse deeb8a84b7 Initial HYTE CNVS controller implementation 2023-07-22 20:10:14 +00:00
TheRogueZeta 92992c0a9b Add additional device ID for Asus TUF RTX4080-16G-GAMING 2023-07-21 15:15:33 -07:00
Sergey004 652d1f606e Add PALIT RTX 3060 LHR (GA104) to detection 2023-07-21 17:26:42 +04:00
Mola19 35c5d99a80 add support for Asus ROG Strix Flare II Animate 2023-07-20 02:26:19 +00:00
morg 653f025635 Add support for iGame GeForce RTX 3060 Ti Advanced OC-V variant 2023-07-18 13:02:49 +00:00
Adam Honse 606355955d Fill in missing modes for Razer Mamba 2012 2023-07-17 17:05:40 -05:00
Martin Hartl a98b0c1b62 Asus mainboard: Fix addressable only mainboard 2023-07-17 19:57:06 +00:00
Adam Honse 5dd9459561 Fix non-NULL matrix map pointer in Intel Arc A770 LE controller 2023-07-16 19:49:39 -05:00
Chris M 4dae7b6b85 Updated includes to fully cover dependencies 2023-07-16 22:56:38 +00:00
Mike Wang 5caf1e1b85 Fix RGB Fusion 2 pulse mode not working #3489 2023-07-16 22:55:32 +00:00
Alexey Sokolov 125b1ab134 Warn if dlopen() failed 2023-07-16 15:44:36 +01:00
Milan Cermak 9d962ded6a ViewSonic Elite XG270QG detected twice #3486 2023-07-15 14:59:53 +02:00
Mike Wang f414029910 Add Gigabyte GeForce RTX­4070 GAMING OC 12G #3477 2023-07-14 13:36:47 +00:00
Adam Honse 3629ba1f09 Remove old keymap entries from RazerDevices structures as they've all been converted to KLM layouts 2023-07-13 22:22:30 -05:00
Mike Wang 3678262404 Fix compilation failure caused by some non-ascii characters #3481 2023-07-13 13:29:52 +00:00
Mola19 16d8c8e962 fix AsusAuraTUFKeyboard quicksand mode direction 2023-07-13 05:39:32 +00:00
Dmitry K 51712f08b5 Removed include directives from ResourceManager.h to speed up build process 2023-07-12 14:51:47 +00:00
Dmitry K 0714920a9a Simplified detector blocks for HID 2023-07-12 14:49:27 +00:00
Anders Nikolai Fuglseth edea9f6bec Add ASUS TUF RTX 4070 O12G Gaming 2023-07-12 00:05:45 +00:00
morg 65fc57cb69 Add support for ASUS TUF RTX4080 16G GAMING GPU 2023-07-11 16:36:06 +00:00
Rollbacke 1480b23838 Added another NZXT Fan & Controller 6 channels 2023-07-11 16:34:01 +00:00
morg 7b38a6a8d6 Add support for ASUS TUF RTX 3090Ti 24G GAMING GPU 2023-07-11 14:41:02 +02:00
Göktuğ Korkmaz 0b776269ea Added another PID for HyperX QuadCast S microphone 2023-07-11 06:27:25 +03:00
Cooper Hall 14c74248dd fixed OpenRazer compiling error on windows 2023-07-10 19:51:27 +00:00
KerJoe 3ee6af0dfd Added "MSI PRO B550M-P GEN3" motherboard ID. 2023-07-10 18:46:38 +00:00
Cooper Hall 9fab4110d7 fixed one definition rule warnings 2023-07-10 18:13:47 +00:00
TheRogueZeta 9c2a648d09 Set custom width for HardwareID colums and auto expand list 2023-07-10 16:23:09 +00:00
Adam Honse c44d87e24d Increment version number post-release 2023-07-10 11:19:52 -05:00
104 changed files with 3056 additions and 1120 deletions
@@ -12,6 +12,7 @@
#include "RGBController.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
#include "ASRockPolychromeUSBController.h"
#include "dependencies/dmiinfo.h"
@@ -0,0 +1,75 @@
/*---------------------------------------------------------*\
| AcerMonitorController.cpp |
| |
| Driver for 2020/2021 Acer monitors with rear RGB strips. |
| |
| Shenghao Yang ([email protected]), 30/12/2021 |
| Amended for code style by Adam Honse, 3/13/2022 |
\*---------------------------------------------------------*/
#include "AcerMonitorController.h"
#include <cstring>
AcerMonitorController::AcerMonitorController(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
location = path;
}
AcerMonitorController::~AcerMonitorController()
{
hid_close(dev);
}
std::string AcerMonitorController::GetDeviceLocation()
{
return("HID: " + location);
}
std::string AcerMonitorController::GetSerialString()
{
wchar_t serial_string[128];
int ret = hid_get_serial_number_string(dev, serial_string, 128);
if(ret != 0)
{
return("");
}
std::wstring return_wstring = serial_string;
std::string return_string(return_wstring.begin(), return_wstring.end());
return(return_string);
}
void AcerMonitorController::SetColors(RGBColor *colors, std::size_t num_leds)
{
char usb_buf[374];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, sizeof(usb_buf));
/*-----------------------------------------------------*\
| Fill in Set Colors packet |
\*-----------------------------------------------------*/
usb_buf[ACER_MONITOR_OFFSET_REPORT_TYPE] = ACER_MONITOR_REPORT_TYPE;
usb_buf[ACER_MONITOR_OFFSET_MAGIC_0] = ACER_MONITOR_MAGIC_0;
usb_buf[ACER_MONITOR_OFFSET_MAGIC_1] = ACER_MONITOR_MAGIC_1;
/*-----------------------------------------------------*\
| Fill in color data |
\*-----------------------------------------------------*/
for(unsigned int color_idx = 0; color_idx < num_leds; color_idx++)
{
usb_buf[ACER_MONITOR_OFFSET_RGB_DATA + 0 + (color_idx * 3)] = RGBGetRValue(colors[color_idx]);
usb_buf[ACER_MONITOR_OFFSET_RGB_DATA + 1 + (color_idx * 3)] = RGBGetGValue(colors[color_idx]);
usb_buf[ACER_MONITOR_OFFSET_RGB_DATA + 2 + (color_idx * 3)] = RGBGetBValue(colors[color_idx]);
}
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 374);
}
@@ -0,0 +1,48 @@
/*---------------------------------------------------------*\
| AcerMonitorController.h |
| |
| Driver for 2020/2021 Acer monitors with rear RGB strips. |
| |
| Shenghao Yang ([email protected]), 30/12/2021 |
| Amended for code style by Adam Honse, 3/13/2022 |
\*---------------------------------------------------------*/
#pragma once
#include <RGBController.h>
#include <hidapi/hidapi.h>
enum
{
ACER_MONITOR_OFFSET_REPORT_TYPE = 0x00, /* Offset of report type field in packet */
ACER_MONITOR_OFFSET_MAGIC_0 = 0x01, /* Offset of magic 0 field in packet */
ACER_MONITOR_OFFSET_MAGIC_1 = 0x02, /* Offset of magic 1 field in packet */
ACER_MONITOR_OFFSET_PAD_0 = 0x03, /* Offset of pad 0 field in packet */
ACER_MONITOR_OFFSET_NUM_LEDS = 0x04, /* Offset of number of LEDs field in packet */
ACER_MONITOR_OFFSET_STRIP_INDEX = 0x05, /* Offset of strip index field in packet */
ACER_MONITOR_OFFSET_PAD_1 = 0x06, /* Offset of pad 1 field in packet */
ACER_MONITOR_OFFSET_RGB_DATA = 0x0E, /* Offset of RGB data field in packet */
};
enum
{
ACER_MONITOR_REPORT_TYPE = 0x2A, /* Value of report type field in packet */
ACER_MONITOR_MAGIC_0 = 0x0C, /* Value of magic 0 field in packet */
ACER_MONITOR_MAGIC_1 = 0x02, /* Value of magic 1 field in packet */
};
class AcerMonitorController
{
public:
AcerMonitorController(hid_device* dev_handle, const char* path);
~AcerMonitorController();
std::string GetDeviceLocation();
std::string GetSerialString();
void SetColors(RGBColor *colors, std::size_t num_leds);
private:
hid_device* dev;
std::string location;
};
@@ -0,0 +1,50 @@
/*---------------------------------------------------------*\
| AcerMonitorControllerDetect.cpp |
| |
| Controller detection for 2020/2021 Acer monitors |
| with rear RGB strips. |
| |
| Shenghao Yang ([email protected]), 30/12/2021 |
| Amended for code style by Adam Honse, 3/13/2022 |
\*---------------------------------------------------------*/
#include "Detector.h"
#include "AcerMonitorController.h"
#include "RGBController_AcerMonitor.h"
/*-----------------------------------------------------*\
| Acer vendor ID |
\*-----------------------------------------------------*/
#define ACER_VID 0x042E
/*-----------------------------------------------------*\
| Acer monitor product IDs |
\*-----------------------------------------------------*/
#define ACER_XB323QK_NV_PID 0xAC0B
#define ACER_XB273U_NV_PID 0xAC0C
#define ACER_X25_PID 0xAC0D
/*---------------------------------------------------------*\
| DetectAcerMonitorControllers |
| |
| Detects Acer monitor controllers. |
| |
| info: HID device information. |
\*---------------------------------------------------------*/
void DetectAcerMonitorControllers(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
AcerMonitorController* controller = new AcerMonitorController(dev, info->path);
RGBController_AcerMonitor* rgb_controller = new RGBController_AcerMonitor(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
REGISTER_HID_DETECTOR("Acer XB323QK NV", DetectAcerMonitorControllers, ACER_VID, ACER_XB323QK_NV_PID);
REGISTER_HID_DETECTOR("Acer XB273U NV", DetectAcerMonitorControllers, ACER_VID, ACER_XB273U_NV_PID );
REGISTER_HID_DETECTOR("Acer X25", DetectAcerMonitorControllers, ACER_VID, ACER_X25_PID );
@@ -0,0 +1,111 @@
/*---------------------------------------------------------*\
| RGBController_AcerMonitor.cpp |
| |
| RGBController interface implementation for 2020/2021 |
| Acer monitors with rear RGB strips. |
| |
| Shenghao Yang ([email protected]), 30/12/2021 |
| Amended for code style by Adam Honse, 3/13/2022 |
\*---------------------------------------------------------*/
#include "RGBController_AcerMonitor.h"
RGBController_AcerMonitor::RGBController_AcerMonitor(AcerMonitorController* controller_ptr)
{
controller = controller_ptr;
vendor = "Acer";
type = DEVICE_TYPE_LEDSTRIP;
description = "Acer Monitor Device";
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = 0;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
SetupZones();
}
RGBController_AcerMonitor::~RGBController_AcerMonitor()
{
delete controller;
}
void RGBController_AcerMonitor::SetupZones()
{
zones.clear();
leds.clear();
// for(const auto *const *pz{ctrl->monitor->zones}; *pz; ++pz)
// {
// const Zone *z{*pz};
// zone led_zone;
// led_zone.leds_count = z->leds;
// led_zone.leds_max = led_zone.leds_count;
// led_zone.leds_min = led_zone.leds_count;
// led_zone.name = z->name;
// led_zone.type = z->type;
// led_zone.matrix_map = z->mmap;
// for (std::size_t i{}; i < z->leds; ++i)
// {
// led new_led{};
// new_led.name = led_zone.name + " LED ";
// if (led_zone.leds_count > 1)
// new_led.name.append(std::to_string(i + 1));
// leds.emplace_back(new_led);
// }
// zones.emplace_back(led_zone);
// }
SetupColors();
}
void RGBController_AcerMonitor::ResizeZone(int, int)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_AcerMonitor::DeviceUpdateLEDs()
{
// for (std::size_t i{}; i < zones.size(); ++i)
// UpdateZoneLEDs(i);
}
void RGBController_AcerMonitor::UpdateZoneLEDs(int zone)
{
//controller->SetLEDs(zone, zones[zone].colors);
}
void RGBController_AcerMonitor::UpdateSingleLED(int led)
{
// /*-----------------------------------------------------*\
// | Find the zone that the LED exists in. |
// \*-----------------------------------------------------*/
// std::size_t total{};
// int zone{};
// while (static_cast<std::size_t>(led) >= total)
// total += zones[zone++].leds_count;
// --zone;
// ctrl->SetLEDs(zone, zones[zone].colors);
}
void RGBController_AcerMonitor::SetCustomMode()
{
active_mode = 0;
}
void RGBController_AcerMonitor::DeviceUpdateMode()
{
}
@@ -0,0 +1,35 @@
/*---------------------------------------------------------*\
| RGBController_AcerMonitor.h |
| |
| RGBController interface implementation for 2020/2021 |
| Acer monitors with rear RGB strips. |
| |
| Shenghao Yang ([email protected]), 30/12/2021 |
| Amended for code style by Adam Honse, 3/13/2022 |
\*---------------------------------------------------------*/
#pragma once
#include "RGBController.h"
#include "AcerMonitorController.h"
class RGBController_AcerMonitor : public RGBController
{
public:
RGBController_AcerMonitor(AcerMonitorController* controller_ptr);
~RGBController_AcerMonitor();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
AcerMonitorController* controller;
};
@@ -45,9 +45,9 @@ typedef struct
const char * name;
const unsigned char zone;
const unsigned char idx;
} led_type;
} aw510k_led_type;
static const led_type led_names[] =
static const aw510k_led_type led_names[] =
{
/* Key Label Zone, Index */
{ KEY_EN_ESCAPE, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xB0 },
@@ -40,9 +40,9 @@ typedef struct
{
const char * name;
const unsigned char idx;
} led_type;
} annepro2_led_type;
static const led_type led_names[] =
static const annepro2_led_type led_names[] =
{
/* Key Label Index */
{ KEY_EN_ESCAPE, 0 },
@@ -9,6 +9,8 @@
#include "AsusAuraCoreLaptopController.h"
#include "SettingsManager.h"
static uint8_t packet_map[ASUSAURACORELAPTOP_KEYCOUNT +
ASUSAURACORELAPTOP_LIGHTBARCOUNT +
ASUSAURACORELAPTOP_LIDCOUNT ] =
@@ -406,6 +406,8 @@ void RGBController_AsusAuraCoreLaptop::Init_Controller()
lightbar.leds_min = ASUSAURACORELAPTOP_LIGHTBARCOUNT;
lightbar.leds_max = ASUSAURACORELAPTOP_LIGHTBARCOUNT;
lightbar.leds_count = ASUSAURACORELAPTOP_LIGHTBARCOUNT;
lightbar.matrix_map = NULL;
zones.push_back(lightbar);
zone lid;
@@ -414,6 +416,8 @@ void RGBController_AsusAuraCoreLaptop::Init_Controller()
lid.leds_min = ASUSAURACORELAPTOP_LIDCOUNT;
lid.leds_max = ASUSAURACORELAPTOP_LIDCOUNT;
lid.leds_count = ASUSAURACORELAPTOP_LIDCOUNT;
lid.matrix_map = NULL;
zones.push_back(lid);
}
@@ -15,6 +15,7 @@ AuraMainboardController::AuraMainboardController(hid_device* dev_handle, const c
unsigned char num_total_mainboard_leds = config_table[0x1B];
unsigned char num_rgb_headers = config_table[0x1D];
unsigned char num_addressable_headers = config_table[0x02];
unsigned char effect_channel = 0;
if(num_total_mainboard_leds < num_rgb_headers)
{
@@ -24,14 +25,18 @@ AuraMainboardController::AuraMainboardController(hid_device* dev_handle, const c
/*-----------------------------------------------------*\
| Add mainboard device |
\*-----------------------------------------------------*/
device_info.push_back({0x00, 0x04, num_total_mainboard_leds, num_rgb_headers, AuraDeviceType::FIXED});
if(num_total_mainboard_leds > 0)
{
device_info.push_back({effect_channel, 0x04, num_total_mainboard_leds, num_rgb_headers, AuraDeviceType::FIXED});
effect_channel++;
}
/*-----------------------------------------------------*\
| Add addressable devices |
\*-----------------------------------------------------*/
for(int i = 0; i < num_addressable_headers; i++)
{
device_info.push_back({0x01, (unsigned char)i, 0x01, 0, AuraDeviceType::ADDRESSABLE});
device_info.push_back({effect_channel, (unsigned char)i, 0x01, 0, AuraDeviceType::ADDRESSABLE});
}
}
@@ -72,13 +72,15 @@ std::string AuraTUFKeyboardController::GetVersion()
hid_read(dev, usb_buf_out, 65);
char version[9];
if(device_pid == AURA_TUF_K3_GAMING_PID)
switch(device_pid)
{
snprintf(version, 9, "%02X.%02X.%02X", usb_buf_out[6], usb_buf_out[5], usb_buf_out[4]);
}
else
{
snprintf(version, 9, "%02X.%02X.%02X", usb_buf_out[5], usb_buf_out[6], usb_buf_out[7]);
case AURA_TUF_K3_GAMING_PID:
case AURA_ROG_STRIX_FLARE_II_ANIMATE_PID:
snprintf(version, 9, "%02X.%02X.%02X", usb_buf_out[6], usb_buf_out[5], usb_buf_out[4]);
break;
default:
snprintf(version, 9, "%02X.%02X.%02X", usb_buf_out[5], usb_buf_out[6], usb_buf_out[7]);
}
return std::string(version);
@@ -33,13 +33,14 @@ enum
enum
{
AURA_ROG_FALCHION_WIRED_PID = 0x193C,
AURA_ROG_FALCHION_WIRELESS_PID = 0x193E,
AURA_TUF_K1_GAMING_PID = 0x1945,
AURA_TUF_K3_GAMING_PID = 0x194B,
AURA_TUF_K5_GAMING_PID = 0x1899,
AURA_TUF_K7_GAMING_PID = 0x18AA,
AURA_ROG_CLAYMORE_PID = 0x184D,
AURA_ROG_FALCHION_WIRED_PID = 0x193C,
AURA_ROG_FALCHION_WIRELESS_PID = 0x193E,
AURA_ROG_STRIX_FLARE_II_ANIMATE_PID = 0x19FC,
AURA_TUF_K1_GAMING_PID = 0x1945,
AURA_TUF_K3_GAMING_PID = 0x194B,
AURA_TUF_K5_GAMING_PID = 0x1899,
AURA_TUF_K7_GAMING_PID = 0x18AA,
AURA_ROG_CLAYMORE_PID = 0x184D,
};
struct led_color
@@ -81,6 +81,28 @@ static unsigned int ASUS_TUF_K7_LAYOUT_KEYS_UK[6][24] =
{ 5, 8, 14, NA, NA, NA, 34, NA, NA, NA, 55, 61, 66, NA, 74, NA, 78, 83, 87, NA, 92, NA, 101, NA }
};
static unsigned int ASUS_ROG_STRIX_FLARE_II_LAYOUT_KEYS_US[7][30] =
{
{ 0, NA, 8, 14, 19, 24, NA, 34, 39, 44, 49, 55, 61, 66, 70, NA, NA, NA, NA, 74, 78, 83, NA, NA, NA, NA, NA, NA, NA, NA },
{ 1, 6, 9, 15, 20, 25, 29, 35, 40, 45, 50, 56, 62, 67, NA, NA, NA, NA, NA, 75, 79, 84, NA, NA, NA, NA, 87, 92, 96, 101 },
{ 2, NA, 10, 16, 21, 26, 30, 36, 41, 46, 51, 57, 63, 68, 71, NA, NA, NA, NA, 76, 80, 85, NA, NA, NA, NA, 88, 93, 97, 102 },
{ 3, NA, 11, 17, 22, 27, 31, 37, 42, 47, 52, 58, 64, NA, 72, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 89, 94, 98, NA },
{ 4, NA, 12, 18, 23, 28, 32, 38, 43, 48, 53, 59, NA, 69, NA, NA, NA, NA, NA, NA, 81, NA, NA, NA, NA, NA, 90, 95, 99, 103 },
{ 5, 7, 13, NA, NA, NA, 33, NA, NA, NA, 54, 60, 65, NA, 73, NA, NA, NA, NA, 77, 82, 86, NA, NA, NA, NA, 91, NA, 100, NA },
{ 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133 }
};
static unsigned int ASUS_ROG_STRIX_FLARE_II_LAYOUT_KEYS_UK[7][30] =
{
{ 0, NA, 9, 15, 20, 25, NA, 35, 40, 45, 50, 56, 62, 67, 72, NA, NA, NA, NA, 75, 79, 84, NA, NA, NA, NA, NA, NA, NA, NA },
{ 1, 6, 10, 16, 21, 26, 30, 36, 41, 46, 51, 57, 63, 68, NA, NA, NA, NA, NA, 76, 80, 85, NA, NA, NA, NA, 88, 93, 97, 102 },
{ 2, NA, 11, 17, 22, 27, 31, 37, 42, 47, 52, 58, 64, 69, NA, NA, NA, NA, NA, 77, 81, 86, NA, NA, NA, NA, 89, 94, 98, 103 },
{ 3, NA, 12, 18, 23, 28, 32, 38, 43, 48, 53, 59, 65, 70, 73, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 90, 95, 99, NA },
{ 4, 7, 13, 19, 24, 29, 33, 39, 44, 49, 54, 60, NA, 71, NA, NA, NA, NA, NA, NA, 82, NA, NA, NA, NA, NA, 91, 96, 100, 104 },
{ 5, 8, 14, NA, NA, NA, 34, NA, NA, NA, 55, 61, 66, NA, 74, NA, NA, NA, NA, 78, 83, 87, NA, NA, NA, NA, 92, NA, 101, NA },
{ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134 }
};
static unsigned int ASUS_FALCHION_LAYOUT_KEYS_US[5][16] =
{
{ 0, 5, 7, 12, 16, 20, 24, 29, 33, 37, 41, 46, 51, 56, NA, 63 },
@@ -447,6 +469,345 @@ static std::map<int,layout_info> AsusTUFK7Layouts =
},
};
static std::map<int,layout_info> AsusROGStrixFlareIILayouts =
{
{
ASUS_TUF_K7_LAYOUT_UK,
{
*ASUS_ROG_STRIX_FLARE_II_LAYOUT_KEYS_UK,
135,
7,
30,
{
{ KEY_EN_ESCAPE, 0x00 },
{ KEY_EN_BACK_TICK, 0x01 },
{ KEY_EN_TAB, 0x02 },
{ KEY_EN_CAPS_LOCK, 0x03 },
{ KEY_EN_LEFT_SHIFT, 0x04 },
{ KEY_EN_LEFT_CONTROL, 0x05 },
{ KEY_EN_1, 0x11 },
{ KEY_EN_ISO_BACK_SLASH, 0x0C },
{ KEY_EN_LEFT_WINDOWS, 0x15 },
{ KEY_EN_F1, 0x18 },
{ KEY_EN_2, 0x19 },
{ KEY_EN_Q, 0x12 },
{ KEY_EN_A, 0x13 },
{ KEY_EN_Z, 0x14 },
{ KEY_EN_LEFT_ALT, 0x1D },
{ KEY_EN_F2, 0x20 },
{ KEY_EN_3, 0x21 },
{ KEY_EN_W, 0x1A },
{ KEY_EN_S, 0x1B },
{ KEY_EN_X, 0x1C },
{ KEY_EN_F3, 0x28 },
{ KEY_EN_4, 0x29 },
{ KEY_EN_E, 0x22 },
{ KEY_EN_D, 0x23 },
{ KEY_EN_C, 0x24 },
{ KEY_EN_F4, 0x30 },
{ KEY_EN_5, 0x31 },
{ KEY_EN_R, 0x2A },
{ KEY_EN_F, 0x2B },
{ KEY_EN_V, 0x2C },
{ KEY_EN_6, 0x39 },
{ KEY_EN_T, 0x32 },
{ KEY_EN_G, 0x33 },
{ KEY_EN_B, 0x34 },
{ KEY_EN_SPACE, 0x35 },
{ KEY_EN_F5, 0x40 },
{ KEY_EN_7, 0x41 },
{ KEY_EN_Y, 0x3A },
{ KEY_EN_H, 0x3B },
{ KEY_EN_N, 0x3C },
{ KEY_EN_F6, 0x48 },
{ KEY_EN_8, 0x49 },
{ KEY_EN_U, 0x42 },
{ KEY_EN_J, 0x43 },
{ KEY_EN_M, 0x44 },
{ KEY_EN_F7, 0x50 },
{ KEY_EN_9, 0x51 },
{ KEY_EN_I, 0x4A },
{ KEY_EN_K, 0x4B },
{ KEY_EN_COMMA, 0x4C },
{ KEY_EN_F8, 0x58 },
{ KEY_EN_0, 0x59 },
{ KEY_EN_O, 0x52 },
{ KEY_EN_L, 0x53 },
{ KEY_EN_PERIOD, 0x54 },
{ KEY_EN_RIGHT_ALT, 0x4D },
{ KEY_EN_F9, 0x60 },
{ KEY_EN_MINUS, 0x61 },
{ KEY_EN_P, 0x5A },
{ KEY_EN_SEMICOLON, 0x5B },
{ KEY_EN_FORWARD_SLASH, 0x5C },
{ KEY_EN_RIGHT_FUNCTION, 0x5D },
{ KEY_EN_F10, 0x68 },
{ KEY_EN_EQUALS, 0x69 },
{ KEY_EN_LEFT_BRACKET, 0x62 },
{ KEY_EN_QUOTE, 0x63 },
{ KEY_EN_MENU, 0x65 },
{ KEY_EN_F11, 0x70 },
{ KEY_EN_BACKSPACE, 0x79 },
{ KEY_EN_RIGHT_BRACKET, 0x6A },
{ KEY_EN_POUND, 0x6B },
{ KEY_EN_RIGHT_SHIFT, 0x7C },
{ KEY_EN_F12, 0x78 },
{ KEY_EN_ISO_ENTER, 0x7B },
{ KEY_EN_RIGHT_CONTROL, 0x7D },
{ KEY_EN_PRINT_SCREEN, 0x80 },
{ KEY_EN_INSERT, 0x81 },
{ KEY_EN_DELETE, 0x82 },
{ KEY_EN_LEFT_ARROW, 0x85 },
{ KEY_EN_SCROLL_LOCK, 0x88 },
{ KEY_EN_HOME, 0x89 },
{ KEY_EN_END, 0x8A },
{ KEY_EN_UP_ARROW, 0x8C },
{ KEY_EN_DOWN_ARROW, 0x8D },
{ KEY_EN_PAUSE_BREAK, 0x90 },
{ KEY_EN_PAGE_UP, 0x91 },
{ KEY_EN_PAGE_DOWN, 0x92 },
{ KEY_EN_RIGHT_ARROW, 0x95 },
{ KEY_EN_NUMPAD_LOCK, 0x99 },
{ KEY_EN_NUMPAD_7, 0x9A },
{ KEY_EN_NUMPAD_4, 0x9B },
{ KEY_EN_NUMPAD_1, 0x9C },
{ KEY_EN_NUMPAD_0, 0x9D },
{ KEY_EN_NUMPAD_DIVIDE, 0xA1 },
{ KEY_EN_NUMPAD_8, 0xA2 },
{ KEY_EN_NUMPAD_5, 0xA3 },
{ KEY_EN_NUMPAD_2, 0xA4 },
{ KEY_EN_NUMPAD_TIMES, 0xA9 },
{ KEY_EN_NUMPAD_9, 0xAA },
{ KEY_EN_NUMPAD_6, 0xAB },
{ KEY_EN_NUMPAD_3, 0xAC },
{ KEY_EN_NUMPAD_PERIOD, 0xAD },
{ KEY_EN_NUMPAD_MINUS, 0xB1 },
{ KEY_EN_NUMPAD_PLUS, 0xB2 },
{ KEY_EN_NUMPAD_ENTER, 0xB4 },
{ "Underglow LED 1", 0x06 },
{ "Underglow LED 2", 0x0E },
{ "Underglow LED 3", 0x16 },
{ "Underglow LED 4", 0x1E },
{ "Underglow LED 5", 0x26 },
{ "Underglow LED 6", 0x2E },
{ "Underglow LED 7", 0x36 },
{ "Underglow LED 8", 0x3E },
{ "Underglow LED 9", 0x46 },
{ "Underglow LED 10", 0x4E },
{ "Underglow LED 11", 0x56 },
{ "Underglow LED 12", 0x5E },
{ "Underglow LED 13", 0x66 },
{ "Underglow LED 14", 0x6E },
{ "Underglow LED 15", 0x76 },
{ "Underglow LED 16", 0x7E },
{ "Underglow LED 17", 0x86 },
{ "Underglow LED 18", 0x8E },
{ "Underglow LED 19", 0x96 },
{ "Underglow LED 20", 0x9E },
{ "Underglow LED 21", 0xA6 },
{ "Underglow LED 22", 0xAE },
{ "Underglow LED 23", 0xB6 },
{ "Underglow LED 24", 0xBE },
{ "Underglow LED 25", 0xC6 },
{ "Underglow LED 26", 0xCE },
{ "Underglow LED 27", 0xD6 },
{ "Underglow LED 28", 0xDE },
{ "Underglow LED 29", 0xE6 },
{ "Underglow LED 30", 0xEE },
}
}
},
{
ASUS_TUF_K7_LAYOUT_US,
{
*ASUS_ROG_STRIX_FLARE_II_LAYOUT_KEYS_US,
134,
7,
30,
{
{ KEY_EN_ESCAPE, 0x00 },
{ KEY_EN_BACK_TICK, 0x01 },
{ KEY_EN_TAB, 0x02 },
{ KEY_EN_CAPS_LOCK, 0x03 },
{ KEY_EN_LEFT_SHIFT, 0x04 },
{ KEY_EN_LEFT_CONTROL, 0x05 },
{ KEY_EN_1, 0x11 },
{ KEY_EN_LEFT_WINDOWS, 0x15 },
{ KEY_EN_F1, 0x18 },
{ KEY_EN_2, 0x19 },
{ KEY_EN_Q, 0x12 },
{ KEY_EN_A, 0x13 },
{ KEY_EN_Z, 0x14 },
{ KEY_EN_LEFT_ALT, 0x1D },
{ KEY_EN_F2, 0x20 },
{ KEY_EN_3, 0x21 },
{ KEY_EN_W, 0x1A },
{ KEY_EN_S, 0x1B },
{ KEY_EN_X, 0x1C },
{ KEY_EN_F3, 0x28 },
{ KEY_EN_4, 0x29 },
{ KEY_EN_E, 0x22 },
{ KEY_EN_D, 0x23 },
{ KEY_EN_C, 0x24 },
{ KEY_EN_F4, 0x30 },
{ KEY_EN_5, 0x31 },
{ KEY_EN_R, 0x2A },
{ KEY_EN_F, 0x2B },
{ KEY_EN_V, 0x2C },
{ KEY_EN_6, 0x39 },
{ KEY_EN_T, 0x32 },
{ KEY_EN_G, 0x33 },
{ KEY_EN_B, 0x34 },
{ KEY_EN_SPACE, 0x35 },
{ KEY_EN_F5, 0x40 },
{ KEY_EN_7, 0x41 },
{ KEY_EN_Y, 0x3A },
{ KEY_EN_H, 0x3B },
{ KEY_EN_N, 0x3C },
{ KEY_EN_F6, 0x48 },
{ KEY_EN_8, 0x49 },
{ KEY_EN_U, 0x42 },
{ KEY_EN_J, 0x43 },
{ KEY_EN_M, 0x44 },
{ KEY_EN_F7, 0x50 },
{ KEY_EN_9, 0x51 },
{ KEY_EN_I, 0x4A },
{ KEY_EN_K, 0x4B },
{ KEY_EN_COMMA, 0x4C },
{ KEY_EN_F8, 0x58 },
{ KEY_EN_0, 0x59 },
{ KEY_EN_O, 0x52 },
{ KEY_EN_L, 0x53 },
{ KEY_EN_PERIOD, 0x54 },
{ KEY_EN_RIGHT_ALT, 0x4D },
{ KEY_EN_F9, 0x60 },
{ KEY_EN_MINUS, 0x61 },
{ KEY_EN_P, 0x5A },
{ KEY_EN_SEMICOLON, 0x5B },
{ KEY_EN_FORWARD_SLASH, 0x5C },
{ KEY_EN_RIGHT_FUNCTION, 0x5D },
{ KEY_EN_F10, 0x68 },
{ KEY_EN_EQUALS, 0x69 },
{ KEY_EN_LEFT_BRACKET, 0x62 },
{ KEY_EN_QUOTE, 0x63 },
{ KEY_EN_MENU, 0x65 },
{ KEY_EN_F11, 0x70 },
{ KEY_EN_BACKSPACE, 0x79 },
{ KEY_EN_RIGHT_BRACKET, 0x6A },
{ KEY_EN_RIGHT_SHIFT, 0x7C },
{ KEY_EN_F12, 0x78 },
{ KEY_EN_ANSI_BACK_SLASH, 0x7A },
{ KEY_EN_ANSI_ENTER, 0x7B },
{ KEY_EN_RIGHT_CONTROL, 0x7D },
{ KEY_EN_PRINT_SCREEN, 0x80 },
{ KEY_EN_INSERT, 0x81 },
{ KEY_EN_DELETE, 0x82 },
{ KEY_EN_LEFT_ARROW, 0x85 },
{ KEY_EN_SCROLL_LOCK, 0x88 },
{ KEY_EN_HOME, 0x89 },
{ KEY_EN_END, 0x8A },
{ KEY_EN_UP_ARROW, 0x8C },
{ KEY_EN_DOWN_ARROW, 0x8D },
{ KEY_EN_PAUSE_BREAK, 0x90 },
{ KEY_EN_PAGE_UP, 0x91 },
{ KEY_EN_PAGE_DOWN, 0x92 },
{ KEY_EN_RIGHT_ARROW, 0x95 },
{ KEY_EN_NUMPAD_LOCK, 0x99 },
{ KEY_EN_NUMPAD_7, 0x9A },
{ KEY_EN_NUMPAD_4, 0x9B },
{ KEY_EN_NUMPAD_1, 0x9C },
{ KEY_EN_NUMPAD_0, 0x9D },
{ KEY_EN_NUMPAD_DIVIDE, 0xA1 },
{ KEY_EN_NUMPAD_8, 0xA2 },
{ KEY_EN_NUMPAD_5, 0xA3 },
{ KEY_EN_NUMPAD_2, 0xA4 },
{ KEY_EN_NUMPAD_TIMES, 0xA9 },
{ KEY_EN_NUMPAD_9, 0xAA },
{ KEY_EN_NUMPAD_6, 0xAB },
{ KEY_EN_NUMPAD_3, 0xAC },
{ KEY_EN_NUMPAD_PERIOD, 0xAD },
{ KEY_EN_NUMPAD_MINUS, 0xB1 },
{ KEY_EN_NUMPAD_PLUS, 0xB2 },
{ KEY_EN_NUMPAD_ENTER, 0xB4 },
{ "Underglow LED 1", 0x06 },
{ "Underglow LED 2", 0x0E },
{ "Underglow LED 3", 0x16 },
{ "Underglow LED 4", 0x1E },
{ "Underglow LED 5", 0x26 },
{ "Underglow LED 6", 0x2E },
{ "Underglow LED 7", 0x36 },
{ "Underglow LED 8", 0x3E },
{ "Underglow LED 9", 0x46 },
{ "Underglow LED 10", 0x4E },
{ "Underglow LED 11", 0x56 },
{ "Underglow LED 12", 0x5E },
{ "Underglow LED 13", 0x66 },
{ "Underglow LED 14", 0x6E },
{ "Underglow LED 15", 0x76 },
{ "Underglow LED 16", 0x7E },
{ "Underglow LED 17", 0x86 },
{ "Underglow LED 18", 0x8E },
{ "Underglow LED 19", 0x96 },
{ "Underglow LED 20", 0x9E },
{ "Underglow LED 21", 0xA6 },
{ "Underglow LED 22", 0xAE },
{ "Underglow LED 23", 0xB6 },
{ "Underglow LED 24", 0xBE },
{ "Underglow LED 25", 0xC6 },
{ "Underglow LED 26", 0xCE },
{ "Underglow LED 27", 0xD6 },
{ "Underglow LED 28", 0xDE },
{ "Underglow LED 29", 0xE6 },
{ "Underglow LED 30", 0xEE },
}
}
},
};
static std::map<int,layout_info> AsusFalchionLayouts =
{
{
@@ -47,6 +47,7 @@
#define AURA_ROG_STRIX_FLARE_PID 0x1875
#define AURA_ROG_STRIX_FLARE_PNK_LTD_PID 0x18CF
#define AURA_ROG_STRIX_FLARE_COD_BO4_PID 0x18AF
#define AURA_ROG_STRIX_FLARE_II_ANIMATE_PID 0x19FC
#define AURA_ROG_STRIX_SCOPE_PID 0x18F8
#define AURA_ROG_STRIX_SCOPE_RX_PID 0x1951
#define AURA_ROG_STRIX_SCOPE_TKL_PID 0x190C
@@ -335,6 +336,7 @@ REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Scope TKL PNK LTD", DetectAs
REGISTER_HID_DETECTOR_IP("ASUS ROG Claymore", DetectAsusAuraTUFUSBKeyboard, AURA_USB_VID, AURA_ROG_CLAYMORE_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Falchion (Wired)", DetectAsusAuraTUFUSBKeyboard, AURA_USB_VID, AURA_ROG_FALCHION_WIRED_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Falchion (Wireless)", DetectAsusAuraTUFUSBKeyboard, AURA_USB_VID, AURA_ROG_FALCHION_WIRELESS_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Flare II Animate", DetectAsusAuraTUFUSBKeyboard, AURA_USB_VID, AURA_ROG_STRIX_FLARE_II_ANIMATE_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS TUF Gaming K1", DetectAsusAuraTUFUSBKeyboard, AURA_USB_VID, AURA_TUF_K1_GAMING_PID, 2, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS TUF Gaming K3", DetectAsusAuraTUFUSBKeyboard, AURA_USB_VID, AURA_TUF_K3_GAMING_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS TUF Gaming K5", DetectAsusAuraTUFUSBKeyboard, AURA_USB_VID, AURA_TUF_K5_GAMING_PID, 2, 0xFF00);
@@ -44,7 +44,7 @@ static unsigned int falchion_matrix_map[5][16] =
{ 3, NA, 12, 17, 21, 25, 29, 34, 38, 42, 47, 52, 56, NA, 61, 66 },
{ 4, 8, 13, NA, NA, NA, 30, NA, NA, NA, 43, 48, 53, 57, 62, 67 } };
static const std::vector<led_type> default_led_names =
static const std::vector<aura_keyboard_led> default_led_names =
{
/* Key Label Index */
{ KEY_EN_ESCAPE, 0x00 },
@@ -153,7 +153,7 @@ static const std::vector<led_type> default_led_names =
{ KEY_EN_NUMPAD_ENTER, 0xB4 },
};
static const std::vector<led_type> default_tkl_led_names =
static const std::vector<aura_keyboard_led> default_tkl_led_names =
{
/* Key Label Index */
{ KEY_EN_ESCAPE, 0x00 },
@@ -270,7 +270,7 @@ static const std::vector<led_type> default_tkl_led_names =
{ "Underglow 26", 0xCE },
};
static const std::vector<led_type> default_65pct_led_names =
static const std::vector<aura_keyboard_led> default_65pct_led_names =
{
/* Key Label Index */
{ KEY_EN_ESCAPE, 0x00 },
@@ -395,7 +395,7 @@ void RGBController_AuraKeyboard::SetupZones()
| Set up zones |
\*---------------------------------------------------------*/
std::vector<led_zone> led_zones;
std::vector<led_type> led_names;
std::vector<aura_keyboard_led> led_names;
switch(layout)
{
@@ -24,7 +24,7 @@ typedef struct
{
const char* name;
unsigned char idx;
} led_type;
} aura_keyboard_led;
typedef struct
{
@@ -62,6 +62,7 @@ RGBController_AuraTUFKeyboard::RGBController_AuraTUFKeyboard(AuraTUFKeyboardCont
break;
case AURA_ROG_FALCHION_WIRED_PID:
case AURA_ROG_FALCHION_WIRELESS_PID:
case AURA_ROG_STRIX_FLARE_II_ANIMATE_PID:
AURA_KEYBOARD_SPEED_MIN = 255;
AURA_KEYBOARD_SPEED_MAX = 0;
AURA_KEYBOARD_SPEED_DEFAULT = 8;
@@ -400,6 +401,9 @@ void RGBController_AuraTUFKeyboard::SetupZones()
case AURA_TUF_K7_GAMING_PID:
keyboard_ptr = &AsusTUFK7Layouts;
break;
case AURA_ROG_STRIX_FLARE_II_ANIMATE_PID:
keyboard_ptr = &AsusROGStrixFlareIILayouts;
break;
case AURA_ROG_FALCHION_WIRED_PID:
case AURA_ROG_FALCHION_WIRELESS_PID:
keyboard_ptr = &AsusFalchionLayouts;
@@ -564,7 +568,7 @@ void RGBController_AuraTUFKeyboard::DeviceUpdateMode()
color_mode = 1;
}
if(modes[active_mode].value == AURA_KEYBOARD_MODE_WAVE)
if(modes[active_mode].value == AURA_KEYBOARD_MODE_WAVE || modes[active_mode].value == AURA_KEYBOARD_MODE_QUICKSAND)
{
/*----------------------------------------------------------*\
| converting openrgb direction value to keyboard directions |
@@ -42,8 +42,10 @@ REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectCo
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3070_ADVANCED_OCV, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_TI_ADVANCED_OC, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3070 Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3070_ADVANCED_OCV, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3070 Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3070_ADVANCED_OCV2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3070 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3070_ULTRAW_OC, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3070 Ultra W OC LHR", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3070_ULTRAW_OC, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3070 Ti Ultra W OC LHR", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3070_TI_ULTRAW_OC, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3070 Ti Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3070_TI_ADVANCED_OCV2, 0x61);
@@ -2,9 +2,11 @@
#include "CorsairDominatorPlatinumController.h"
#include "RGBController.h"
#include "RGBController_CorsairDominatorPlatinum.h"
#include "SettingsManager.h"
#include "LogManager.h"
#include "i2c_smbus.h"
#include "pci_ids.h"
#include "LogManager.h"
#include <vector>
#include <stdio.h>
#include <stdlib.h>
@@ -389,11 +389,15 @@ REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX 3090 O24G GAMING", DetectEN
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX 3090 O24G GAMING White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3090_O24G_GAMING_WHITE, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF RTX 3090 O24G", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_3090_O24G, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF RTX 3090 O24G OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_3090_O24G_OC, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF RTX 3090Ti 24G GAMING", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3090TI_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_3090TI_24G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF RTX 3090Ti O24G OC GAMING", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3090TI_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_3090TI_O24G_OC_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF RTX 4070 O12G Gaming", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4070_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_4070_O12G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF RTX 4070 Ti 12G Gaming", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4070TI_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_4070TI_12G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF RTX 4070 Ti O12G Gaming", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4070TI_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_4070TI_O12G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 4080 16G GAMING", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_4080_16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 4080 O16G GAMING", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_4080_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF RTX 4080 16G GAMING", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_4080_16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF RTX 4080 16G GAMING", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_4080_16G_GAMING_2, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF RTX 4080 O16G GAMING", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_4080_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF RTX 4080 O16G OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_4080_O16G_OC_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF RTX 4090 O24G OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_4090_O24G_OC_GAMING, 0x67);
@@ -8,6 +8,7 @@
#include "RGBController_ENESMBus.h"
#include "LogManager.h"
#include "SettingsManager.h"
#include "ResourceManager.h"
/**------------------------------------------------------------------*\
@@ -130,7 +130,7 @@ EVGAv3_config EVGAGPUv3Controller::GetZoneConfig(uint8_t zone, uint8_t mode)
}
}
break;
case EVGA_GPU_V3_MODE_BREATHING:
{
uint8_t result = bus->i2c_smbus_read_i2c_block_data(dev, EVGA_GPU_V3_REG_BREATHING + zone, 10, data_pkt);
@@ -147,8 +147,8 @@ EVGAv3_config EVGAGPUv3Controller::GetZoneConfig(uint8_t zone, uint8_t mode)
uint8_t blue2 = data_pkt[7];
zone_config.colors[1] = ToRGBColor(red2, green2, blue2);
zone_config.numberOfColors= (zone_config.colors[1] != 0 ) ? 2 : 1 ;
speed16.LSB = data_pkt[8];
speed16.MSB = data_pkt[9];
speed16.lsb = data_pkt[8];
speed16.msb = data_pkt[9];
zone_config.speed = speed16.u16;
zone_config.direction = 0;
}
@@ -169,8 +169,8 @@ EVGAv3_config EVGAGPUv3Controller::GetZoneConfig(uint8_t zone, uint8_t mode)
//Load data
zone_config.brightness = data_pkt[1];
zone_config.numberOfColors = 0;
speed16.LSB = data_pkt[2];
speed16.MSB = data_pkt[3];
speed16.lsb = data_pkt[2];
speed16.msb = data_pkt[3];
zone_config.speed = speed16.u16;
}
else
@@ -192,8 +192,8 @@ EVGAv3_config EVGAGPUv3Controller::GetZoneConfig(uint8_t zone, uint8_t mode)
uint8_t blue = data_pkt[4];
zone_config.colors[0] = ToRGBColor(red, green, blue);
zone_config.numberOfColors = 1;
speed16.LSB = data_pkt[5];
speed16.MSB = data_pkt[6];
speed16.lsb = data_pkt[5];
speed16.msb = data_pkt[6];
zone_config.speed = speed16.u16;
}
else
@@ -230,7 +230,7 @@ EVGAv3_config EVGAGPUv3Controller::GetZoneConfig(uint8_t zone, uint8_t mode)
{
readFail = true;
}
}
else
{
@@ -257,11 +257,11 @@ EVGAv3_config EVGAGPUv3Controller::GetZoneConfig(uint8_t zone, uint8_t mode)
uint8_t blue = data_pkt[(color_index * 4) + 4];
zone_config.colors[color_index] = ToRGBColor(red, green, blue);
}
speed16.LSB = data_pkt[29];
speed16.MSB = data_pkt[30];
speed16.lsb = data_pkt[29];
speed16.msb = data_pkt[30];
zone_config.speed = speed16.u16;
}
else
else
{
readFail = true;
}
@@ -288,7 +288,7 @@ EVGAv3_config EVGAGPUv3Controller::GetZoneConfig(uint8_t zone, uint8_t mode)
for(uint8_t i = 0; i < 7; i++)
{
zone_config.colors[i] = 0;
}
}
LOG_DEBUG("[%s] Failed while loading Zone %1d configuration from HW", evgaGPUName, zone);
}
return zone_config;
@@ -423,8 +423,8 @@ void EVGAGPUv3Controller::SetZone(uint8_t zone, uint8_t mode, EVGAv3_config zone
zone_pkt[5] = RGBGetRValue(zone_config.colors[1]);
zone_pkt[6] = RGBGetGValue(zone_config.colors[1]);
zone_pkt[7] = RGBGetBValue(zone_config.colors[1]);
zone_pkt[8] = speed16.LSB;
zone_pkt[9] = speed16.MSB;
zone_pkt[8] = speed16.lsb;
zone_pkt[9] = speed16.msb;
bus->i2c_smbus_write_i2c_block_data(dev, EVGA_GPU_V3_REG_STATIC + ((mode -1) * 4) + zone, sizeof(zone_pkt), zone_pkt);
}
@@ -439,8 +439,8 @@ void EVGAGPUv3Controller::SetZone(uint8_t zone, uint8_t mode, EVGAv3_config zone
zone_pkt[0] = sizeof(zone_pkt) - 1;
zone_pkt[1] = zone_config.brightness;
zone_pkt[2] = speed16.LSB;
zone_pkt[3] = speed16.MSB;
zone_pkt[2] = speed16.lsb;
zone_pkt[3] = speed16.msb;
bus->i2c_smbus_write_i2c_block_data(dev, EVGA_GPU_V3_REG_STATIC + ((mode -1) * 4) + zone, sizeof(zone_pkt), zone_pkt);
}
@@ -456,8 +456,8 @@ void EVGAGPUv3Controller::SetZone(uint8_t zone, uint8_t mode, EVGAv3_config zone
zone_pkt[2] = RGBGetRValue(zone_config.colors[0]);
zone_pkt[3] = RGBGetGValue(zone_config.colors[0]);
zone_pkt[4] = RGBGetBValue(zone_config.colors[0]);
zone_pkt[5] = speed16.LSB;
zone_pkt[6] = speed16.MSB;
zone_pkt[5] = speed16.lsb;
zone_pkt[6] = speed16.msb;
bus->i2c_smbus_write_i2c_block_data(dev, EVGA_GPU_V3_REG_STATIC + ((mode -1) * 4) + zone, sizeof(zone_pkt), zone_pkt);
}
@@ -480,8 +480,8 @@ void EVGAGPUv3Controller::SetZone(uint8_t zone, uint8_t mode, EVGAv3_config zone
zone_pkt[3 + color_index * 4] = RGBGetGValue(zone_config.colors[color_index]);
zone_pkt[4 + color_index * 4] = RGBGetBValue(zone_config.colors[color_index]);
}
zone_pkt[29] = speed16.LSB;
zone_pkt[30] = speed16.MSB;
zone_pkt[29] = speed16.lsb;
zone_pkt[30] = speed16.msb;
// Color Count packet construction
color_cnt_pkt[0] = sizeof(color_cnt_pkt) - 1;
@@ -27,8 +27,8 @@ union u16_to_u8
uint16_t u16;
struct
{
uint8_t LSB;
uint8_t MSB;
uint8_t lsb;
uint8_t msb;
};
};
@@ -67,7 +67,7 @@ enum //Control registers and offsets
enum //Mode values for EVGA_GPU_V3_REG_MODE
{
EVGA_GPU_V3_MODE_OFF = 0x00,
EVGA_GPU_V3_MODE_STATIC = 0x01,
EVGA_GPU_V3_MODE_STATIC = 0x01,
EVGA_GPU_V3_MODE_BREATHING = 0x02,
EVGA_GPU_V3_MODE_RAINBOW = 0x03,
EVGA_GPU_V3_MODE_COLOR_CYCLE = 0x04,
@@ -70,7 +70,7 @@ unsigned char EVGAGPUv2Controller::GetMode()
return_mode = EVGA_GPU_V2_RGB_MODE_OFF;
}
break;
case EVGA_GPU_V2_MODE_STATIC:
{
return_mode = EVGA_GPU_V2_RGB_MODE_STATIC;
@@ -87,8 +87,8 @@ unsigned char EVGAGPUv2Controller::GetMode()
{
u16_to_u8 speed_16 = { (uint16_t) 0 };
speed_16.LSB = bus->i2c_smbus_read_byte_data(dev, EVGA_GPU_V2_REG_B_TO_A_SPEED_LSB);
speed_16.MSB = bus->i2c_smbus_read_byte_data(dev, EVGA_GPU_V2_REG_B_TO_A_SPEED_MSB);
speed_16.lsb = bus->i2c_smbus_read_byte_data(dev, EVGA_GPU_V2_REG_B_TO_A_SPEED_LSB);
speed_16.msb = bus->i2c_smbus_read_byte_data(dev, EVGA_GPU_V2_REG_B_TO_A_SPEED_MSB);
if (speed_16.u16 == 0)
{
@@ -112,8 +112,8 @@ unsigned char EVGAGPUv2Controller::GetSpeed()
{
u16_to_u8 speed_16 = { (uint16_t) 0 };
speed_16.LSB = bus->i2c_smbus_read_byte_data(dev, EVGA_GPU_V2_REG_COLOR_A_ONTIME_LSB);
speed_16.MSB = bus->i2c_smbus_read_byte_data(dev, EVGA_GPU_V2_REG_COLOR_A_ONTIME_MSB);
speed_16.lsb = bus->i2c_smbus_read_byte_data(dev, EVGA_GPU_V2_REG_COLOR_A_ONTIME_LSB);
speed_16.msb = bus->i2c_smbus_read_byte_data(dev, EVGA_GPU_V2_REG_COLOR_A_ONTIME_MSB);
speed_16.u16 /= SPEED_MULTIPLIER;
@@ -235,16 +235,16 @@ void EVGAGPUv2Controller::SendMode(uint8_t mode)
void EVGAGPUv2Controller::SendSpeed(u16_to_u8 aOnTime, u16_to_u8 bOnTime, u16_to_u8 b2a, u16_to_u8 a2b, u16_to_u8 speed_un)
{
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_COLOR_B_UN_LSB, (unsigned char) speed_un.LSB );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_COLOR_B_UN_MSB, (unsigned char) speed_un.MSB );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_B_TO_A_SPEED_LSB, (unsigned char) b2a.LSB );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_B_TO_A_SPEED_MSB, (unsigned char) b2a.MSB );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_COLOR_B_ONTIME_LSB, (unsigned char) bOnTime.LSB );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_COLOR_B_ONTIME_MSB, (unsigned char) bOnTime.MSB );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_A_TO_B_SPEED_LSB, (unsigned char) a2b.LSB );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_A_TO_B_SPEED_MSB, (unsigned char) a2b.MSB );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_COLOR_A_ONTIME_LSB, (unsigned char) aOnTime.LSB );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_COLOR_A_ONTIME_MSB, (unsigned char) aOnTime.MSB );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_COLOR_B_UN_LSB, (unsigned char) speed_un.lsb );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_COLOR_B_UN_MSB, (unsigned char) speed_un.msb );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_B_TO_A_SPEED_LSB, (unsigned char) b2a.lsb );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_B_TO_A_SPEED_MSB, (unsigned char) b2a.msb );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_COLOR_B_ONTIME_LSB, (unsigned char) bOnTime.lsb );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_COLOR_B_ONTIME_MSB, (unsigned char) bOnTime.msb );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_A_TO_B_SPEED_LSB, (unsigned char) a2b.lsb );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_A_TO_B_SPEED_MSB, (unsigned char) a2b.msb );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_COLOR_A_ONTIME_LSB, (unsigned char) aOnTime.lsb );
bus->i2c_smbus_write_byte_data(dev, EVGA_GPU_V2_REG_COLOR_A_ONTIME_MSB, (unsigned char) aOnTime.msb );
}
void EVGAGPUv2Controller::SetColor(RGBColor colorA, RGBColor colorB, uint8_t brightness)
@@ -26,8 +26,8 @@ union u16_to_u8
uint16_t u16;
struct
{
uint8_t LSB;
uint8_t MSB;
uint8_t lsb;
uint8_t msb;
};
};
@@ -66,7 +66,7 @@ enum
enum
{
EVGA_GPU_V2_MODE_OFF = 0x00,
EVGA_GPU_V2_MODE_STATIC = 0x01,
EVGA_GPU_V2_MODE_STATIC = 0x01,
EVGA_GPU_V2_MODE_RAINBOW = 0x0F,
EVGA_GPU_V2_MODE_BREATHING = 0x22,
};
@@ -1,6 +1,7 @@
#include "Detector.h"
#include "FanBusController.h"
#include "RGBController_FanBus.h"
#include "SettingsManager.h"
void DetectFanBusControllers()
{
@@ -71,6 +71,7 @@ void RGBFusion2GPUController::SetZone(uint8_t zone, uint8_t mode, fusion2_config
case RGB_FUSION2_GPU_MODE_BREATHING:
{
zone_config.brightness = RGB_FUSION2_GPU_BRIGHTNESS_MAX;
SetMode(zone, mode, zone_config, mystery_flag);
}
break;
@@ -120,6 +120,7 @@ REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS RTX3080 Ti XTREME WATERFORCE 12G",
REGISTER_I2C_PCI_DETECTOR("Gigabyte RTX3090 VISION OC 24G ", DetectGigabyteRGBFusion2GPUControllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3090_VISION_OC_24G_SUB_DEV, 0x63);
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS RTX3090 XTREME WATERFORCE 24G", DetectGigabyteRGBFusion2GPUControllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3090_XTREME_WATERFORCE_SUB_DEV, 0x65);
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS RTX3090 XTREME WATERFORCE WB 24G", DetectGigabyteRGBFusion2GPUControllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3090_XTREME_WATERFORCE_WB_SUB_DEV, 0x64);
REGISTER_I2C_PCI_DETECTOR("Gigabyte RTX4070 Gaming OC 12G", DetectGigabyteRGBFusion2GPUControllers, NVIDIA_VEN, NVIDIA_RTX4070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX4070_GAMING_OC_12G, 0x71);
REGISTER_I2C_PCI_DETECTOR("Gigabyte RTX4070Ti Gaming OC 12G", DetectGigabyteRGBFusion2GPUControllers, NVIDIA_VEN, NVIDIA_RTX4070TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX4070TI_GAMING_OC_12G, 0x71);
REGISTER_I2C_PCI_DETECTOR("Gigabyte RTX4080 AERO OC 16G", DetectGigabyteRGBFusion2GPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX4080_AERO_OC_SUB_DEV, 0x71);
REGISTER_I2C_PCI_DETECTOR("Gigabyte RTX4080 Eagle OC 16G", DetectGigabyteRGBFusion2GPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX4080_EAGLE_OC_SUB_DEV, 0x71);
@@ -3,6 +3,8 @@
#include "LogManager.h"
#include "RGBController.h"
#include "RGBController_GigabyteRGBFusion2SMBus.h"
#include "SettingsManager.h"
#include "i2c_smbus.h"
#include "pci_ids.h"
#include <vector>
@@ -0,0 +1,97 @@
/*---------------------------------------------------------*\
| HYTEMousematController.cpp |
| |
| Driver for HYTE CNVS RGB mousemat controller |
| |
| Adam Honse ([email protected]), 7/18/2023 |
\*---------------------------------------------------------*/
#include "HYTEMousematController.h"
#include <cstring>
#include <iomanip>
#include <sstream>
HYTEMousematController::HYTEMousematController(libusb_device_handle* dev_handle)
{
dev = dev_handle;
/*-----------------------------------------------------*\
| Fill in location string with USB ID |
\*-----------------------------------------------------*/
libusb_device_descriptor descriptor;
libusb_get_device_descriptor(libusb_get_device(dev_handle), &descriptor);
std::stringstream location_stream;
location_stream << std::hex << std::setfill('0') << std::setw(4) << descriptor.idVendor << ":" << std::hex << std::setfill('0') << std::setw(4) << descriptor.idProduct;
location = location_stream.str();
}
HYTEMousematController::~HYTEMousematController()
{
}
std::string HYTEMousematController::GetLocation()
{
return(location);
}
void HYTEMousematController::FirmwareAnimationControl(bool enabled)
{
unsigned char serial_buf[4];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(serial_buf, 0, sizeof(serial_buf));
/*-----------------------------------------------------*\
| Set up Firmware Animation Control packet |
\*-----------------------------------------------------*/
serial_buf[0] = 0xFF;
serial_buf[1] = 0xDC;
serial_buf[2] = 0x05;
serial_buf[3] = enabled;
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
libusb_bulk_transfer(dev, HYTE_CNVS_EP_OUT, serial_buf, sizeof(serial_buf), NULL, 1000);
}
void HYTEMousematController::StreamingCommand(RGBColor* colors)
{
unsigned char serial_buf[157];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(serial_buf, 0, sizeof(serial_buf));
/*-----------------------------------------------------*\
| Set up Streaming packet |
\*-----------------------------------------------------*/
serial_buf[0] = 0xFF;
serial_buf[1] = 0xEE;
serial_buf[2] = 0x02;
serial_buf[3] = 0x01;
serial_buf[4] = 0x00;
serial_buf[5] = 0x32;
serial_buf[6] = 0x00;
/*-----------------------------------------------------*\
| Copy in colors |
\*-----------------------------------------------------*/
for(unsigned int color_idx = 0; color_idx < 50; color_idx++)
{
serial_buf[7 + (color_idx * 3)] = RGBGetGValue(colors[color_idx]);
serial_buf[8 + (color_idx * 3)] = RGBGetRValue(colors[color_idx]);
serial_buf[9 + (color_idx * 3)] = RGBGetBValue(colors[color_idx]);
}
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
libusb_bulk_transfer(dev, HYTE_CNVS_EP_OUT, serial_buf, sizeof(serial_buf), NULL, 1000);
}
@@ -0,0 +1,40 @@
/*---------------------------------------------------------*\
| HYTEMousematController.h |
| |
| Definitions for HYTE CNVS RGB mousemat controller |
| |
| Adam Honse ([email protected]), 7/18/2023 |
\*---------------------------------------------------------*/
#pragma once
#include "RGBController.h"
#include <vector>
#ifdef __FreeBSD__
#include <libusb.h>
#else
#include <libusb-1.0/libusb.h>
#endif
/*---------------------------------------------------------*\
| HYTE CNVS endpoint values |
\*---------------------------------------------------------*/
#define HYTE_CNVS_EP_IN 0x81
#define HYTE_CNVS_EP_OUT 0x01
class HYTEMousematController
{
public:
HYTEMousematController(libusb_device_handle* dev_handle);
~HYTEMousematController();
std::string GetLocation();
void FirmwareAnimationControl(bool enabled);
void StreamingCommand(RGBColor* colors);
private:
libusb_device_handle* dev;
std::string location;
};
@@ -0,0 +1,85 @@
#include "Detector.h"
#include "HYTEMousematController.h"
#include "RGBController.h"
#include "RGBController_HYTEMousemat.h"
#include <vector>
#ifdef __FreeBSD__
#include <libusb.h>
#else
#include <libusb-1.0/libusb.h>
#endif
/*-----------------------------------------------------*\
| HYTE vendor ID |
\*-----------------------------------------------------*/
#define HYTE_VID 0x3402
/*-----------------------------------------------------*\
| HYTE CNVS product IDs |
\*-----------------------------------------------------*/
#define HYTE_CNVS_HW_VER_1_PID 0x0B00
#define HYTE_CNVS_HW_VER_2_PID 0x0B01
typedef struct
{
unsigned short usb_vid;
unsigned short usb_pid;
unsigned char usb_interface;
const char * name;
} hyte_mousemat_device;
#define HYTE_MOUSEMAT_NUM_DEVICES (sizeof(device_list) / sizeof(device_list[ 0 ]))
static const hyte_mousemat_device device_list[] =
{
/*-----------------------------------------------------------------------------------------------------*\
| Mousemats |
\*-----------------------------------------------------------------------------------------------------*/
{ HYTE_VID, HYTE_CNVS_HW_VER_1_PID, 0, "HYTE CNVS" },
{ HYTE_VID, HYTE_CNVS_HW_VER_2_PID, 0, "HYTE CNVS" },
};
/******************************************************************************************\
* *
* DetectHYTEMousematControllers *
* *
* Detect devices supported by the HyteMousemat driver *
* *
\******************************************************************************************/
void DetectHYTEMousematControllers()
{
libusb_init(NULL);
#ifdef _WIN32
libusb_set_option(NULL, LIBUSB_OPTION_USE_USBDK);
#endif
for(std::size_t device_idx = 0; device_idx < HYTE_MOUSEMAT_NUM_DEVICES; device_idx++)
{
libusb_device_handle * dev = libusb_open_device_with_vid_pid(NULL, device_list[device_idx].usb_vid, device_list[device_idx].usb_pid);
//Look for HYTE CNVS
if(dev)
{
libusb_detach_kernel_driver(dev, 0);
libusb_claim_interface(dev, 0);
HYTEMousematController * controller = new HYTEMousematController(dev);
RGBController_HYTEMousemat * rgb_controller = new RGBController_HYTEMousemat(controller);
rgb_controller->name = device_list[device_idx].name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
} /* DetectHYTEMousematControllers() */
REGISTER_DETECTOR("HYTE Mousemat", DetectHYTEMousematControllers);
/*---------------------------------------------------------------------------------------------------------*\
| Entries for dynamic UDEV rules |
| |
| DUMMY_DEVICE_DETECTOR("HYTE Mousemat", DetectHYTEMousematControllers, 0x3402, 0x0B00 ) |
| DUMMY_DEVICE_DETECTOR("HYTE Mousemat", DetectHYTEMousematControllers, 0x3402, 0x0B01 ) |
\*---------------------------------------------------------------------------------------------------------*/
@@ -0,0 +1,103 @@
/*-----------------------------------------*\
| RGBController_HYTEMousemat.cpp |
| |
| Generic RGB Interface for HYTE CNVS RGB |
| mousemat |
| |
| Adam Honse (CalcProgrammer1) 7/18/2023 |
\*-----------------------------------------*/
#include "RGBController_HYTEMousemat.h"
RGBController_HYTEMousemat::RGBController_HYTEMousemat(HYTEMousematController* controller_ptr)
{
controller = controller_ptr;
name = "HYTE Mousemat";
description = "HYTE Mousemat Device";
type = DEVICE_TYPE_MOUSEMAT;
location = controller->GetLocation();
mode Direct;
Direct.name = "Direct";
Direct.value = HYTE_CNVS_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
// HYTE CNVS does not seem to be able to transfer back into firmware animation
// after streaming command has been used
//mode Rainbow;
//Rainbow.name = "Rainbow Wave";
//Rainbow.value = HYTE_CNVS_MODE_RAINBOW;
//Rainbow.flags = MODE_FLAG_HAS_RANDOM_COLOR;
//Rainbow.color_mode = MODE_COLORS_RANDOM;
//modes.push_back(Rainbow);
SetupZones();
}
RGBController_HYTEMousemat::~RGBController_HYTEMousemat()
{
}
void RGBController_HYTEMousemat::SetupZones()
{
zone mousemat_zone;
mousemat_zone.name = "Mousemat";
mousemat_zone.type = ZONE_TYPE_LINEAR;
mousemat_zone.leds_min = 50;
mousemat_zone.leds_max = 50;
mousemat_zone.leds_count = 50;
mousemat_zone.matrix_map = NULL;
zones.push_back(mousemat_zone);
for(unsigned int led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
{
led mousemat_led;
mousemat_led.name = "Mousemat LED ";
mousemat_led.name.append(std::to_string(led_idx));
leds.push_back(mousemat_led);
}
SetupColors();
}
void RGBController_HYTEMousemat::ResizeZone(int /*zone*/, int /*new_size*/)
{
}
void RGBController_HYTEMousemat::DeviceUpdateLEDs()
{
controller->StreamingCommand(&colors[0]);
}
void RGBController_HYTEMousemat::UpdateZoneLEDs(int /*zone*/)
{
}
void RGBController_HYTEMousemat::UpdateSingleLED(int /*led*/)
{
}
void RGBController_HYTEMousemat::DeviceUpdateMode()
{
switch(modes[active_mode].value)
{
case HYTE_CNVS_MODE_DIRECT:
controller->FirmwareAnimationControl(false);
break;
case HYTE_CNVS_MODE_RAINBOW:
controller->FirmwareAnimationControl(true);
break;
}
}
@@ -0,0 +1,38 @@
/*-----------------------------------------*\
| RGBController_HYTEMousemat.h |
| |
| Generic RGB Interface for HYTE CNVS RGB |
| mousemat |
| |
| Adam Honse (CalcProgrammer1) 7/18/2023 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "HYTEMousematController.h"
enum
{
HYTE_CNVS_MODE_DIRECT = 0, /* Direct (streaming) mode */
HYTE_CNVS_MODE_RAINBOW = 1, /* Rainbow wave (firmware animation) mode */
};
class RGBController_HYTEMousemat : public RGBController
{
public:
RGBController_HYTEMousemat(HYTEMousematController* controller_ptr);
~RGBController_HYTEMousemat();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
private:
HYTEMousematController* controller;
};
@@ -28,6 +28,7 @@
#define HYPERX_QS_PID_HP_2 0x068C
#define HYPERX_QS_PID_HP_3 0x0294
#define HYPERX_QS_PID_HP_4 0x028C
#define HYPERX_QS_PID_HP_5 0x048C
#define HYPERX_DUOCAST_PID 0x098C
@@ -50,4 +51,5 @@ REGISTER_HID_WRAPPED_DETECTOR_I("HyperX Quadcast S", DetectHyperXMicrophoneContr
REGISTER_HID_WRAPPED_DETECTOR_I("HyperX Quadcast S", DetectHyperXMicrophoneControllers, HYPERX_HP_VID, HYPERX_QS_PID_HP_2, 0);//, 0xFF90, 0xFF00);
REGISTER_HID_WRAPPED_DETECTOR_I("HyperX Quadcast S", DetectHyperXMicrophoneControllers, HYPERX_HP_VID, HYPERX_QS_PID_HP_3, 0);//, 0xFF90, 0xFF00);
REGISTER_HID_WRAPPED_DETECTOR_I("HyperX Quadcast S", DetectHyperXMicrophoneControllers, HYPERX_HP_VID, HYPERX_QS_PID_HP_4, 0);//, 0xFF90, 0xFF00);
REGISTER_HID_WRAPPED_DETECTOR_I("HyperX Quadcast S", DetectHyperXMicrophoneControllers, HYPERX_HP_VID, HYPERX_QS_PID_HP_5, 0);//, 0xFF90, 0xFF00);
REGISTER_HID_WRAPPED_DETECTOR_I("HyperX DuoCast", DetectHyperXMicrophoneControllers, HYPERX_HP_VID, HYPERX_DUOCAST_PID, 0);//, 0xFF90, 0xFF00);
@@ -110,6 +110,7 @@ void RGBController_IntelArcA770LE::SetupZones()
logo.leds_min = 1;
logo.leds_max = 1;
logo.leds_count = 1;
logo.matrix_map = NULL;
zones.push_back(logo);
for(unsigned int led_idx = 0; led_idx < 16; led_idx++)
+15 -15
View File
@@ -1168,7 +1168,7 @@ const lenovo_led legion_Y740_15_ansi_leds[]
{0x79, KEY_EN_F10}, //10
{0x7A, KEY_EN_F11}, //11
{0x7B, KEY_EN_F12}, //12
{0x7D, KEY_EN_DELETE}, //13
{0x4C, KEY_EN_DELETE}, //13
//Row 2
{0x01, KEY_EN_BACK_TICK}, //14
@@ -1244,7 +1244,7 @@ const lenovo_led legion_Y740_15_ansi_leds[]
{0x3D, KEY_EN_SPACE}, //76
{0x91, KEY_EN_SPACE}, //77
{0x3E, KEY_EN_RIGHT_ALT}, //78
{0x81, KEY_EN_RIGHT_CONTROL}, //79
{0x40, KEY_EN_RIGHT_CONTROL}, //79
{0x53, KEY_EN_UP_ARROW}, //80
//Row 7
@@ -1253,12 +1253,12 @@ const lenovo_led legion_Y740_15_ansi_leds[]
{0x59, KEY_EN_RIGHT_ARROW}, //83
//Left Column
{0x40, "Key: Vantage"}, //84
{0x92, "Key: Capture"}, //85
{0x86, "Key: M1"}, //86
{0x81, "Key: M2"}, //87
{0x53, "Key: Kb Brightness Up"}, //88
{0x54, "Key: Kb Brightness Down"}, //89
{0xC1, "Key: Vantage"}, //84
{0xC2, "Key: Capture"}, //85
{0xC3, "Key: M1"}, //86
{0xC4, "Key: M2"}, //87
{0xC5, "Key: Kb Brightness Up"}, //88
{0xC6, "Key: Kb Brightness Down"}, //89
};
const lenovo_led legion_Y740_15_iso_leds[]
@@ -1351,7 +1351,7 @@ const lenovo_led legion_Y740_15_iso_leds[]
{0x3D, KEY_EN_SPACE}, //75
{0x91, KEY_EN_SPACE}, //76
{0x3E, KEY_EN_RIGHT_ALT}, //77
{0x81, KEY_EN_RIGHT_CONTROL}, //78
{0x40, KEY_EN_RIGHT_CONTROL}, //78
{0x53, KEY_EN_UP_ARROW}, //79
//Row 7
@@ -1360,12 +1360,12 @@ const lenovo_led legion_Y740_15_iso_leds[]
{0x59, KEY_EN_RIGHT_ARROW}, //82
//Left Column
{0x40, "Key: Vantage"}, //83
{0x92, "Key: Capture"}, //84
{0x86, "Key: M1"}, //85
{0x81, "Key: M2"}, //86
{0x53, "Key: Kb Brightness Up"}, //87
{0x54, "Key: Kb Brightness Down"}, //88
{0xC1, "Key: Vantage"}, //83
{0xC2, "Key: Capture"}, //84
{0xC3, "Key: M1"}, //85
{0xC4, "Key: M2"}, //86
{0xC5, "Key: Kb Brightness Up"}, //87
{0xC6, "Key: Kb Brightness Down"}, //88
};
/*--------------------------------------------------------*\
@@ -46,9 +46,9 @@ typedef struct
const char * name;
const unsigned char zone;
const unsigned char idx;
} led_type;
} logitech_g815_led;
static const led_type led_names[] =
static const logitech_g815_led led_names[] =
{
/* Key Label Zone, Index */
{ KEY_EN_A, LOGITECH_G815_ZONE_DIRECT_KEYBOARD, 0x04 },
@@ -17,7 +17,7 @@
#define BITSET(val, bit, pos) ((unsigned char)std::bitset<8>(val).set((pos), (bit)).to_ulong())
struct Config
struct mystic_light_162_config
{
unsigned short pid; // PID of the board
size_t numof_onboard_leds; // number of onboard leds
@@ -65,9 +65,9 @@ const std::vector<MSI_ZONE> zones_set3 =
| Boards with yet unknown supported zones are configured to support all zones. |
\*-----------------------------------------------------------------------------------------------------------------------------*/
#define NUMOF_CONFIGS (sizeof(board_configs) / sizeof(Config))
#define NUMOF_CONFIGS (sizeof(board_configs) / sizeof(mystic_light_162_config))
static const Config board_configs[] =
static const mystic_light_162_config board_configs[] =
{
{ 0x1720, 10, &zones_set0 }, // MPG Z390 GAMING EDGE AC
{ 0x7B12, 10, &zones_set0 }, // MEG Z390 ACE
@@ -107,7 +107,7 @@ MSIMysticLight162Controller::MSIMysticLight162Controller
/*-----------------------------------------*\
| Initialize zone based per LED data |
\*-----------------------------------------*/
const Config* board_config = nullptr;
const mystic_light_162_config* board_config = nullptr;
for(std::size_t i = 0; i < NUMOF_CONFIGS; ++i)
{
@@ -34,7 +34,7 @@ using namespace std::chrono_literals;
#define PER_LED_FULL_SYNC_MODE (PER_LED_BASIC_SYNC_MODE | SYNC_SETTING_JRAINBOW1 | SYNC_SETTING_JRAINBOW2 | SYNC_SETTING_JCORSAIR)
struct Config
struct mystic_light_185_config
{
unsigned short pid; // PID of the board
int numof_onboard_leds; // number of onboard leds
@@ -210,9 +210,9 @@ const std::vector<MSI_ZONE> zones_set16 =
| Boards with yet unknown supported zones are configured to support all zones. |
\*---------------------------------------------------------------------------------------------------------------------------------*/
#define NUMOF_CONFIGS (sizeof(board_configs) / sizeof(Config))
#define NUMOF_CONFIGS (sizeof(board_configs) / sizeof(mystic_light_185_config))
static const Config board_configs[] =
static const mystic_light_185_config board_configs[] =
{
{ 0x7B93, 6, 1, 0, 1, &zones_set3, MSIMysticLight185Controller::DIRECT_MODE_ZONE_BASED }, // MPG X570 GAMING PRO CARBON WIFI
{ 0x7C34, 0, 1, 1, 1, &zones_set8, MSIMysticLight185Controller::DIRECT_MODE_ZONE_BASED }, // MEG X570 GODLIKE
@@ -325,7 +325,7 @@ MSIMysticLight185Controller::MSIMysticLight185Controller
data.save_data = 0;
data.on_board_led.colorFlags = 0x80 | SYNC_SETTING_ONBOARD; // always enable onboard sync flag to have expected zone control
const Config* board_config = nullptr;
const mystic_light_185_config* board_config = nullptr;
for(std::size_t i = 0; i < NUMOF_CONFIGS; ++i)
{
@@ -75,6 +75,7 @@ static msi_device compatible_devices[] =
{"7C39", true },
{"7B86", true },
{"7B87", true },
{"7D95", false}
};
void DetectMSIRGBControllers()
@@ -51,6 +51,7 @@ static const gpu_pci_device device_list[] =
{NVIDIA_VEN, NVIDIA_RTX2080S_DEV, NVIDIA_VEN, NVIDIA_RTX2080S_FE_SUB_DEV, NVIDIA_ILLUMINATION_V1, TREATS_RGBW_AS_RGBW, "NVIDIA 2080 FE" },
{NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, PNY_SUB_VEN, PNY_RTX_3060_XLR8_REVEL_EPIC_X_SUB_DEV, NVIDIA_ILLUMINATION_V1, TREATS_RGBW_AS_RGB, "PNY 3060 XLR8 REVEL EPIC-X" },
{NVIDIA_VEN, NVIDIA_RTX3060_GA104_DEV, PNY_SUB_VEN, PNY_RTX_3060_XLR8_REVEL_EPIC_X_SUB_DEV, NVIDIA_ILLUMINATION_V1, TREATS_RGBW_AS_RGB, "PNY 3060 XLR8 REVEL EPIC-X" },
{NVIDIA_VEN, NVIDIA_RTX3060_GA104_DEV, NVIDIA_VEN, NVIDIA_RTX3060_GA104_DEV, NVIDIA_ILLUMINATION_V1, TREATS_RGBW_AS_RGB, "Palit 3060 LHR (GA104)" },
{NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, PNY_SUB_VEN, PNY_RTX_3060TI_XLR8_REVEL_EPIC_X_SUB_DEV, NVIDIA_ILLUMINATION_V1, TREATS_RGBW_AS_RGB, "PNY 3060TI XLR8 REVEL EPIC-X" },
{NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, NVIDIA_VEN, PNY_RTX_3060TI_XLR8_REVEL_EPIC_X_SUB_DEV, NVIDIA_ILLUMINATION_V1, TREATS_RGBW_AS_RGB, "PNY 3060TI XLR8 REVEL EPIC-X" },
{NVIDIA_VEN, NVIDIA_RTX3060TI_V1_LHR_DEV, NVIDIA_VEN, NVIDIA_RTX3060TI_V1_LHR_DEV, NVIDIA_ILLUMINATION_V1, TREATS_RGBW_AS_RGB, "NVIDIA 3060TI V1 LHR" },
@@ -16,6 +16,7 @@
#define NZXT_RGB_FAN_CONTROLLER2_PID 0x2010
#define NZXT_RGB_FAN_CONTROLLER3_PID 0x200E
#define NZXT_RGB_FAN_CONTROLLER4_PID 0x2011
#define NZXT_RGB_FAN_CONTROLLER5_PID 0x2019
#define NZXT_RGB_CONTROLLER_PID 0x2012
#define NZXT_SMART_DEVICE_V2_1_PID 0x200D
#define NZXT_SMART_DEVICE_V2_2_PID 0x200F
@@ -85,6 +86,7 @@ REGISTER_HID_DETECTOR("NZXT RGB & Fan Controller", DetectNZXTFanController,
REGISTER_HID_DETECTOR("NZXT RGB & Fan Controller", DetectNZXTFanController, NZXT_VID, NZXT_RGB_FAN_CONTROLLER2_PID);
REGISTER_HID_DETECTOR("NZXT RGB & Fan Controller", DetectNZXTFanController, NZXT_VID, NZXT_RGB_FAN_CONTROLLER3_PID);
REGISTER_HID_DETECTOR("NZXT RGB & Fan Controller", DetectNZXTFanController6Channel, NZXT_VID, NZXT_RGB_FAN_CONTROLLER4_PID);
REGISTER_HID_DETECTOR("NZXT RGB & Fan Controller", DetectNZXTFanController6Channel, NZXT_VID, NZXT_RGB_FAN_CONTROLLER5_PID);
REGISTER_HID_DETECTOR("NZXT RGB Controller", DetectNZXTRGBController, NZXT_VID, NZXT_RGB_CONTROLLER_PID);
REGISTER_HID_DETECTOR("NZXT Smart Device V2", DetectNZXTSmartDeviceV2, NZXT_VID, NZXT_SMART_DEVICE_V2_1_PID);
REGISTER_HID_DETECTOR("NZXT Smart Device V2", DetectNZXTSmartDeviceV2, NZXT_VID, NZXT_SMART_DEVICE_V2_2_PID);
File diff suppressed because it is too large Load Diff
@@ -20,9 +20,9 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
switch(matrix_type)
{
case RAZER_TYPE_MATRIX_FRAME:
case RAZER_TYPE_MATRIX_NOFRAME:
case RAZER_TYPE_MATRIX_STATIC:
case OPEN_RAZER_TYPE_MATRIX_FRAME:
case OPEN_RAZER_TYPE_MATRIX_NOFRAME:
case OPEN_RAZER_TYPE_MATRIX_STATIC:
{
char update_value = 1;
@@ -32,7 +32,7 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
unsigned int output_offset;
unsigned int row_offset = (row * matrix_cols);
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
if(matrix_type == OPEN_RAZER_TYPE_MATRIX_FRAME)
{
output_array_size = 3 + (matrix_cols* 3);
output_offset = 3;
@@ -45,7 +45,7 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
char* output_array = new char[output_array_size];
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
if(matrix_type == OPEN_RAZER_TYPE_MATRIX_FRAME)
{
output_array[0] = row;
output_array[1] = 0;
@@ -60,12 +60,12 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
output_array[(col * 3) + 2 + output_offset] = (char)RGBGetBValue(colors[color_idx]);
}
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
if(matrix_type == OPEN_RAZER_TYPE_MATRIX_FRAME)
{
matrix_custom_frame.write(output_array, output_array_size);
matrix_custom_frame.flush();
}
else if(matrix_type == RAZER_TYPE_MATRIX_NOFRAME)
else if(matrix_type == OPEN_RAZER_TYPE_MATRIX_NOFRAME)
{
matrix_effect_custom.write(output_array, output_array_size);
matrix_effect_custom.flush();
@@ -81,7 +81,7 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
std::this_thread::sleep_for(1ms);
}
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
if(matrix_type == OPEN_RAZER_TYPE_MATRIX_FRAME)
{
matrix_effect_custom.write(&update_value, 1);
matrix_effect_custom.flush();
@@ -89,7 +89,7 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
}
break;
case RAZER_TYPE_NOMATRIX:
case OPEN_RAZER_TYPE_NOMATRIX:
{
DeviceUpdateMode();
}
@@ -113,11 +113,11 @@ void RGBController_OpenRazer::SetupMatrixDevice(unsigned int rows, unsigned int
{
if(!matrix_effect_custom)
{
matrix_type = RAZER_TYPE_MATRIX_STATIC;
matrix_type = OPEN_RAZER_TYPE_MATRIX_STATIC;
}
else
{
matrix_type = RAZER_TYPE_MATRIX_NOFRAME;
matrix_type = OPEN_RAZER_TYPE_MATRIX_NOFRAME;
}
matrix_rows = 1;
@@ -125,7 +125,7 @@ void RGBController_OpenRazer::SetupMatrixDevice(unsigned int rows, unsigned int
}
else
{
matrix_type = RAZER_TYPE_MATRIX_FRAME;
matrix_type = OPEN_RAZER_TYPE_MATRIX_FRAME;
matrix_rows = rows;
matrix_cols = cols;
@@ -134,7 +134,7 @@ void RGBController_OpenRazer::SetupMatrixDevice(unsigned int rows, unsigned int
void RGBController_OpenRazer::SetupNonMatrixDevice()
{
matrix_type = RAZER_TYPE_NOMATRIX;
matrix_type = OPEN_RAZER_TYPE_NOMATRIX;
}
void RGBController_OpenRazer::OpenFunctions(std::string dev_path)
@@ -267,7 +267,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
/*-----------------------------------------------------------------*\
| Loop through all known devices to look for a name match |
\*-----------------------------------------------------------------*/
for (std::size_t i = 0; i < RAZER_NUM_DEVICES; i++)
for (std::size_t i = 0; i < OPEN_RAZER_NUM_DEVICES; i++)
{
if (device_list[i]->name == name)
{
@@ -288,7 +288,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
{
mode Direct;
Direct.name = "Direct";
Direct.value = RAZER_MODE_CUSTOM;
Direct.value = OPEN_RAZER_MODE_CUSTOM;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
@@ -309,7 +309,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
{
mode Off;
Off.name = "Off";
Off.value = RAZER_MODE_OFF;
Off.value = OPEN_RAZER_MODE_OFF;
Off.flags = 0;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
@@ -330,7 +330,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
{
mode Static;
Static.name = "Static";
Static.value = RAZER_MODE_STATIC;
Static.value = OPEN_RAZER_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Static.colors_min = 1;
Static.colors_max = 1;
@@ -350,7 +350,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
{
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = RAZER_MODE_BREATHING;
Breathing.value = OPEN_RAZER_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
Breathing.colors_min = 1;
Breathing.colors_max = 2;
@@ -368,7 +368,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
{
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = RAZER_MODE_BREATHING;
Breathing.value = OPEN_RAZER_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Breathing.colors_min = 1;
Breathing.colors_max = 1;
@@ -386,7 +386,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
{
mode Flashing;
Flashing.name = "Flashing";
Flashing.value = RAZER_MODE_FLASHING;
Flashing.value = OPEN_RAZER_MODE_FLASHING;
Flashing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Flashing.colors_min = 1;
Flashing.colors_max = 1;
@@ -410,7 +410,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
{
mode SpectrumCycle;
SpectrumCycle.name = "Spectrum Cycle";
SpectrumCycle.value = RAZER_MODE_SPECTRUM_CYCLE;
SpectrumCycle.value = OPEN_RAZER_MODE_SPECTRUM_CYCLE;
SpectrumCycle.flags = 0;
SpectrumCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(SpectrumCycle);
@@ -425,7 +425,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
{
mode Wave;
Wave.name = "Wave";
Wave.value = RAZER_MODE_WAVE;
Wave.value = OPEN_RAZER_MODE_WAVE;
Wave.flags = MODE_FLAG_HAS_DIRECTION_LR;
Wave.direction = MODE_DIRECTION_RIGHT;
Wave.color_mode = MODE_COLORS_NONE;
@@ -443,7 +443,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
{
mode Reactive;
Reactive.name = "Reactive";
Reactive.value = RAZER_MODE_REACTIVE;
Reactive.value = OPEN_RAZER_MODE_REACTIVE;
Reactive.flags = 0;
Reactive.color_mode = MODE_COLORS_NONE;
modes.push_back(Reactive);
@@ -490,7 +490,7 @@ void RGBController_OpenRazer::SetupZones()
/*---------------------------------------------------------*\
| Fill in zone information based on device table |
\*---------------------------------------------------------*/
for(unsigned int zone_id = 0; zone_id < RAZER_MAX_ZONES; zone_id++)
for(unsigned int zone_id = 0; zone_id < OPEN_RAZER_MAX_ZONES; zone_id++)
{
if(device_list[device_index]->zones[zone_id] != NULL)
{
@@ -579,7 +579,7 @@ void RGBController_OpenRazer::SetCustomMode()
/*---------------------------------------------------------*\
| If device supports custom mode, it will be mode index 0 |
\*---------------------------------------------------------*/
if(modes[0].value == RAZER_MODE_CUSTOM)
if(modes[0].value == OPEN_RAZER_MODE_CUSTOM)
{
active_mode = 0;
}
@@ -590,7 +590,7 @@ void RGBController_OpenRazer::SetCustomMode()
{
for(unsigned int i = 0; i < modes.size(); i++)
{
if(modes[i].value == RAZER_MODE_STATIC)
if(modes[i].value == OPEN_RAZER_MODE_STATIC)
{
active_mode = i;
break;
@@ -608,7 +608,7 @@ void RGBController_OpenRazer::DeviceUpdateMode()
switch(modes[active_mode].value)
{
case RAZER_MODE_CUSTOM:
case OPEN_RAZER_MODE_CUSTOM:
if(matrix_effect_custom)
{
matrix_effect_custom.write(update_value, 1);
@@ -616,7 +616,7 @@ void RGBController_OpenRazer::DeviceUpdateMode()
}
break;
case RAZER_MODE_OFF:
case OPEN_RAZER_MODE_OFF:
if(matrix_effect_none)
{
matrix_effect_none.write(update_value, 1);
@@ -669,7 +669,7 @@ void RGBController_OpenRazer::DeviceUpdateMode()
}
break;
case RAZER_MODE_STATIC:
case OPEN_RAZER_MODE_STATIC:
effect_value[0] = '0';
if(backlight_led_state)
@@ -752,7 +752,7 @@ void RGBController_OpenRazer::DeviceUpdateMode()
}
break;
case RAZER_MODE_FLASHING:
case OPEN_RAZER_MODE_FLASHING:
effect_value[0] = '1';
if(backlight_led_state)
@@ -805,7 +805,7 @@ void RGBController_OpenRazer::DeviceUpdateMode()
}
break;
case RAZER_MODE_BREATHING:
case OPEN_RAZER_MODE_BREATHING:
effect_value[0] = '2';
switch(modes[active_mode].color_mode)
@@ -965,7 +965,7 @@ void RGBController_OpenRazer::DeviceUpdateMode()
}
break;
case RAZER_MODE_SPECTRUM_CYCLE:
case OPEN_RAZER_MODE_SPECTRUM_CYCLE:
effect_value[0] = '4';
if(backlight_led_state)
@@ -1038,7 +1038,7 @@ void RGBController_OpenRazer::DeviceUpdateMode()
}
break;
case RAZER_MODE_WAVE:
case OPEN_RAZER_MODE_WAVE:
switch(modes[active_mode].direction)
{
case MODE_DIRECTION_LEFT:
@@ -1069,7 +1069,7 @@ void RGBController_OpenRazer::DeviceUpdateMode()
}
break;
case RAZER_MODE_REACTIVE:
case OPEN_RAZER_MODE_REACTIVE:
if(matrix_effect_reactive)
{
matrix_effect_reactive.write(update_value, 1);
@@ -18,24 +18,24 @@ class RGBController_OpenRazer : public RGBController
public:
enum
{
RAZER_MODE_CUSTOM,
RAZER_MODE_OFF,
RAZER_MODE_STATIC,
RAZER_MODE_BREATHING,
RAZER_MODE_SPECTRUM_CYCLE,
RAZER_MODE_WAVE,
RAZER_MODE_REACTIVE,
RAZER_MODE_FLASHING,
RAZER_NUM_MODES
OPEN_RAZER_MODE_CUSTOM,
OPEN_RAZER_MODE_OFF,
OPEN_RAZER_MODE_STATIC,
OPEN_RAZER_MODE_BREATHING,
OPEN_RAZER_MODE_SPECTRUM_CYCLE,
OPEN_RAZER_MODE_WAVE,
OPEN_RAZER_MODE_REACTIVE,
OPEN_RAZER_MODE_FLASHING,
OPEN_RAZER_NUM_MODES
};
enum
{
RAZER_TYPE_MATRIX_FRAME,
RAZER_TYPE_MATRIX_NOFRAME,
RAZER_TYPE_MATRIX_STATIC,
RAZER_TYPE_NOMATRIX,
RAZER_NUM_TYPES
OPEN_RAZER_TYPE_MATRIX_FRAME,
OPEN_RAZER_TYPE_MATRIX_NOFRAME,
OPEN_RAZER_TYPE_MATRIX_STATIC,
OPEN_RAZER_TYPE_NOMATRIX,
OPEN_RAZER_NUM_TYPES
};
public:
@@ -113,11 +113,11 @@ private:
std::ofstream backlight_led_effect;
std::ofstream backlight_led_rgb;
std::ofstream backlight_led_state;
std::ofstream logo_led_effect;
std::ofstream logo_led_rgb;
std::ofstream logo_led_state;
std::ofstream scroll_led_effect;
std::ofstream scroll_led_rgb;
std::ofstream scroll_led_state;
@@ -22,9 +22,9 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
{
switch(matrix_type)
{
case RAZER_TYPE_MATRIX_FRAME:
case RAZER_TYPE_MATRIX_NOFRAME:
case RAZER_TYPE_MATRIX_STATIC:
case OPEN_RAZER_TYPE_MATRIX_FRAME:
case OPEN_RAZER_TYPE_MATRIX_NOFRAME:
case OPEN_RAZER_TYPE_MATRIX_STATIC:
{
char update_value = 1;
@@ -34,7 +34,7 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
unsigned int output_offset;
unsigned int row_offset = (row * matrix_cols);
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
if(matrix_type == OPEN_RAZER_TYPE_MATRIX_FRAME)
{
output_array_size = 3 + (matrix_cols* 3);
output_offset = 3;
@@ -47,7 +47,7 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
char* output_array = new char[output_array_size];
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
if(matrix_type == OPEN_RAZER_TYPE_MATRIX_FRAME)
{
output_array[0] = row;
output_array[1] = 0;
@@ -62,17 +62,17 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
output_array[(col * 3) + 2 + output_offset] = (char)RGBGetBValue(colors[color_idx]);
}
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
if(matrix_type == OPEN_RAZER_TYPE_MATRIX_FRAME)
{
razer_functions->matrix_custom_frame->store(razer_device, NULL, output_array, output_array_size);
open_razer_functions->matrix_custom_frame->store(open_razer_device, NULL, output_array, output_array_size);
}
else if(matrix_type == RAZER_TYPE_MATRIX_NOFRAME)
else if(matrix_type == OPEN_RAZER_TYPE_MATRIX_NOFRAME)
{
razer_functions->matrix_effect_custom->store(razer_device, NULL, output_array, output_array_size);
open_razer_functions->matrix_effect_custom->store(open_razer_device, NULL, output_array, output_array_size);
}
else
{
razer_functions->matrix_effect_static->store(razer_device, NULL, output_array, output_array_size);
open_razer_functions->matrix_effect_static->store(open_razer_device, NULL, output_array, output_array_size);
}
delete[] output_array;
@@ -80,14 +80,14 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
std::this_thread::sleep_for(1ms);
}
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
if(matrix_type == OPEN_RAZER_TYPE_MATRIX_FRAME)
{
razer_functions->matrix_effect_custom->store(razer_device, NULL, &update_value, 1);
open_razer_functions->matrix_effect_custom->store(open_razer_device, NULL, &update_value, 1);
}
}
break;
case RAZER_TYPE_NOMATRIX:
case OPEN_RAZER_TYPE_NOMATRIX:
{
DeviceUpdateMode();
}
@@ -105,17 +105,17 @@ void RGBController_OpenRazer::UpdateSingleLED(int /*led*/)
DeviceUpdateLEDs();
}
void RGBController_OpenRazer::SetupMatrixDevice(device_fn_type* razer_functions, unsigned int rows, unsigned int cols)
void RGBController_OpenRazer::SetupMatrixDevice(device_fn_type* open_razer_functions, unsigned int rows, unsigned int cols)
{
if(!razer_functions->matrix_custom_frame)
if(!open_razer_functions->matrix_custom_frame)
{
if(!razer_functions->matrix_effect_custom)
if(!open_razer_functions->matrix_effect_custom)
{
matrix_type = RAZER_TYPE_MATRIX_STATIC;
matrix_type = OPEN_RAZER_TYPE_MATRIX_STATIC;
}
else
{
matrix_type = RAZER_TYPE_MATRIX_NOFRAME;
matrix_type = OPEN_RAZER_TYPE_MATRIX_NOFRAME;
}
matrix_rows = 1;
@@ -123,7 +123,7 @@ void RGBController_OpenRazer::SetupMatrixDevice(device_fn_type* razer_functions,
}
else
{
matrix_type = RAZER_TYPE_MATRIX_FRAME;
matrix_type = OPEN_RAZER_TYPE_MATRIX_FRAME;
matrix_rows = rows;
matrix_cols = cols;
@@ -132,7 +132,7 @@ void RGBController_OpenRazer::SetupMatrixDevice(device_fn_type* razer_functions,
void RGBController_OpenRazer::SetupNonMatrixDevice()
{
matrix_type = RAZER_TYPE_NOMATRIX;
matrix_type = OPEN_RAZER_TYPE_NOMATRIX;
}
/**------------------------------------------------------------------*\
@@ -147,12 +147,12 @@ void RGBController_OpenRazer::SetupNonMatrixDevice()
the in built Razer controller.
\*-------------------------------------------------------------------*/
RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_fn_type* razer_functions)
RGBController_OpenRazer::RGBController_OpenRazer(device * open_razer_device, device_fn_type* open_razer_functions)
{
char string_buf[1024];
this->razer_device = razer_device;
this->razer_functions = razer_functions;
this->open_razer_device = open_razer_device;
this->open_razer_functions = open_razer_functions;
/*-----------------------------------------------------------------*\
| Start device at -1. This indicates the device was not detected |
@@ -162,7 +162,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*-----------------------------------------------------------------*\
| Get the device name from the OpenRazer driver |
\*-----------------------------------------------------------------*/
razer_functions->device_type->show(razer_device, NULL, string_buf);
open_razer_functions->device_type->show(open_razer_device, NULL, string_buf);
name = string_buf;
name.erase(std::remove(name.begin(), name.end(), '\n'), name.end());
name.erase(std::remove(name.begin(), name.end(), '\r'), name.end());
@@ -180,7 +180,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*-----------------------------------------------------------------*\
| Get the serial number from the dev path |
\*-----------------------------------------------------------------*/
razer_functions->device_serial->show(razer_device, NULL, string_buf);
open_razer_functions->device_serial->show(open_razer_device, NULL, string_buf);
serial = string_buf;
serial.erase(std::remove(serial.begin(), serial.end(), '\n'), serial.end());
serial.erase(std::remove(serial.begin(), serial.end(), '\r'), serial.end());
@@ -188,7 +188,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*-----------------------------------------------------------------*\
| Get the firmware version from the dev path |
\*-----------------------------------------------------------------*/
razer_functions->firmware_version->show(razer_device, NULL, string_buf);
open_razer_functions->firmware_version->show(open_razer_device, NULL, string_buf);
version = string_buf;
version.erase(std::remove(version.begin(), version.end(), '\n'), version.end());
version.erase(std::remove(version.begin(), version.end(), '\r'), version.end());
@@ -201,7 +201,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*-----------------------------------------------------------------*\
| Loop through all known devices to look for a name match |
\*-----------------------------------------------------------------*/
for (unsigned int i = 0; i < RAZER_NUM_DEVICES; i++)
for (unsigned int i = 0; i < OPEN_RAZER_NUM_DEVICES; i++)
{
if (device_list[i]->name == name)
{
@@ -218,11 +218,11 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*---------------------------------------------------------*\
| Device has Direct mode if matrix_custom_frame exists |
\*---------------------------------------------------------*/
if(razer_functions->matrix_effect_custom)
if(open_razer_functions->matrix_effect_custom)
{
mode Direct;
Direct.name = "Direct";
Direct.value = RAZER_MODE_CUSTOM;
Direct.value = OPEN_RAZER_MODE_CUSTOM;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
@@ -232,18 +232,18 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
| Device has Off mode if any _effect_none or any _state |
| exists |
\*---------------------------------------------------------*/
if( razer_functions->matrix_effect_none
|| razer_functions->logo_matrix_effect_none
|| razer_functions->scroll_matrix_effect_none
|| razer_functions->left_matrix_effect_none
|| razer_functions->right_matrix_effect_none
/*|| razer_functions->backlight_led_state*/
|| razer_functions->logo_led_state
|| razer_functions->scroll_led_state)
if( open_razer_functions->matrix_effect_none
|| open_razer_functions->logo_matrix_effect_none
|| open_razer_functions->scroll_matrix_effect_none
|| open_razer_functions->left_matrix_effect_none
|| open_razer_functions->right_matrix_effect_none
/*|| open_razer_functions->backlight_led_state*/
|| open_razer_functions->logo_led_state
|| open_razer_functions->scroll_led_state)
{
mode Off;
Off.name = "Off";
Off.value = RAZER_MODE_OFF;
Off.value = OPEN_RAZER_MODE_OFF;
Off.flags = 0;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
@@ -253,18 +253,18 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
| Device has Static mode if any _effect_static or any |
| _effect exists |
\*---------------------------------------------------------*/
if( razer_functions->matrix_effect_static
|| razer_functions->logo_matrix_effect_static
|| razer_functions->scroll_matrix_effect_static
|| razer_functions->left_matrix_effect_static
|| razer_functions->right_matrix_effect_static
/*|| razer_functions->backlight_led_effect*/
|| razer_functions->logo_led_effect
|| razer_functions->scroll_led_effect)
if( open_razer_functions->matrix_effect_static
|| open_razer_functions->logo_matrix_effect_static
|| open_razer_functions->scroll_matrix_effect_static
|| open_razer_functions->left_matrix_effect_static
|| open_razer_functions->right_matrix_effect_static
/*|| open_razer_functions->backlight_led_effect*/
|| open_razer_functions->logo_led_effect
|| open_razer_functions->scroll_led_effect)
{
mode Static;
Static.name = "Static";
Static.value = RAZER_MODE_STATIC;
Static.value = OPEN_RAZER_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Static.colors_min = 1;
Static.colors_max = 1;
@@ -276,15 +276,15 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*---------------------------------------------------------*\
| Device has Breathing mode if any _effect_breath exists |
\*---------------------------------------------------------*/
if( razer_functions->matrix_effect_breath
|| razer_functions->logo_matrix_effect_breath
|| razer_functions->scroll_matrix_effect_breath
|| razer_functions->left_matrix_effect_breath
|| razer_functions->right_matrix_effect_breath)
if( open_razer_functions->matrix_effect_breath
|| open_razer_functions->logo_matrix_effect_breath
|| open_razer_functions->scroll_matrix_effect_breath
|| open_razer_functions->left_matrix_effect_breath
|| open_razer_functions->right_matrix_effect_breath)
{
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = RAZER_MODE_BREATHING;
Breathing.value = OPEN_RAZER_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
Breathing.colors_min = 1;
Breathing.colors_max = 2;
@@ -296,13 +296,13 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*---------------------------------------------------------*\
| Device has limited Breathing mode if any _effect exists |
\*---------------------------------------------------------*/
if( /*razer_functions->backlight_led_effect ||*/
razer_functions->logo_led_effect
|| razer_functions->scroll_led_effect)
if( /*open_razer_functions->backlight_led_effect ||*/
open_razer_functions->logo_led_effect
|| open_razer_functions->scroll_led_effect)
{
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = RAZER_MODE_BREATHING;
Breathing.value = OPEN_RAZER_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Breathing.colors_min = 1;
Breathing.colors_max = 1;
@@ -314,13 +314,13 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*---------------------------------------------------------*\
| Device has Flashing mode if any _effect exists |
\*---------------------------------------------------------*/
if( /*razer_functions->backlight_led_effect ||*/
razer_functions->logo_led_effect
|| razer_functions->scroll_led_effect)
if( /*open_razer_functions->backlight_led_effect ||*/
open_razer_functions->logo_led_effect
|| open_razer_functions->scroll_led_effect)
{
mode Flashing;
Flashing.name = "Flashing";
Flashing.value = RAZER_MODE_FLASHING;
Flashing.value = OPEN_RAZER_MODE_FLASHING;
Flashing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Flashing.colors_min = 1;
Flashing.colors_max = 1;
@@ -333,18 +333,18 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
| Device has Spectrum Cycle mode if any _effect_spectrum or |
| _effect exists |
\*---------------------------------------------------------*/
if( razer_functions->matrix_effect_spectrum
|| razer_functions->logo_matrix_effect_spectrum
|| razer_functions->scroll_matrix_effect_spectrum
|| razer_functions->left_matrix_effect_spectrum
|| razer_functions->right_matrix_effect_spectrum
/*|| razer_functions->backlight_led_effect*/
|| razer_functions->logo_led_effect
|| razer_functions->scroll_led_effect)
if( open_razer_functions->matrix_effect_spectrum
|| open_razer_functions->logo_matrix_effect_spectrum
|| open_razer_functions->scroll_matrix_effect_spectrum
|| open_razer_functions->left_matrix_effect_spectrum
|| open_razer_functions->right_matrix_effect_spectrum
/*|| open_razer_functions->backlight_led_effect*/
|| open_razer_functions->logo_led_effect
|| open_razer_functions->scroll_led_effect)
{
mode SpectrumCycle;
SpectrumCycle.name = "Spectrum Cycle";
SpectrumCycle.value = RAZER_MODE_SPECTRUM_CYCLE;
SpectrumCycle.value = OPEN_RAZER_MODE_SPECTRUM_CYCLE;
SpectrumCycle.flags = 0;
SpectrumCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(SpectrumCycle);
@@ -353,13 +353,13 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*---------------------------------------------------------*\
| Device has Wave mode if any _effect_wave exists |
\*---------------------------------------------------------*/
if( razer_functions->matrix_effect_wave
|| razer_functions->left_matrix_effect_wave
|| razer_functions->right_matrix_effect_wave)
if( open_razer_functions->matrix_effect_wave
|| open_razer_functions->left_matrix_effect_wave
|| open_razer_functions->right_matrix_effect_wave)
{
mode Wave;
Wave.name = "Wave";
Wave.value = RAZER_MODE_WAVE;
Wave.value = OPEN_RAZER_MODE_WAVE;
Wave.flags = MODE_FLAG_HAS_DIRECTION_LR;
Wave.direction = MODE_DIRECTION_RIGHT;
Wave.color_mode = MODE_COLORS_NONE;
@@ -369,15 +369,15 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*---------------------------------------------------------*\
| Device has Reactive mode if any _effect_reactive exists |
\*---------------------------------------------------------*/
if( razer_functions->matrix_effect_reactive
|| razer_functions->logo_matrix_effect_reactive
|| razer_functions->scroll_matrix_effect_reactive
|| razer_functions->left_matrix_effect_reactive
|| razer_functions->right_matrix_effect_reactive)
if( open_razer_functions->matrix_effect_reactive
|| open_razer_functions->logo_matrix_effect_reactive
|| open_razer_functions->scroll_matrix_effect_reactive
|| open_razer_functions->left_matrix_effect_reactive
|| open_razer_functions->right_matrix_effect_reactive)
{
mode Reactive;
Reactive.name = "Reactive";
Reactive.value = RAZER_MODE_REACTIVE;
Reactive.value = OPEN_RAZER_MODE_REACTIVE;
Reactive.flags = 0;
Reactive.color_mode = MODE_COLORS_NONE;
modes.push_back(Reactive);
@@ -388,7 +388,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
\*---------------------------------------------------------*/
if(device_list[i]->matrix_type == true)
{
SetupMatrixDevice(razer_functions, device_list[i]->rows, device_list[i]->cols);
SetupMatrixDevice(open_razer_functions, device_list[i]->rows, device_list[i]->cols);
}
else
{
@@ -425,7 +425,7 @@ void RGBController_OpenRazer::SetupZones()
/*---------------------------------------------------------*\
| Fill in zone information based on device table |
\*---------------------------------------------------------*/
for(unsigned int zone_id = 0; zone_id < RAZER_MAX_ZONES; zone_id++)
for(unsigned int zone_id = 0; zone_id < OPEN_RAZER_MAX_ZONES; zone_id++)
{
if(device_list[device_index]->zones[zone_id] != NULL)
{
@@ -514,7 +514,7 @@ void RGBController_OpenRazer::SetCustomMode()
/*---------------------------------------------------------*\
| If device supports custom mode, it will be mode index 0 |
\*---------------------------------------------------------*/
if(modes[0].value == RAZER_MODE_CUSTOM)
if(modes[0].value == OPEN_RAZER_MODE_CUSTOM)
{
active_mode = 0;
}
@@ -525,7 +525,7 @@ void RGBController_OpenRazer::SetCustomMode()
{
for(unsigned int i = 0; i < modes.size(); i++)
{
if(modes[i].value == RAZER_MODE_STATIC)
if(modes[i].value == OPEN_RAZER_MODE_STATIC)
{
active_mode = i;
break;
@@ -543,193 +543,193 @@ void RGBController_OpenRazer::DeviceUpdateMode()
switch(modes[active_mode].value)
{
case RAZER_MODE_CUSTOM:
if(razer_functions->matrix_effect_custom)
case OPEN_RAZER_MODE_CUSTOM:
if(open_razer_functions->matrix_effect_custom)
{
razer_functions->matrix_effect_custom->store(razer_device, NULL, update_value, 1);
open_razer_functions->matrix_effect_custom->store(open_razer_device, NULL, update_value, 1);
}
break;
case RAZER_MODE_OFF:
if(razer_functions->matrix_effect_none)
case OPEN_RAZER_MODE_OFF:
if(open_razer_functions->matrix_effect_none)
{
razer_functions->matrix_effect_none->store(razer_device, NULL, update_value, 1);
open_razer_functions->matrix_effect_none->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->logo_matrix_effect_none)
if(open_razer_functions->logo_matrix_effect_none)
{
razer_functions->logo_matrix_effect_none->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_matrix_effect_none->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_matrix_effect_none)
if(open_razer_functions->scroll_matrix_effect_none)
{
razer_functions->scroll_matrix_effect_none->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_matrix_effect_none->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->left_matrix_effect_none)
if(open_razer_functions->left_matrix_effect_none)
{
razer_functions->left_matrix_effect_none->store(razer_device, NULL, update_value, 1);
open_razer_functions->left_matrix_effect_none->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->right_matrix_effect_none)
if(open_razer_functions->right_matrix_effect_none)
{
razer_functions->right_matrix_effect_none->store(razer_device, NULL, update_value, 1);
open_razer_functions->right_matrix_effect_none->store(open_razer_device, NULL, update_value, 1);
}
//if(razer_functions->backlight_led_state)
//if(open_razer_functions->backlight_led_state)
//{
// update_value[0] = '0';
// razer_functions->backlight_led_state->store(razer_device, NULL, update_value, 1);
// open_razer_functions->backlight_led_state->store(open_razer_device, NULL, update_value, 1);
//}
if(razer_functions->logo_led_state)
if(open_razer_functions->logo_led_state)
{
update_value[0] = '0';
razer_functions->logo_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_led_state->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_led_state)
if(open_razer_functions->scroll_led_state)
{
update_value[0] = '0';
razer_functions->scroll_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_led_state->store(open_razer_device, NULL, update_value, 1);
}
break;
case RAZER_MODE_STATIC:
case OPEN_RAZER_MODE_STATIC:
effect_value[0] = '0';
//if(razer_functions->backlight_led_state)
//if(open_razer_functions->backlight_led_state)
//{
// update_value[0] = '1';
// razer_functions->backlight_led_state->store(razer_device, NULL, update_value, 1);
// open_razer_functions->backlight_led_state->store(open_razer_device, NULL, update_value, 1);
//}
if(razer_functions->logo_led_state)
if(open_razer_functions->logo_led_state)
{
update_value[0] = '1';
razer_functions->logo_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_led_state->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_led_state)
if(open_razer_functions->scroll_led_state)
{
update_value[0] = '1';
razer_functions->scroll_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_led_state->store(open_razer_device, NULL, update_value, 1);
}
update_value[0] = RGBGetRValue(modes[active_mode].colors[0]);
update_value[1] = RGBGetGValue(modes[active_mode].colors[0]);
update_value[2] = RGBGetBValue(modes[active_mode].colors[0]);
if(razer_functions->matrix_effect_static)
if(open_razer_functions->matrix_effect_static)
{
razer_functions->matrix_effect_static->store(razer_device, NULL, update_value, 3);
open_razer_functions->matrix_effect_static->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->logo_matrix_effect_static)
if(open_razer_functions->logo_matrix_effect_static)
{
razer_functions->logo_matrix_effect_static->store(razer_device, NULL, update_value, 3);
open_razer_functions->logo_matrix_effect_static->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->scroll_matrix_effect_static)
if(open_razer_functions->scroll_matrix_effect_static)
{
razer_functions->scroll_matrix_effect_static->store(razer_device, NULL, update_value, 3);
open_razer_functions->scroll_matrix_effect_static->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->left_matrix_effect_static)
if(open_razer_functions->left_matrix_effect_static)
{
razer_functions->left_matrix_effect_static->store(razer_device, NULL, update_value, 3);
open_razer_functions->left_matrix_effect_static->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->right_matrix_effect_static)
if(open_razer_functions->right_matrix_effect_static)
{
razer_functions->right_matrix_effect_static->store(razer_device, NULL, update_value, 3);
open_razer_functions->right_matrix_effect_static->store(open_razer_device, NULL, update_value, 3);
}
//if(razer_functions->backlight_led_effect && razer_functions->backlight_led_rgb)
//if(open_razer_functions->backlight_led_effect && open_razer_functions->backlight_led_rgb)
//{
// razer_functions->backlight_led_rgb->store(razer_device, NULL, update_value, 3);
// razer_functions->backlight_led_effect->store(razer_device, NULL, effect_value, 1);
// open_razer_functions->backlight_led_rgb->store(open_razer_device, NULL, update_value, 3);
// open_razer_functions->backlight_led_effect->store(open_razer_device, NULL, effect_value, 1);
//}
if(razer_functions->logo_led_effect && razer_functions->logo_led_rgb)
if(open_razer_functions->logo_led_effect && open_razer_functions->logo_led_rgb)
{
razer_functions->logo_led_rgb->store(razer_device, NULL, update_value, 3);
razer_functions->logo_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->logo_led_rgb->store(open_razer_device, NULL, update_value, 3);
open_razer_functions->logo_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
if(razer_functions->scroll_led_effect && razer_functions->scroll_led_rgb)
if(open_razer_functions->scroll_led_effect && open_razer_functions->scroll_led_rgb)
{
razer_functions->scroll_led_rgb->store(razer_device, NULL, update_value, 3);
razer_functions->scroll_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->scroll_led_rgb->store(open_razer_device, NULL, update_value, 3);
open_razer_functions->scroll_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
break;
case RAZER_MODE_FLASHING:
case OPEN_RAZER_MODE_FLASHING:
effect_value[0] = '1';
//if(razer_functions->backlight_led_state)
//if(open_razer_functions->backlight_led_state)
//{
// update_value[0] = '1';
// razer_functions->backlight_led_state->store(razer_device, NULL, update_value, 1);
// open_razer_functions->backlight_led_state->store(open_razer_device, NULL, update_value, 1);
//}
if(razer_functions->logo_led_state)
if(open_razer_functions->logo_led_state)
{
update_value[0] = '1';
razer_functions->logo_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_led_state->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_led_state)
if(open_razer_functions->scroll_led_state)
{
update_value[0] = '1';
razer_functions->scroll_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_led_state->store(open_razer_device, NULL, update_value, 1);
}
update_value[0] = RGBGetRValue(modes[active_mode].colors[0]);
update_value[1] = RGBGetGValue(modes[active_mode].colors[0]);
update_value[2] = RGBGetBValue(modes[active_mode].colors[0]);
//if(razer_functions->backlight_led_effect && razer_functions->backlight_led_rgb)
//if(open_razer_functions->backlight_led_effect && open_razer_functions->backlight_led_rgb)
//{
// razer_functions->backlight_led_rgb->store(razer_device, NULL, update_value, 3);
// razer_functions->backlight_led_effect->store(razer_device, NULL, effect_value, 1);
// open_razer_functions->backlight_led_rgb->store(open_razer_device, NULL, update_value, 3);
// open_razer_functions->backlight_led_effect->store(open_razer_device, NULL, effect_value, 1);
//}
if(razer_functions->logo_led_effect && razer_functions->logo_led_rgb)
if(open_razer_functions->logo_led_effect && open_razer_functions->logo_led_rgb)
{
razer_functions->logo_led_rgb->store(razer_device, NULL, update_value, 3);
razer_functions->logo_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->logo_led_rgb->store(open_razer_device, NULL, update_value, 3);
open_razer_functions->logo_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
if(razer_functions->scroll_led_effect && razer_functions->scroll_led_rgb)
if(open_razer_functions->scroll_led_effect && open_razer_functions->scroll_led_rgb)
{
razer_functions->scroll_led_rgb->store(razer_device, NULL, update_value, 3);
razer_functions->scroll_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->scroll_led_rgb->store(open_razer_device, NULL, update_value, 3);
open_razer_functions->scroll_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
break;
case RAZER_MODE_BREATHING:
case OPEN_RAZER_MODE_BREATHING:
effect_value[0] = '2';
switch(modes[active_mode].color_mode)
{
case MODE_COLORS_MODE_SPECIFIC:
//if(razer_functions->backlight_led_state)
//if(open_razer_functions->backlight_led_state)
//{
// update_value[0] = '1';
// razer_functions->backlight_led_state->store(razer_device, NULL, update_value, 1);
// open_razer_functions->backlight_led_state->store(open_razer_device, NULL, update_value, 1);
//}
if(razer_functions->logo_led_state)
if(open_razer_functions->logo_led_state)
{
update_value[0] = '1';
razer_functions->logo_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_led_state->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_led_state)
if(open_razer_functions->scroll_led_state)
{
update_value[0] = '1';
razer_functions->scroll_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_led_state->store(open_razer_device, NULL, update_value, 1);
}
update_value[0] = RGBGetRValue(modes[active_mode].colors[0]);
@@ -742,170 +742,170 @@ void RGBController_OpenRazer::DeviceUpdateMode()
update_value[4] = RGBGetGValue(modes[active_mode].colors[1]);
update_value[5] = RGBGetBValue(modes[active_mode].colors[1]);
if(razer_functions->matrix_effect_breath)
if(open_razer_functions->matrix_effect_breath)
{
razer_functions->matrix_effect_breath->store(razer_device, NULL, update_value, 6);
open_razer_functions->matrix_effect_breath->store(open_razer_device, NULL, update_value, 6);
}
if(razer_functions->logo_matrix_effect_breath)
if(open_razer_functions->logo_matrix_effect_breath)
{
razer_functions->logo_matrix_effect_breath->store(razer_device, NULL, update_value, 6);
open_razer_functions->logo_matrix_effect_breath->store(open_razer_device, NULL, update_value, 6);
}
if(razer_functions->scroll_matrix_effect_breath)
if(open_razer_functions->scroll_matrix_effect_breath)
{
razer_functions->scroll_matrix_effect_breath->store(razer_device, NULL, update_value, 6);
open_razer_functions->scroll_matrix_effect_breath->store(open_razer_device, NULL, update_value, 6);
}
if(razer_functions->left_matrix_effect_breath)
if(open_razer_functions->left_matrix_effect_breath)
{
razer_functions->left_matrix_effect_breath->store(razer_device, NULL, update_value, 6);
open_razer_functions->left_matrix_effect_breath->store(open_razer_device, NULL, update_value, 6);
}
if(razer_functions->right_matrix_effect_breath)
if(open_razer_functions->right_matrix_effect_breath)
{
razer_functions->right_matrix_effect_breath->store(razer_device, NULL, update_value, 6);
open_razer_functions->right_matrix_effect_breath->store(open_razer_device, NULL, update_value, 6);
}
}
else
{
if(razer_functions->matrix_effect_breath)
if(open_razer_functions->matrix_effect_breath)
{
razer_functions->matrix_effect_breath->store(razer_device, NULL, update_value, 3);
open_razer_functions->matrix_effect_breath->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->logo_matrix_effect_breath)
if(open_razer_functions->logo_matrix_effect_breath)
{
razer_functions->logo_matrix_effect_breath->store(razer_device, NULL, update_value, 3);
open_razer_functions->logo_matrix_effect_breath->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->scroll_matrix_effect_breath)
if(open_razer_functions->scroll_matrix_effect_breath)
{
razer_functions->scroll_matrix_effect_breath->store(razer_device, NULL, update_value, 3);
open_razer_functions->scroll_matrix_effect_breath->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->left_matrix_effect_breath)
if(open_razer_functions->left_matrix_effect_breath)
{
razer_functions->left_matrix_effect_breath->store(razer_device, NULL, update_value, 3);
open_razer_functions->left_matrix_effect_breath->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->right_matrix_effect_breath)
if(open_razer_functions->right_matrix_effect_breath)
{
razer_functions->right_matrix_effect_breath->store(razer_device, NULL, update_value, 3);
open_razer_functions->right_matrix_effect_breath->store(open_razer_device, NULL, update_value, 3);
}
//if(razer_functions->backlight_led_effect && razer_functions->backlight_led_rgb)
//if(open_razer_functions->backlight_led_effect && open_razer_functions->backlight_led_rgb)
//{
// razer_functions->backlight_led_rgb->store(razer_device, NULL, update_value, 3);
// razer_functions->backlight_led_effect->store(razer_device, NULL, effect_value, 1);
// open_razer_functions->backlight_led_rgb->store(open_razer_device, NULL, update_value, 3);
// open_razer_functions->backlight_led_effect->store(open_razer_device, NULL, effect_value, 1);
//}
if(razer_functions->logo_led_effect && razer_functions->logo_led_rgb)
if(open_razer_functions->logo_led_effect && open_razer_functions->logo_led_rgb)
{
razer_functions->logo_led_rgb->store(razer_device, NULL, update_value, 3);
razer_functions->logo_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->logo_led_rgb->store(open_razer_device, NULL, update_value, 3);
open_razer_functions->logo_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
if(razer_functions->scroll_led_effect && razer_functions->scroll_led_rgb)
if(open_razer_functions->scroll_led_effect && open_razer_functions->scroll_led_rgb)
{
razer_functions->scroll_led_rgb->store(razer_device, NULL, update_value, 3);
razer_functions->scroll_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->scroll_led_rgb->store(open_razer_device, NULL, update_value, 3);
open_razer_functions->scroll_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
}
break;
case MODE_COLORS_RANDOM:
if(razer_functions->matrix_effect_breath)
if(open_razer_functions->matrix_effect_breath)
{
razer_functions->matrix_effect_breath->store(razer_device, NULL, update_value, 1);
open_razer_functions->matrix_effect_breath->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->logo_matrix_effect_breath)
if(open_razer_functions->logo_matrix_effect_breath)
{
razer_functions->logo_matrix_effect_breath->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_matrix_effect_breath->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_matrix_effect_breath)
if(open_razer_functions->scroll_matrix_effect_breath)
{
razer_functions->scroll_matrix_effect_breath->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_matrix_effect_breath->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->left_matrix_effect_breath)
if(open_razer_functions->left_matrix_effect_breath)
{
razer_functions->left_matrix_effect_breath->store(razer_device, NULL, update_value, 1);
open_razer_functions->left_matrix_effect_breath->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->right_matrix_effect_breath)
if(open_razer_functions->right_matrix_effect_breath)
{
razer_functions->right_matrix_effect_breath->store(razer_device, NULL, update_value, 1);
open_razer_functions->right_matrix_effect_breath->store(open_razer_device, NULL, update_value, 1);
}
break;
}
break;
case RAZER_MODE_SPECTRUM_CYCLE:
case OPEN_RAZER_MODE_SPECTRUM_CYCLE:
effect_value[0] = '4';
//if(razer_functions->backlight_led_state)
//if(open_razer_functions->backlight_led_state)
//{
// update_value[0] = '1';
// razer_functions->backlight_led_state->store(razer_device, NULL, update_value, 1);
// open_razer_functions->backlight_led_state->store(open_razer_device, NULL, update_value, 1);
//}
if(razer_functions->logo_led_state)
if(open_razer_functions->logo_led_state)
{
update_value[0] = '1';
razer_functions->logo_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_led_state->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_led_state)
if(open_razer_functions->scroll_led_state)
{
update_value[0] = '1';
razer_functions->scroll_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_led_state->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->matrix_effect_spectrum)
if(open_razer_functions->matrix_effect_spectrum)
{
razer_functions->matrix_effect_spectrum->store(razer_device, NULL, update_value, 1);
open_razer_functions->matrix_effect_spectrum->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->logo_matrix_effect_spectrum)
if(open_razer_functions->logo_matrix_effect_spectrum)
{
razer_functions->logo_matrix_effect_spectrum->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_matrix_effect_spectrum->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_matrix_effect_spectrum)
if(open_razer_functions->scroll_matrix_effect_spectrum)
{
razer_functions->scroll_matrix_effect_spectrum->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_matrix_effect_spectrum->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->left_matrix_effect_spectrum)
if(open_razer_functions->left_matrix_effect_spectrum)
{
razer_functions->left_matrix_effect_spectrum->store(razer_device, NULL, update_value, 1);
open_razer_functions->left_matrix_effect_spectrum->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->right_matrix_effect_spectrum)
if(open_razer_functions->right_matrix_effect_spectrum)
{
razer_functions->right_matrix_effect_spectrum->store(razer_device, NULL, update_value, 1);
open_razer_functions->right_matrix_effect_spectrum->store(open_razer_device, NULL, update_value, 1);
}
//if(razer_functions->backlight_led_effect)
//if(open_razer_functions->backlight_led_effect)
//{
// razer_functions->backlight_led_effect->store(razer_device, NULL, effect_value, 1);
// open_razer_functions->backlight_led_effect->store(open_razer_device, NULL, effect_value, 1);
//}
if(razer_functions->logo_led_effect)
if(open_razer_functions->logo_led_effect)
{
razer_functions->logo_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->logo_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
if(razer_functions->scroll_led_effect)
if(open_razer_functions->scroll_led_effect)
{
razer_functions->scroll_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->scroll_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
break;
case RAZER_MODE_WAVE:
case OPEN_RAZER_MODE_WAVE:
switch(modes[active_mode].direction)
{
case MODE_DIRECTION_LEFT:
@@ -917,46 +917,46 @@ void RGBController_OpenRazer::DeviceUpdateMode()
break;
}
if(razer_functions->matrix_effect_wave)
if(open_razer_functions->matrix_effect_wave)
{
razer_functions->matrix_effect_wave->store(razer_device, NULL, update_value, 1);
open_razer_functions->matrix_effect_wave->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->left_matrix_effect_wave)
if(open_razer_functions->left_matrix_effect_wave)
{
razer_functions->left_matrix_effect_wave->store(razer_device, NULL, update_value, 1);
open_razer_functions->left_matrix_effect_wave->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->right_matrix_effect_wave)
if(open_razer_functions->right_matrix_effect_wave)
{
razer_functions->right_matrix_effect_wave->store(razer_device, NULL, update_value, 1);
open_razer_functions->right_matrix_effect_wave->store(open_razer_device, NULL, update_value, 1);
}
break;
case RAZER_MODE_REACTIVE:
if(razer_functions->matrix_effect_reactive)
case OPEN_RAZER_MODE_REACTIVE:
if(open_razer_functions->matrix_effect_reactive)
{
razer_functions->matrix_effect_reactive->store(razer_device, NULL, update_value, 1);
open_razer_functions->matrix_effect_reactive->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->logo_matrix_effect_reactive)
if(open_razer_functions->logo_matrix_effect_reactive)
{
razer_functions->logo_matrix_effect_reactive->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_matrix_effect_reactive->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_matrix_effect_reactive)
if(open_razer_functions->scroll_matrix_effect_reactive)
{
razer_functions->scroll_matrix_effect_reactive->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_matrix_effect_reactive->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->left_matrix_effect_reactive)
if(open_razer_functions->left_matrix_effect_reactive)
{
razer_functions->left_matrix_effect_reactive->store(razer_device, NULL, update_value, 1);
open_razer_functions->left_matrix_effect_reactive->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->right_matrix_effect_reactive)
if(open_razer_functions->right_matrix_effect_reactive)
{
razer_functions->right_matrix_effect_reactive->store(razer_device, NULL, update_value, 1);
open_razer_functions->right_matrix_effect_reactive->store(open_razer_device, NULL, update_value, 1);
}
break;
}
@@ -76,28 +76,28 @@ class RGBController_OpenRazer : public RGBController
public:
enum
{
RAZER_MODE_CUSTOM,
RAZER_MODE_OFF,
RAZER_MODE_STATIC,
RAZER_MODE_BREATHING,
RAZER_MODE_SPECTRUM_CYCLE,
RAZER_MODE_WAVE,
RAZER_MODE_REACTIVE,
RAZER_MODE_FLASHING,
RAZER_NUM_MODES
OPEN_RAZER_MODE_CUSTOM,
OPEN_RAZER_MODE_OFF,
OPEN_RAZER_MODE_STATIC,
OPEN_RAZER_MODE_BREATHING,
OPEN_RAZER_MODE_SPECTRUM_CYCLE,
OPEN_RAZER_MODE_WAVE,
OPEN_RAZER_MODE_REACTIVE,
OPEN_RAZER_MODE_FLASHING,
OPEN_RAZER_NUM_MODES
};
enum
{
RAZER_TYPE_MATRIX_FRAME,
RAZER_TYPE_MATRIX_NOFRAME,
RAZER_TYPE_MATRIX_STATIC,
RAZER_TYPE_NOMATRIX,
RAZER_NUM_TYPES
OPEN_RAZER_TYPE_MATRIX_FRAME,
OPEN_RAZER_TYPE_MATRIX_NOFRAME,
OPEN_RAZER_TYPE_MATRIX_STATIC,
OPEN_RAZER_TYPE_NOMATRIX,
OPEN_RAZER_NUM_TYPES
};
public:
RGBController_OpenRazer(device * razer_device, device_fn_type* razer_functions);
RGBController_OpenRazer(device * open_razer_device, device_fn_type* open_razer_functions);
~RGBController_OpenRazer();
void SetupZones();
@@ -114,15 +114,15 @@ public:
int device_index;
private:
void SetupMatrixDevice(device_fn_type* razer_functions, unsigned int rows, unsigned int cols);
void SetupMatrixDevice(device_fn_type* open_razer_functions, unsigned int rows, unsigned int cols);
void SetupNonMatrixDevice();
unsigned int matrix_type;
unsigned int matrix_rows;
unsigned int matrix_cols;
device* razer_device;
device_fn_type* razer_functions;
device* open_razer_device;
device_fn_type* open_razer_functions;
//OpenRazer Sysfs Entries for Matrix Devices
std::ofstream matrix_custom_frame;
@@ -7,6 +7,7 @@
#include "Bridge.h"
#include "EntertainmentMode.h"
#include "Group.h"
#include "RGBController.h"
#include <string>
#include <vector>
@@ -20,6 +20,7 @@
#include "RGBController_QMKOpenRGBRevD.h"
#include "RGBController_QMKOpenRGBRevE.h"
#include "LogManager.h"
#include "SettingsManager.h"
#include <hidapi/hidapi.h>
/*-----------------------------------------------------*\
@@ -11,6 +11,7 @@
#include "RGBControllerKeyNames.h"
#include "QMKOpenRGBRev9Controller.h"
#include "SettingsManager.h"
using namespace std::chrono_literals;
@@ -9,6 +9,7 @@
#include "RGBControllerKeyNames.h"
#include "QMKOpenRGBRevBController.h"
#include "SettingsManager.h"
using namespace std::chrono_literals;
@@ -9,6 +9,7 @@
#include "RGBControllerKeyNames.h"
#include "QMKOpenRGBRevDController.h"
#include "SettingsManager.h"
using namespace std::chrono_literals;
@@ -240,6 +240,10 @@ void RGBController_Razer::SetupZones()
}
else
{
/*---------------------------------------------------------*\
| Handle all other matrix type zones by filling in all |
| entries |
\*---------------------------------------------------------*/
matrix_map_type * new_map = new matrix_map_type;
new_zone.matrix_map = new_map;
new_map->height = device_list[device_index]->zones[zone_id]->rows;
@@ -250,46 +254,7 @@ void RGBController_Razer::SetupZones()
{
for(unsigned int x = 0; x < new_map->width; x++)
{
bool exists_in_keymap = false;
if(new_zone.name != ZONE_EN_KEYBOARD)
{
/*---------------------------------------------------------*\
| For zones other than the actual keyboard, we want all |
| entries in the matrix visible in the LED view (such as |
| underglow) |
\*---------------------------------------------------------*/
exists_in_keymap = true;
}
else if(device_list[device_index]->keymap != NULL)
{
for(unsigned int i = 0; i < device_list[device_index]->keymap_size; i++)
{
razer_key key = device_list[device_index]->keymap[i];
if(zone_id == key.zone && y == key.row && x == key.col && (key.layout & layout_type))
{
exists_in_keymap = true;
break;
}
}
}
else
{
/*---------------------------------------------------------*\
| If the device has no keymap defined we want all entries in|
| the matrix to be visible in the LED view |
\*---------------------------------------------------------*/
exists_in_keymap = true;
}
if (exists_in_keymap)
{
new_map->map[(y * new_map->width) + x] = (y * new_map->width) + x;
}
else
{
new_map->map[(y * new_map->width) + x] = -1;
}
new_map->map[(y * new_map->width) + x] = (y * new_map->width) + x;
}
}
}
@@ -315,33 +280,6 @@ void RGBController_Razer::SetupZones()
new_led->name.append(std::to_string(col_id + 1));
}
if(device_list[device_index]->keymap != NULL)
{
bool not_found = true;
for(unsigned int i = 0; i < device_list[device_index]->keymap_size; i++)
{
if(zone_id == device_list[device_index]->keymap[i].zone &&
row_id == device_list[device_index]->keymap[i].row &&
col_id == device_list[device_index]->keymap[i].col &&
layout_type & device_list[device_index]->keymap[i].layout)
{
new_led->name = device_list[device_index]->keymap[i].name;
not_found = false;
break;
}
}
/*-----------------------------------------------------------------*\
| If this is the "Keyboard" zone and key was not found in the map |
| then change the value of the key to hide it from view |
\*-----------------------------------------------------------------*/
if(not_found && zones[zone_id].name == ZONE_EN_KEYBOARD)
{
zones[zone_id].matrix_map->map[row_id * zones[zone_id].matrix_map->width + col_id] = NA;
}
}
leds.push_back(*new_led);
}
}
@@ -146,19 +146,6 @@ void RGBController_RazerKraken::SetupZones()
new_led->name.append(std::to_string(col_id + 1));
}
if(device_list[device_index]->keymap != NULL)
{
for(unsigned int i = 0; i < device_list[device_index]->keymap_size; i++)
{
if(zone_id == device_list[device_index]->keymap[i].zone &&
row_id == device_list[device_index]->keymap[i].row &&
col_id == device_list[device_index]->keymap[i].col)
{
new_led->name = device_list[device_index]->keymap[i].name;
}
}
}
leds.push_back(*new_led);
}
}
@@ -1208,6 +1208,12 @@ void RazerController::razer_set_custom_frame(unsigned char row_index, unsigned c
razer_usb_send(&report);
break;
case RAZER_MAMBA_2012_WIRED_PID:
case RAZER_MAMBA_2012_WIRELESS_PID:
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
razer_usb_send(&report);
break;
/*-------------------------------------------------*\
| The Orbweaver Chroma has an unusual matrix layout |
| and the following code allows it to present as a |
@@ -1321,6 +1327,14 @@ void RazerController::razer_set_mode_breathing_one_color(unsigned char red, unsi
razer_usb_send(&report);
break;
case RAZER_MAMBA_2012_WIRED_PID:
case RAZER_MAMBA_2012_WIRELESS_PID:
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
razer_usb_send(&report);
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 2);
razer_usb_send(&report);
break;
/*-------------------------------------------------*\
| These devices use standard matrix reports |
\*-------------------------------------------------*/
@@ -1448,6 +1462,12 @@ void RazerController::razer_set_mode_custom()
razer_usb_send(&report);
break;
case RAZER_MAMBA_2012_WIRED_PID:
case RAZER_MAMBA_2012_WIRELESS_PID:
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0);
razer_usb_send(&report);
break;
/*-------------------------------------------------*\
| These devices use standard matrix reports |
\*-------------------------------------------------*/
@@ -8,6 +8,8 @@
#include "RGBController_Razer.h"
#include "RGBController_RazerAddressable.h"
#include "RGBController_RazerKraken.h"
#include "SettingsManager.h"
#include <hidapi/hidapi.h>
#include <unordered_set>
File diff suppressed because it is too large Load Diff
@@ -236,15 +236,6 @@ typedef struct
unsigned int cols;
} razer_zone;
typedef struct
{
unsigned int zone;
unsigned int row;
unsigned int col;
const char* name;
unsigned char layout = RAZER_LAYOUT_TYPE_ALL;
} razer_key;
typedef struct
{
std::string name;
@@ -255,8 +246,6 @@ typedef struct
unsigned int rows;
unsigned int cols;
const razer_zone* zones[RAZER_MAX_ZONES];
const razer_key* keymap;
unsigned int keymap_size;
keyboard_keymap_overlay_values* layout;
} razer_device;
@@ -0,0 +1,168 @@
/*-----------------------------------------*\
| RGBController_Seagate.cpp |
| |
| Generic RGB Interface for Seagate |
| |
| Adam Honse (CalcProgrammer1) 11/8/2022 |
\*-----------------------------------------*/
#include "RGBController_Seagate.h"
/**------------------------------------------------------------------*\
@name Seagate
@category Storage
@type SCSI
@save :white_check_mark:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectSeagateControllers
@comment
\*-------------------------------------------------------------------*/
RGBController_Seagate::RGBController_Seagate(SeagateController* controller_ptr)
{
controller = controller_ptr;
name = "Seagate Device";
vendor = "Seagate";
type = DEVICE_TYPE_STORAGE;
description = "Seagate Device";
location = controller->GetLocation();
mode Direct;
Direct.name = "Direct";
Direct.value = SEAGATE_MODE_STATIC;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Blink;
Blink.name = "Flashing";
Blink.value = SEAGATE_MODE_BLINK;
Blink.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE;
Blink.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Blink);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = SEAGATE_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
mode Spectrum;
Spectrum.name = "Spectrum Cycle";
Spectrum.value = SEAGATE_MODE_SPECTRUM;
Spectrum.flags = MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_MANUAL_SAVE;
Spectrum.color_mode = MODE_COLORS_RANDOM;
modes.push_back(Spectrum);
SetupZones();
}
RGBController_Seagate::~RGBController_Seagate()
{
delete controller;
}
void RGBController_Seagate::SetupZones()
{
zone led_zone;
led_zone.name = "LED Strip";
led_zone.type = ZONE_TYPE_LINEAR;
led_zone.leds_min = 6;
led_zone.leds_max = 6;
led_zone.leds_count = 6;
led_zone.matrix_map = NULL;
zones.push_back(led_zone);
for(unsigned int led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
{
led new_led;
new_led.name = "LED Strip LED";
leds.push_back(new_led);
}
SetupColors();
}
void RGBController_Seagate::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_Seagate::DeviceUpdateLEDs()
{
for(unsigned int led_idx = 0; led_idx < leds.size(); led_idx++)
{
UpdateSingleLED(led_idx);
}
}
void RGBController_Seagate::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_Seagate::UpdateSingleLED(int led)
{
unsigned char red = RGBGetRValue(colors[led]);
unsigned char grn = RGBGetGValue(colors[led]);
unsigned char blu = RGBGetBValue(colors[led]);
switch(modes[active_mode].value)
{
case SEAGATE_MODE_STATIC:
controller->SetLEDStatic(led, red, grn, blu, false);
break;
case SEAGATE_MODE_BLINK:
controller->SetLEDBlink(led, red, grn, blu, false);
break;
case SEAGATE_MODE_BREATHING:
controller->SetLEDBreathing(led, red, grn, blu, false);
break;
case SEAGATE_MODE_SPECTRUM:
controller->SetLEDsSpectrum(led, false);
break;
}
}
void RGBController_Seagate::DeviceUpdateMode()
{
DeviceUpdateLEDs();
}
void RGBController_Seagate::DeviceSaveMode()
{
for(unsigned int led_idx = 0; led_idx < leds.size(); led_idx++)
{
unsigned char red = RGBGetRValue(colors[led_idx]);
unsigned char grn = RGBGetGValue(colors[led_idx]);
unsigned char blu = RGBGetBValue(colors[led_idx]);
switch(modes[active_mode].value)
{
case SEAGATE_MODE_STATIC:
controller->SetLEDStatic(led_idx, red, grn, blu, true);
break;
case SEAGATE_MODE_BLINK:
controller->SetLEDBlink(led_idx, red, grn, blu, true);
break;
case SEAGATE_MODE_BREATHING:
controller->SetLEDBreathing(led_idx, red, grn, blu, true);
break;
case SEAGATE_MODE_SPECTRUM:
controller->SetLEDsSpectrum(led_idx, true);
break;
}
}
}
@@ -0,0 +1,33 @@
/*-----------------------------------------*\
| RGBController_Seagate.h |
| |
| Generic RGB Interface for Seagate |
| |
| Adam Honse (CalcProgrammer1) 11/8/2022 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "SeagateController.h"
class RGBController_Seagate : public RGBController
{
public:
RGBController_Seagate(SeagateController* controller_ptr);
~RGBController_Seagate();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
void DeviceSaveMode();
private:
SeagateController* controller;
};
@@ -0,0 +1,222 @@
/*-----------------------------------------*\
| SeagateController.cpp |
| |
| Code for Seagate Firecuda External HDD |
| RGB controller |
| |
| Adam Honse (CalcProgrammer1) 6/15/2023 |
\*-----------------------------------------*/
#include "SeagateController.h"
SeagateController::SeagateController(scsi_device* dev_handle, char* path)
{
this->dev = dev_handle;
this->path = path;
}
SeagateController::~SeagateController()
{
scsi_close(dev);
}
std::string SeagateController::GetLocation()
{
std::string str(path.begin(), path.end());
return("SCSI: " + str);
}
void SeagateController::SetLEDBlink
(
unsigned char led_id,
unsigned char r,
unsigned char g,
unsigned char b,
bool save
)
{
/*-----------------------------------------------------------------------------*\
| Create buffer to hold RGB control data |
\*-----------------------------------------------------------------------------*/
unsigned char data[0x10] = {0};
data[0] = 0x10; /* size of data packet */
data[1] = 0x00;
data[2] = 0x01;
data[3] = 0x09;
data[4] = 0x01;
data[5] = 0x06;
data[6] = led_id;
data[7] = SEAGATE_MODE_BLINK;
if(save)
{
data[8] = 0x03; /* 0x00 for no save, 0x03 for */
/* save */
}
else
{
data[8] = 0x00;
}
data[9] = 0x10;
data[10] = 0x10;
data[11] = r;
data[12] = g;
data[13] = b;
data[14] = 0xFF;
data[15] = 0xFF;
/*-----------------------------------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------------------------------*/
SendPacket(data, 0x10);
}
void SeagateController::SetLEDBreathing
(
unsigned char led_id,
unsigned char r,
unsigned char g,
unsigned char b,
bool save
)
{
/*-----------------------------------------------------------------------------*\
| Create buffer to hold RGB control data |
\*-----------------------------------------------------------------------------*/
unsigned char data[0x14] = {0};
data[0] = 0x14; /* size of data packet */
data[1] = 0x00;
data[2] = 0x01;
data[3] = 0x09;
data[4] = 0x01;
data[5] = 0x06;
data[6] = led_id;
data[7] = SEAGATE_MODE_BREATHING;
if(save)
{
data[8] = 0x03; /* 0x00 for no save, 0x03 for */
/* save */
}
else
{
data[8] = 0x00;
}
data[9] = 0x0F;
data[10] = 0x0F;
data[11] = 0x0F;
data[12] = 0x0F;
data[13] = r;
data[14] = g;
data[15] = b;
data[16] = 0xFF;
data[17] = 0xFF;
data[18] = 0xFF;
data[19] = 0x00;
/*-----------------------------------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------------------------------*/
SendPacket(data, 0x14);
}
void SeagateController::SetLEDsSpectrum
(
unsigned char led_id,
bool save
)
{
/*-----------------------------------------------------------------------------*\
| Create buffer to hold RGB control data |
\*-----------------------------------------------------------------------------*/
unsigned char data[0x0A] = {0};
data[0] = 0x0A; /* size of data packet */
data[1] = 0x00;
data[2] = 0x01;
data[3] = 0x09;
data[4] = 0x01;
data[5] = 0x06;
data[6] = led_id;
data[7] = SEAGATE_MODE_SPECTRUM;
data[8] = 0x02;
data[9] = 0xB4;
/*-----------------------------------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------------------------------*/
SendPacket(data, 0x0A);
}
void SeagateController::SetLEDStatic
(
unsigned char led_id,
unsigned char r,
unsigned char g,
unsigned char b,
bool save
)
{
/*-----------------------------------------------------------------------------*\
| Create buffer to hold RGB control data |
\*-----------------------------------------------------------------------------*/
unsigned char data[0x0E] = {0};
data[0] = 0x0E; /* size of data packet */
data[1] = 0x00;
data[2] = 0x01;
data[3] = 0x09;
data[4] = 0x01;
data[5] = 0x06;
data[6] = led_id;
data[7] = SEAGATE_MODE_STATIC;
if(save)
{
data[8] = 0x03; /* 0x00 for no save, 0x03 for */
/* save */
}
else
{
data[8] = 0x00;
}
data[9] = r;
data[10] = g;
data[11] = b;
data[12] = 0xFF;
data[13] = 0xFF;
/*-----------------------------------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------------------------------*/
SendPacket(data, 0x0E);
}
void SeagateController::SendPacket
(
unsigned char * packet,
unsigned char packet_sz
)
{
/*-----------------------------------------------------------------------------*\
| Create buffer to hold CDB |
\*-----------------------------------------------------------------------------*/
unsigned char cdb[12] = {0};
cdb[0] = 0xD2;
cdb[1] = 0x53; /* S */
cdb[2] = 0x65; /* e */
cdb[3] = 0x74; /* t */
cdb[4] = 0x4C; /* L */
cdb[5] = 0x65; /* e */
cdb[6] = 0x64; /* d */
cdb[7] = 0x00;
cdb[8] = 0x00;
cdb[9] = 0x30;
cdb[10] = packet_sz;
cdb[11] = 0x00;
/*-----------------------------------------------------------------------------*\
| Create buffer to hold sense data |
\*-----------------------------------------------------------------------------*/
unsigned char sense[32] = {0};
/*-----------------------------------------------------------------------------*\
| Write SCSI packet |
\*-----------------------------------------------------------------------------*/
scsi_write(dev, packet, packet_sz, cdb, 12, sense, 32);
}
@@ -0,0 +1,73 @@
/*-----------------------------------------*\
| SeagateController.h |
| |
| Definitions for Seagate Firecuda |
| External HDD RGB controller |
| |
| Adam Honse (CalcProgrammer1) 6/15/2023 |
\*-----------------------------------------*/
#pragma once
#include <string>
#include "scsiapi.h"
enum
{
SEAGATE_MODE_STATIC = 0x01, /* Static mode */
SEAGATE_MODE_BLINK = 0x02, /* Blink mode */
SEAGATE_MODE_BREATHING = 0x03, /* Breathing mode */
SEAGATE_MODE_SPECTRUM = 0x05, /* Spectrum mode */
};
class SeagateController
{
public:
SeagateController(scsi_device* dev_handle, char* path);
~SeagateController();
std::string GetLocation();
void SetLEDBlink
(
unsigned char led_id,
unsigned char r,
unsigned char g,
unsigned char b,
bool save
);
void SetLEDBreathing
(
unsigned char led_id,
unsigned char r,
unsigned char g,
unsigned char b,
bool save
);
void SetLEDsSpectrum
(
unsigned char led_id,
bool save
);
void SetLEDStatic
(
unsigned char led_id,
unsigned char r,
unsigned char g,
unsigned char b,
bool save
);
private:
scsi_device* dev;
std::string path;
void SendPacket
(
unsigned char * packet,
unsigned char packet_sz
);
};
@@ -0,0 +1,43 @@
#include "Detector.h"
#include "LogManager.h"
#include "SeagateController.h"
#include "RGBController.h"
#include "RGBController_Seagate.h"
#include <vector>
#include "scsiapi.h"
/******************************************************************************************\
* *
* DetectSeagateControllers *
* *
* Detects Seagate FireCuda HDD devices *
* *
\******************************************************************************************/
void DetectSeagateControllers()
{
scsi_device_info * info = scsi_enumerate(NULL, NULL);
while(info)
{
if(strncmp(info->vendor, "Seagate", 7) == 0 && strncmp(info->product, "FireCuda HDD", 12) == 0)
{
scsi_device * dev = scsi_open_path(info->path);
if(dev)
{
SeagateController* controller = new SeagateController(dev, info->path);
RGBController_Seagate* rgb_controller = new RGBController_Seagate(controller);
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
info = info->next;
}
scsi_free_enumeration(info);
} /* DetectSeagateControllers() */
REGISTER_DETECTOR("Seagate Firecuda HDD", DetectSeagateControllers);
@@ -12,14 +12,14 @@ void DetectViewSonic(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
if (dev)
{
VS_XG270QG_Controller* controller = new VS_XG270QG_Controller(dev, info->path);
RGBController_XG270QG* rgb_controller = new RGBController_XG270QG(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
REGISTER_HID_DETECTOR("ViewSonic Monitor XG270QG", DetectViewSonic, VIEWSONIC_VID, VS_XG270QG_PID);
REGISTER_HID_DETECTOR_IPU("ViewSonic Monitor XG270QG", DetectViewSonic, VIEWSONIC_VID, VS_XG270QG_PID, 0, 0xFF00, 1);
+2 -2
View File
@@ -45,7 +45,7 @@ public:
class HIDDeviceDetector
{
public:
HIDDeviceDetector(std::string name, HIDDeviceDetectorFunction detector, uint16_t vid, uint16_t pid, int64_t interface, int usage_page, int usage)
HIDDeviceDetector(std::string name, HIDDeviceDetectorFunction detector, uint16_t vid, uint16_t pid, int interface, int usage_page, int usage)
{
ResourceManager::get()->RegisterHIDDeviceDetector(name, detector, vid, pid, interface, usage_page, usage);
}
@@ -54,7 +54,7 @@ public:
class HIDWrappedDeviceDetector
{
public:
HIDWrappedDeviceDetector(std::string name, HIDWrappedDeviceDetectorFunction detector, uint16_t vid, uint16_t pid, int64_t interface, int usage_page, int usage)
HIDWrappedDeviceDetector(std::string name, HIDWrappedDeviceDetectorFunction detector, uint16_t vid, uint16_t pid, int interface, int usage_page, int usage)
{
ResourceManager::get()->RegisterHIDWrappedDeviceDetector(name, detector, vid, pid, interface, usage_page, usage);
}
+32 -1
View File
@@ -36,7 +36,7 @@ greaterThan(QT_MAJOR_VERSION, 4) {
#-----------------------------------------------------------------------------------------------#
MAJOR = 0
MINOR = 9
REVISION =
REVISION = 1
VERSION = $$MAJOR"."$$MINOR$$REVISION
TARGET = OpenRGB
TEMPLATE = app
@@ -64,18 +64,22 @@ INCLUDEPATH +=
dependencies/ColorWheel \
dependencies/Swatches/ \
dependencies/CRCpp/ \
dependencies/hidapi/ \
dependencies/hueplusplus-1.0.0/include \
dependencies/hueplusplus-1.0.0/include/hueplusplus \
dependencies/httplib \
dependencies/json/ \
dependencies/libe131/src/ \
dependencies/libcmmk/include/ \
dependencies/libusb-1.0.22/include/ \
dependencies/mdns \
dependencies/mbedtls-2.24.0/include/ \
hidapi_wrapper/ \
i2c_smbus/ \
i2c_tools/ \
net_port/ \
pci_ids/ \
scsiapi/ \
serial_port/ \
super_io/ \
AutoStart/ \
@@ -106,6 +110,7 @@ INCLUDEPATH +=
qt/OpenRGBZoneResizeDialog/ \
qt/OpenRGBZonesBulkResizer/ \
Controllers/A4TechController/ \
Controllers/AcerMonitorController/ \
Controllers/AlienwareController/ \
Controllers/AlienwareKeyboardController/ \
Controllers/AMDWraithPrismController/ \
@@ -169,6 +174,7 @@ INCLUDEPATH +=
Controllers/HyperXMicrophoneController/ \
Controllers/HyperXMouseController/ \
Controllers/HyperXMousematController/ \
Controllers/HYTEMousematController/ \
Controllers/IntelArcA770LEController/ \
Controllers/IonicoController/ \
Controllers/LEDStripController/ \
@@ -202,6 +208,7 @@ INCLUDEPATH +=
Controllers/RedSquareKeyroxController/ \
Controllers/RoccatController/ \
Controllers/SapphireGPUController/ \
Controllers/SeagateController/ \
Controllers/SinowealthController/ \
Controllers/SonyGamepadController/ \
Controllers/SRGBmodsController/ \
@@ -229,6 +236,7 @@ HEADERS +=
Colors.h \
dependencies/ColorWheel/ColorWheel.h \
dependencies/Swatches/swatches.h \
dependencies/hidapi/hidapi/hidapi.h \
dependencies/json/json.hpp \
dependencies/libcmmk/include/libcmmk/libcmmk.h \
LogManager.h \
@@ -295,6 +303,7 @@ HEADERS +=
qt/OpenRGBYeelightSettingsPage/OpenRGBYeelightSettingsPage.h \
qt/OpenRGBZoneResizeDialog/OpenRGBZoneResizeDialog.h \
qt/OpenRGBZonesBulkResizer/OpenRGBZonesBulkResizer.h \
scsiapi/scsiapi.h \
serial_port/find_usb_serial_port.h \
serial_port/serial_port.h \
StringUtils.h \
@@ -302,6 +311,8 @@ HEADERS +=
AutoStart/AutoStart.h \
Controllers/A4TechController/BloodyMouseController.h \
Controllers/A4TechController/RGBController_BloodyMouse.h \
Controllers/AcerMonitorController/AcerMonitorController.h \
Controllers/AcerMonitorController/RGBController_AcerMonitor.h \
Controllers/AlienwareController/AlienwareController.h \
Controllers/AlienwareController/RGBController_Alienware.h \
Controllers/AlienwareKeyboardController/AlienwareAW510KController.h \
@@ -529,6 +540,8 @@ HEADERS +=
Controllers/HyperXMouseController/RGBController_HyperXPulsefireRaid.h \
Controllers/HyperXMousematController/HyperXMousematController.h \
Controllers/HyperXMousematController/RGBController_HyperXMousemat.h \
Controllers/HYTEMousematController/HYTEMousematController.h \
Controllers/HYTEMousematController/RGBController_HYTEMousemat.h \
Controllers/IntelArcA770LEController/IntelArcA770LEController.h \
Controllers/IntelArcA770LEController/RGBController_IntelArcA770LE.h \
Controllers/IonicoController/IonicoController.h \
@@ -681,6 +694,8 @@ HEADERS +=
Controllers/SapphireGPUController/SapphireNitroGlowV3Controller.h \
Controllers/SapphireGPUController/RGBController_SapphireNitroGlowV1.h \
Controllers/SapphireGPUController/RGBController_SapphireNitroGlowV3.h \
Controllers/SeagateController/SeagateController.h \
Controllers/SeagateController/RGBController_Seagate.h \
Controllers/SinowealthController/SinowealthController.h \
Controllers/SinowealthController/SinowealthController1007.h \
Controllers/SinowealthController/SinowealthGMOWController.h \
@@ -881,6 +896,9 @@ SOURCES +=
Controllers/A4TechController/A4Tech_Detector.cpp \
Controllers/A4TechController/BloodyMouseController.cpp \
Controllers/A4TechController/RGBController_BloodyMouse.cpp \
Controllers/AcerMonitorController/AcerMonitorController.cpp \
Controllers/AcerMonitorController/AcerMonitorControllerDetect.cpp \
Controllers/AcerMonitorController/RGBController_AcerMonitor.cpp \
Controllers/AlienwareController/AlienwareController.cpp \
Controllers/AlienwareController/AlienwareControllerDetect.cpp \
Controllers/AlienwareController/RGBController_Alienware.cpp \
@@ -1177,6 +1195,9 @@ SOURCES +=
Controllers/HyperXMousematController/HyperXMousematController.cpp \
Controllers/HyperXMousematController/HyperXMousematControllerDetect.cpp \
Controllers/HyperXMousematController/RGBController_HyperXMousemat.cpp \
Controllers/HYTEMousematController/HYTEMousematController.cpp \
Controllers/HYTEMousematController/HYTEMousematControllerDetect.cpp \
Controllers/HYTEMousematController/RGBController_HYTEMousemat.cpp \
Controllers/IntelArcA770LEController/IntelArcA770LEController.cpp \
Controllers/IntelArcA770LEController/IntelArcA770LEControllerDetect.cpp \
Controllers/IonicoController/IonicoController.cpp \
@@ -1367,6 +1388,9 @@ SOURCES +=
Controllers/SapphireGPUController/SapphireGPUControllerDetect.cpp \
Controllers/SapphireGPUController/RGBController_SapphireNitroGlowV1.cpp \
Controllers/SapphireGPUController/RGBController_SapphireNitroGlowV3.cpp \
Controllers/SeagateController/SeagateController.cpp \
Controllers/SeagateController/SeagateControllerDetect.cpp \
Controllers/SeagateController/RGBController_Seagate.cpp \
Controllers/SinowealthController/SinowealthController.cpp \
Controllers/SinowealthController/SinowealthController1007.cpp \
Controllers/SinowealthController/SinowealthGMOWController.cpp \
@@ -1544,6 +1568,7 @@ FORMS +=
#-----------------------------------------------------------------------------------------------#
# Windows-specific Configuration #
#-----------------------------------------------------------------------------------------------#
win32:QMAKE_CXXFLAGS += /utf-8
win32:INCLUDEPATH += \
dependencies/display-library/include \
dependencies/hidapi \
@@ -1649,6 +1674,7 @@ win32:SOURCES +=
i2c_smbus/i2c_smbus_nct6775.cpp \
i2c_smbus/i2c_smbus_nvapi.cpp \
i2c_smbus/i2c_smbus_piix4.cpp \
scsiapi/scsiapi_windows.c \
serial_port/find_usb_serial_port_win.cpp \
wmi/wmi.cpp \
AutoStart/AutoStart-Windows.cpp \
@@ -1823,6 +1849,7 @@ contains(QMAKE_PLATFORM, linux) {
SOURCES += \
dependencies/hueplusplus-1.0.0/src/LinHttpHandler.cpp \
i2c_smbus/i2c_smbus_linux.cpp \
scsiapi/scsiapi_linux.c \
serial_port/find_usb_serial_port_linux.cpp \
AutoStart/AutoStart-Linux.cpp \
Controllers/AsusTUFLaptopController/AsusTUFLaptopLinuxController.cpp \
@@ -2028,6 +2055,9 @@ macx:contains(QMAKE_HOST.arch, arm64) {
INCLUDEPATH += \
/opt/homebrew/include \
SOURCES += \
scsiapi/scsiapi_macos.c \
LIBS += \
-L/opt/homebrew/lib \
}
@@ -2043,6 +2073,7 @@ macx:contains(QMAKE_HOST.arch, x86_64) {
SOURCES += \
i2c_smbus/i2c_smbus_i801.cpp \
scsiapi/scsiapi_macos.c \
HEADERS += \
dependencies/macUSPCIO/macUSPCIOAccess.h \
+6
View File
@@ -2,6 +2,7 @@
#include "filesystem.h"
#include "PluginManager.h"
#include "OpenRGBThemeManager.h"
#include "SettingsManager.h"
PluginManager::PluginManager()
{
@@ -108,6 +109,11 @@ void PluginManager::AddPlugin(const filesystem::path& path)
QPluginLoader* loader = new QPluginLoader(QString::fromStdString(path_string));
QObject* instance = loader->instance();
if(!loader->isLoaded())
{
LOG_WARNING("[PluginManager] Plugin %s cannot be loaded: %s", path.c_str(), loader->errorString().toStdString().c_str());
}
/*-----------------------------------------------------------------*\
| Check that the plugin is valid, then check the API version |
\*-----------------------------------------------------------------*/
+1
View File
@@ -2,6 +2,7 @@
#include "ResourceManager.h"
#include "RGBController_Dummy.h"
#include "LogManager.h"
#include "NetworkProtocol.h"
#include "filesystem.h"
#include <fstream>
#include <iostream>
+43 -64
View File
@@ -12,6 +12,9 @@
#include "ResourceManager.h"
#include "ProfileManager.h"
#include "LogManager.h"
#include "SettingsManager.h"
#include "NetworkClient.h"
#include "NetworkServer.h"
#include "filesystem.h"
#include "StringUtils.h"
@@ -37,6 +40,24 @@ const hidapi_wrapper default_wrapper =
(hidapi_wrapper_error) hid_error
};
bool BasicHIDBlock::compare(hid_device_info* info)
{
return ( (vid == info->vendor_id)
&& (pid == info->product_id)
#ifdef USE_HID_USAGE
&& ( (usage_page == HID_USAGE_PAGE_ANY)
|| (usage_page == info->usage_page) )
&& ( (usage == HID_USAGE_ANY)
|| (usage == info->usage) )
&& ( (interface == HID_INTERFACE_ANY)
|| (interface == info->interface_number ) )
#else
&& ( (interface == HID_INTERFACE_ANY)
|| (interface == info->interface_number ) )
#endif
);
}
ResourceManager* ResourceManager::instance;
using namespace std::chrono_literals;
@@ -270,7 +291,8 @@ void ResourceManager::RegisterHIDDeviceDetector(std::string name,
HIDDeviceDetectorBlock block;
block.name = name;
block.address = (vid << 16) | pid;
block.vid = vid;
block.pid = pid;
block.function = detector;
block.interface = interface;
block.usage_page = usage_page;
@@ -290,7 +312,8 @@ void ResourceManager::RegisterHIDWrappedDeviceDetector(std::string name,
HIDWrappedDeviceDetectorBlock block;
block.name = name;
block.address = (vid << 16) | pid;
block.vid = vid;
block.pid = pid;
block.function = detector;
block.interface = interface;
block.usage_page = usage_page;
@@ -1051,31 +1074,19 @@ void ResourceManager::DetectDevicesThreadFunction()
\*-----------------------------------------------------------------------------*/
for(unsigned int hid_detector_idx = 0; hid_detector_idx < hid_device_detectors.size() && detection_is_required.load(); hid_detector_idx++)
{
hid_devices = hid_enumerate(hid_device_detectors[hid_detector_idx].address >> 16, hid_device_detectors[hid_detector_idx].address & 0x0000FFFF);
HIDDeviceDetectorBlock & detector = hid_device_detectors[hid_detector_idx];
hid_devices = hid_enumerate(detector.vid, detector.pid);
LOG_VERBOSE("Trying to run detector for [%s] (for 0x%08hx)", hid_device_detectors[hid_detector_idx].name.c_str(), hid_device_detectors[hid_detector_idx].address);
LOG_VERBOSE("Trying to run detector for [%s] (for %04x:%04x)", detector.name.c_str(), detector.vid, detector.pid);
current_hid_device = hid_devices;
while(current_hid_device)
{
unsigned int addr = (current_hid_device->vendor_id << 16) | current_hid_device->product_id;
if(( ( hid_device_detectors[hid_detector_idx].address == addr ) )
#ifdef USE_HID_USAGE
&& ( ( hid_device_detectors[hid_detector_idx].usage_page == HID_USAGE_PAGE_ANY )
|| ( hid_device_detectors[hid_detector_idx].usage_page == current_hid_device->usage_page ) )
&& ( ( hid_device_detectors[hid_detector_idx].usage == HID_USAGE_ANY )
|| ( hid_device_detectors[hid_detector_idx].usage == current_hid_device->usage ) )
&& ( ( hid_device_detectors[hid_detector_idx].interface == HID_INTERFACE_ANY )
|| ( hid_device_detectors[hid_detector_idx].interface == current_hid_device->interface_number ) )
#else
&& ( ( hid_device_detectors[hid_detector_idx].interface == HID_INTERFACE_ANY )
|| ( hid_device_detectors[hid_detector_idx].interface == current_hid_device->interface_number ) )
#endif
)
if(detector.compare(current_hid_device))
{
detection_string = hid_device_detectors[hid_detector_idx].name.c_str();
detection_string = detector.name.c_str();
/*-------------------------------------------------*\
| Check if this detector is enabled or needs to be |
@@ -1093,7 +1104,7 @@ void ResourceManager::DetectDevicesThreadFunction()
{
DetectionProgressChanged();
hid_device_detectors[hid_detector_idx].function(current_hid_device, hid_device_detectors[hid_detector_idx].name);
detector.function(current_hid_device, hid_device_detectors[hid_detector_idx].name);
LOG_TRACE("[%s] detection end", detection_string);
}
@@ -1124,29 +1135,16 @@ void ResourceManager::DetectDevicesThreadFunction()
detection_string = "";
DetectionProgressChanged();
unsigned int addr = (current_hid_device->vendor_id << 16) | current_hid_device->product_id;
/*-----------------------------------------------------------------------------*\
| Loop through all available detectors. If all required information matches, |
| run the detector |
\*-----------------------------------------------------------------------------*/
for(unsigned int hid_detector_idx = 0; hid_detector_idx < hid_device_detectors.size() && detection_is_required.load(); hid_detector_idx++)
{
if(( ( hid_device_detectors[hid_detector_idx].address == addr ) )
#ifdef USE_HID_USAGE
&& ( ( hid_device_detectors[hid_detector_idx].usage_page == HID_USAGE_PAGE_ANY )
|| ( hid_device_detectors[hid_detector_idx].usage_page == current_hid_device->usage_page ) )
&& ( ( hid_device_detectors[hid_detector_idx].usage == HID_USAGE_ANY )
|| ( hid_device_detectors[hid_detector_idx].usage == current_hid_device->usage ) )
&& ( ( hid_device_detectors[hid_detector_idx].interface == HID_INTERFACE_ANY )
|| ( hid_device_detectors[hid_detector_idx].interface == current_hid_device->interface_number ) )
#else
&& ( ( hid_device_detectors[hid_detector_idx].interface == HID_INTERFACE_ANY )
|| ( hid_device_detectors[hid_detector_idx].interface == current_hid_device->interface_number ) )
#endif
)
HIDDeviceDetectorBlock & detector = hid_device_detectors[hid_detector_idx];
if(detector.compare(current_hid_device))
{
detection_string = hid_device_detectors[hid_detector_idx].name.c_str();
detection_string = detector.name.c_str();
/*-------------------------------------------------*\
| Check if this detector is enabled or needs to be |
@@ -1164,7 +1162,7 @@ void ResourceManager::DetectDevicesThreadFunction()
{
DetectionProgressChanged();
hid_device_detectors[hid_detector_idx].function(current_hid_device, hid_device_detectors[hid_detector_idx].name);
detector.function(current_hid_device, hid_device_detectors[hid_detector_idx].name);
}
}
}
@@ -1175,21 +1173,10 @@ void ResourceManager::DetectDevicesThreadFunction()
\*-----------------------------------------------------------------------------*/
for(unsigned int hid_detector_idx = 0; hid_detector_idx < hid_wrapped_device_detectors.size() && detection_is_required.load(); hid_detector_idx++)
{
if(( ( hid_wrapped_device_detectors[hid_detector_idx].address == addr ) )
#ifdef USE_HID_USAGE
&& ( ( hid_wrapped_device_detectors[hid_detector_idx].usage_page == HID_USAGE_PAGE_ANY )
|| ( hid_wrapped_device_detectors[hid_detector_idx].usage_page == current_hid_device->usage_page ) )
&& ( ( hid_wrapped_device_detectors[hid_detector_idx].usage == HID_USAGE_ANY )
|| ( hid_wrapped_device_detectors[hid_detector_idx].usage == current_hid_device->usage ) )
&& ( ( hid_wrapped_device_detectors[hid_detector_idx].interface == HID_INTERFACE_ANY )
|| ( hid_wrapped_device_detectors[hid_detector_idx].interface == current_hid_device->interface_number ) )
#else
&& ( ( hid_wrapped_device_detectors[hid_detector_idx].interface == HID_INTERFACE_ANY )
|| ( hid_wrapped_device_detectors[hid_detector_idx].interface == current_hid_device->interface_number ) )
#endif
)
HIDWrappedDeviceDetectorBlock & detector = hid_wrapped_device_detectors[hid_detector_idx];
if(detector.compare(current_hid_device))
{
detection_string = hid_wrapped_device_detectors[hid_detector_idx].name.c_str();
detection_string = detector.name.c_str();
/*-------------------------------------------------*\
| Check if this detector is enabled or needs to be |
@@ -1207,7 +1194,7 @@ void ResourceManager::DetectDevicesThreadFunction()
{
DetectionProgressChanged();
hid_wrapped_device_detectors[hid_detector_idx].function(default_wrapper, current_hid_device, hid_wrapped_device_detectors[hid_detector_idx].name);
detector.function(default_wrapper, current_hid_device, hid_wrapped_device_detectors[hid_detector_idx].name);
}
}
}
@@ -1293,24 +1280,16 @@ void ResourceManager::DetectDevicesThreadFunction()
detection_string = "";
DetectionProgressChanged();
unsigned int addr = (current_hid_device->vendor_id << 16) | current_hid_device->product_id;
/*-----------------------------------------------------------------------------*\
| Loop through all available wrapped HID detectors. If all required |
| information matches, run the detector |
\*-----------------------------------------------------------------------------*/
for(unsigned int hid_detector_idx = 0; hid_detector_idx < hid_wrapped_device_detectors.size() && detection_is_required.load(); hid_detector_idx++)
{
if(( ( hid_wrapped_device_detectors[hid_detector_idx].address == addr ) )
&& ( ( hid_wrapped_device_detectors[hid_detector_idx].usage_page == HID_USAGE_PAGE_ANY )
|| ( hid_wrapped_device_detectors[hid_detector_idx].usage_page == current_hid_device->usage_page ) )
&& ( ( hid_wrapped_device_detectors[hid_detector_idx].usage == HID_USAGE_ANY )
|| ( hid_wrapped_device_detectors[hid_detector_idx].usage == current_hid_device->usage ) )
&& ( ( hid_wrapped_device_detectors[hid_detector_idx].interface == HID_INTERFACE_ANY )
|| ( hid_wrapped_device_detectors[hid_detector_idx].interface == current_hid_device->interface_number ) )
)
HIDWrappedDeviceDetectorBlock & detector = hid_wrapped_device_detectors[hid_detector_idx];
if(detector.compare(current_hid_device))
{
detection_string = hid_wrapped_device_detectors[hid_detector_idx].name.c_str();
detection_string = detector.name.c_str();
/*-------------------------------------------------*\
| Check if this detector is enabled or needs to be |
@@ -1328,7 +1307,7 @@ void ResourceManager::DetectDevicesThreadFunction()
{
DetectionProgressChanged();
hid_wrapped_device_detectors[hid_detector_idx].function(wrapper, current_hid_device, hid_wrapped_device_detectors[hid_detector_idx].name);
detector.function(wrapper, current_hid_device, detector.name);
}
}
}
+25 -20
View File
@@ -19,11 +19,6 @@
#include "hidapi_wrapper.h"
#include "i2c_smbus.h"
#include "NetworkClient.h"
#include "NetworkServer.h"
#include "ProfileManager.h"
#include "RGBController.h"
#include "SettingsManager.h"
#include "filesystem.h"
#define HID_INTERFACE_ANY -1
@@ -33,6 +28,11 @@
#define CONTROLLER_LIST_HID 0
struct hid_device_info;
class NetworkClient;
class NetworkServer;
class ProfileManager;
class RGBController;
class SettingsManager;
typedef std::function<bool()> I2CBusDetectorFunction;
typedef std::function<void()> DeviceDetectorFunction;
@@ -43,25 +43,30 @@ typedef std::function<void(hidapi_wrapper wrapper, hid_device_info*, const std::
typedef std::function<void()> DynamicDetectorFunction;
typedef std::function<void()> PreDetectionHookFunction;
typedef struct
class BasicHIDBlock
{
std::string name;
HIDDeviceDetectorFunction function;
unsigned int address;
int interface;
int usage_page;
int usage;
} HIDDeviceDetectorBlock;
public:
std::string name;
uint16_t vid;
uint16_t pid;
int interface;
int usage_page;
int usage;
typedef struct
bool compare(hid_device_info* info);
};
class HIDDeviceDetectorBlock : public BasicHIDBlock
{
std::string name;
public:
HIDDeviceDetectorFunction function;
};
class HIDWrappedDeviceDetectorBlock : public BasicHIDBlock
{
public:
HIDWrappedDeviceDetectorFunction function;
unsigned int address;
int interface;
int usage_page;
int usage;
} HIDWrappedDeviceDetectorBlock;
};
typedef struct
{
+1
View File
@@ -18,6 +18,7 @@
#endif
#include "LogManager.h"
#include "SettingsManager.h"
using namespace std::chrono_literals;
+1
View File
@@ -10,6 +10,7 @@
#include "OlsApi.h"
#include "LogManager.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
using namespace std::chrono_literals;
+1
View File
@@ -12,6 +12,7 @@
#include "OlsApi.h"
#include "LogManager.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
i2c_smbus_piix4::i2c_smbus_piix4()
{
+6
View File
@@ -248,6 +248,7 @@
#define ASUS_ROG_STRIX_RTX_3090_O24G_GAMING_WHITE 0x87D9
#define ASUS_TUF_RTX_3090_O24G 0x87B5
#define ASUS_TUF_RTX_3090_O24G_OC 0x87B3
#define ASUS_TUF_RTX_3090TI_24G_GAMING 0x8875
#define ASUS_TUF_RTX_3090TI_O24G_OC_GAMING 0x8874
#define ASUS_TUF_RX_6700XT_O12G_GAMING 0x05C9
#define ASUS_ROG_STRIX_RX_6700XT_O12G_GAMING 0x05C7
@@ -258,8 +259,11 @@
#define ASUS_TUF_RX_6900XT_T16G_GAMING 0x04FE
#define ASUS_TUF_RX_6950XT_016G_GAMING 0x0504
#define ASUS_ROG_STRIX_LC_RX_6950XT_O16G_GAMING 0x05E9
#define ASUS_TUF_RTX_4070_O12G_GAMING 0x88DF
#define ASUS_TUF_RTX_4070TI_12G_GAMING 0x88A4
#define ASUS_TUF_RTX_4070TI_O12G_GAMING 0x88A3
#define ASUS_TUF_RTX_4080_16G_GAMING 0x88A2
#define ASUS_TUF_RTX_4080_16G_GAMING_2 0x88CB
#define ASUS_TUF_RTX_4080_O16G_OC_GAMING 0x88A1
#define ASUS_TUF_RTX_4090_O24G_OC_GAMING 0x889A
#define ASUS_TUF_RTX_4090_O24G_GAMING 0x889B
@@ -276,6 +280,7 @@
#define COLORFUL_IGAME_RTX_3060_ADVANCED_OC_12G_LV 0x140A
#define COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G 0x150A
#define COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2 0x1501
#define COLORFUL_IGAME_RTX_3060_TI_ADVANCED_OC 0x1401
#define COLORFUL_IGAME_RTX_3070_ADVANCED_OCV 0x140A
#define COLORFUL_IGAME_RTX_3070_ADVANCED_OCV2 0x1401
#define COLORFUL_IGAME_RTX_3070_ULTRAW_OC 0x150A
@@ -483,6 +488,7 @@
#define GIGABYTE_RTX3090_VISION_OC_24G_SUB_DEV 0x4044
#define GIGABYTE_RTX3090_XTREME_WATERFORCE_SUB_DEV 0x4039
#define GIGABYTE_RTX3090_XTREME_WATERFORCE_WB_SUB_DEV 0x403A
#define GIGABYTE_RTX4070_GAMING_OC_12G 0x40C6
#define GIGABYTE_RTX4070TI_GAMING_OC_12G 0x40C6
#define GIGABYTE_RTX4080_AERO_OC_SUB_DEV 0x40C5
#define GIGABYTE_RTX4080_EAGLE_OC_SUB_DEV 0x40BE
+2
View File
@@ -1,5 +1,7 @@
#include "DetectorTableModel.h"
#include "SettingsManager.h"
DetectorTableModel::DetectorTableModel(QObject* parent) : QAbstractTableModel(parent)
{
detectors.clear();
@@ -2,6 +2,7 @@
#include <QCheckBox>
#include "OpenRGBClientInfoPage.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
#include <iostream>
using namespace Ui;
@@ -1,6 +1,7 @@
#include "OpenRGBDMXSettingsPage.h"
#include "ui_OpenRGBDMXSettingsPage.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
using namespace Ui;
@@ -2,6 +2,7 @@
#include "OpenRGBDevicePage.h"
#include "OpenRGBZoneResizeDialog.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
#include "hsv.h"
using namespace Ui;
+1
View File
@@ -9,6 +9,7 @@
#include "OpenRGBPluginContainer.h"
#include "OpenRGBProfileSaveDialog.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
#include "TabLabel.h"
#include "OpenRGBZonesBulkResizer.h"
#include "OpenRGBThemeManager.h"
@@ -1,6 +1,7 @@
#include "OpenRGBE131SettingsPage.h"
#include "ui_OpenRGBE131SettingsPage.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
using namespace Ui;
@@ -1,6 +1,7 @@
#include "OpenRGBElgatoKeyLightSettingsPage.h"
#include "ui_OpenRGBElgatoKeyLightSettingsPage.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
using namespace Ui;
+1
View File
@@ -1,4 +1,5 @@
#include "OpenRGBFont.h"
#include <QStringList>
#include <QFontDatabase>
OpenRGBFont* OpenRGBFont::instance;
@@ -17,6 +17,9 @@ Ui::OpenRGBHardwareIDsDialog::OpenRGBHardwareIDsDialog(QWidget *parent) :
ui(new Ui::OpenRGBHardwareIDsDialogUi)
{
ui->setupUi(this);
ui->HardwareIdsList->header()->resizeSection(0 /*column index*/, 300 /*width*/);
ui->HardwareIdsList->header()->resizeSection(1 /*column index*/, 200 /*width*/);
ui->HardwareIdsList->header()->resizeSection(2 /*column index*/, 100 /*width*/);
}
Ui::OpenRGBHardwareIDsDialog::~OpenRGBHardwareIDsDialog()
@@ -122,6 +125,10 @@ int Ui::OpenRGBHardwareIDsDialog::show()
libusb_free_device_list(devices, 1);
}
i2c_top->setExpanded(true);
hid_top->setExpanded(true);
libusb_top->setExpanded(true);
return this->exec();
}
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>425</width>
<height>273</height>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
@@ -1,6 +1,7 @@
#include "OpenRGBKasaSmartSettingsPage.h"
#include "ui_OpenRGBKasaSmartSettingsPage.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
using namespace Ui;
@@ -1,6 +1,7 @@
#include "OpenRGBLIFXSettingsPage.h"
#include "ui_OpenRGBLIFXSettingsPage.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
using namespace Ui;
@@ -1,9 +1,8 @@
#include "OpenRGBNanoleafSettingsEntry.h"
#include "ui_OpenRGBNanoleafSettingsEntry.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
#include "NanoleafController.h"
#include "json.hpp"
using json = nlohmann::json;
using namespace Ui;
@@ -1,7 +1,8 @@
#include "OpenRGBNanoleafSettingsPage.h"
#include "ui_OpenRGBNanoleafSettingsPage.h"
#include "ResourceManager.h"
#include "json.hpp"
#include "SettingsManager.h"
using json = nlohmann::json;
using namespace Ui;
@@ -1,6 +1,7 @@
#include "OpenRGBPhilipsHueSettingsPage.h"
#include "ui_OpenRGBPhilipsHueSettingsPage.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
using namespace Ui;
@@ -1,6 +1,7 @@
#include "OpenRGBPhilipsWizSettingsPage.h"
#include "ui_OpenRGBPhilipsWizSettingsPage.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
using namespace Ui;
@@ -5,6 +5,7 @@
#include "filesystem.h"
#include "LogManager.h"
#include "SettingsManager.h"
#include "OpenRGBPluginsPage.h"
#include "ui_OpenRGBPluginsPage.h"
@@ -1,6 +1,7 @@
#include "OpenRGBQMKORGBSettingsPage.h"
#include "ui_OpenRGBQMKORGBSettingsPage.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
using namespace Ui;
@@ -1,6 +1,7 @@
#include "OpenRGBSerialSettingsPage.h"
#include "ui_OpenRGBSerialSettingsPage.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
using namespace Ui;
@@ -3,6 +3,8 @@
#include "ui_OpenRGBSettingsPage.h"
#include "LogManager.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
#include "ProfileManager.h"
#include <QUrl>
#include <QDesktopServices>
+3 -1
View File
@@ -6,7 +6,9 @@
#include <QDirIterator>
#include <QTranslator>
#include <QWidget>
#include "ResourceManager.h"
#include <json.hpp>
using json = nlohmann::json;
namespace Ui {
class OpenRGBSettingsPage;
+1
View File
@@ -1,6 +1,7 @@
#include "OpenRGBThemeManager.h"
#include "ResourceManager.h"
#include "PluginManager.h"
#include "SettingsManager.h"
#include <QApplication>
#include <QWidget>
#include <QStyle>
@@ -1,6 +1,7 @@
#include "OpenRGBYeelightSettingsPage.h"
#include "ui_OpenRGBYeelightSettingsPage.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
using namespace Ui;
@@ -1,6 +1,7 @@
#include "OpenRGBZonesBulkResizer.h"
#include "ui_OpenRGBZonesBulkResizer.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
#include "LogManager.h"
#include "OpenRGBDialog2.h"
#include <QDialog>

Some files were not shown because too many files have changed in this diff Show More