Compare commits
26
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
003c3e0af1 | ||
|
|
b5f46e3f1d | ||
|
|
16efabcce6 | ||
|
|
fbeb2c1c45 | ||
|
|
0295b9041f | ||
|
|
9a04b66bec | ||
|
|
37295adf6e | ||
|
|
0c16108c89 | ||
|
|
29b0816c9c | ||
|
|
f679081a2c | ||
|
|
ad2dcdb585 | ||
|
|
35aa66455c | ||
|
|
ff3dbdac4c | ||
|
|
0497941209 | ||
|
|
cacfffd101 | ||
|
|
bc91bd2838 | ||
|
|
d6e5645bb9 | ||
|
|
1cfd60261e | ||
|
|
75fd43c131 | ||
|
|
3256bc3296 | ||
|
|
b8f4b081a4 | ||
|
|
25d7ea3e6a | ||
|
|
817327586d | ||
|
|
a7885bac57 | ||
|
|
2ffef5facf | ||
|
|
50629dc4f9 |
@@ -105,7 +105,7 @@ RGBController_ASRockPolychromeV1SMBus::RGBController_ASRockPolychromeV1SMBus(ASR
|
||||
mode Music;
|
||||
Music.name = "Music";
|
||||
Music.value = POLYCHROME_V1_MODE_MUSIC;
|
||||
Music.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Music.flags = MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Music.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Music);
|
||||
|
||||
@@ -122,7 +122,6 @@ RGBController_ASRockPolychromeV1SMBus::RGBController_ASRockPolychromeV1SMBus(ASR
|
||||
/*---------------------------------------------------------------------*\
|
||||
| Comment out until per zone modes are working. These are only for ARGB |
|
||||
\*---------------------------------------------------------------------*/
|
||||
/*
|
||||
mode Spring;
|
||||
Spring.name = "Spring";
|
||||
Spring.value = POLYCHROME_V1_MODE_SPRING;
|
||||
@@ -192,7 +191,6 @@ RGBController_ASRockPolychromeV1SMBus::RGBController_ASRockPolychromeV1SMBus(ASR
|
||||
Rainbow.speed = POLYCHROME_V1_SPEED_DEFAULT_RAINBOW;
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Rainbow);
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------*\
|
||||
| This ARGB_Config section is a hack to allow users to configure the |
|
||||
|
||||
@@ -55,8 +55,8 @@ std::string AuraMousematController::GetVersion()
|
||||
unsigned char usb_buf_out[65];
|
||||
hid_read(dev, usb_buf_out, 65);
|
||||
|
||||
char version[8];
|
||||
snprintf(version, 8, "%X.%02X.%02X", usb_buf_out[6], usb_buf_out[7], usb_buf_out[8]);
|
||||
char version[9];
|
||||
snprintf(version, 9, "%X.%02X.%02X", usb_buf_out[6], usb_buf_out[7], usb_buf_out[8]);
|
||||
return std::string(version);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ void AuraMousematController::UpdateDevice
|
||||
usb_buf[0x0b + i * 3] = RGBGetGValue(colors[i]);
|
||||
usb_buf[0x0c + i * 3] = RGBGetBValue(colors[i]);
|
||||
}
|
||||
|
||||
|
||||
hid_write(dev, usb_buf, 65);
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ void ROGAllyController::UpdateDevice
|
||||
unsigned char mode,
|
||||
std::vector<RGBColor> colors,
|
||||
unsigned char speed,
|
||||
unsigned char brightness,
|
||||
unsigned char /*brightness*/,
|
||||
unsigned char direction
|
||||
)
|
||||
{
|
||||
|
||||
@@ -1,25 +1,238 @@
|
||||
#ifdef _WIN32
|
||||
|
||||
#include "AsusTUFLaptopController.h"
|
||||
#include "acpiwmi.h"
|
||||
|
||||
#include <Objbase.h>
|
||||
#include <setupapi.h>
|
||||
#include <comdef.h>
|
||||
#include <Wbemidl.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
|
||||
static bool coInitialized = 0;
|
||||
|
||||
static GUID CLSID_GUID_DEVCLASS_SYSTEM = { 0x4D36E97D, 0xE325, 0x11CE, {0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18 } };
|
||||
|
||||
int AsusTUFLaptopController::checkWMIType()
|
||||
{
|
||||
int n;
|
||||
int v6;
|
||||
int result = 0;
|
||||
struct _SP_DEVINFO_DATA DeviceInfoData;
|
||||
const int bufsize = 260;
|
||||
wchar_t PropertyBuffer[bufsize];
|
||||
|
||||
HDEVINFO devinfo = SetupDiGetClassDevsW(&CLSID_GUID_DEVCLASS_SYSTEM, 0, 0, 2u);
|
||||
if ( devinfo == HDEVINFO(-1) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
n = 0;
|
||||
DeviceInfoData.cbSize = sizeof(DeviceInfoData);
|
||||
|
||||
while ( SetupDiEnumDeviceInfo(devinfo, n, &DeviceInfoData) ) // Invalid buffer
|
||||
{
|
||||
if ( SetupDiGetDeviceRegistryPropertyW(devinfo,
|
||||
&DeviceInfoData,
|
||||
SPDRP_ENUMERATOR_NAME,
|
||||
NULL,
|
||||
PBYTE(PropertyBuffer),
|
||||
sizeof(PropertyBuffer),
|
||||
0) )
|
||||
{
|
||||
// If we found property "ACPI"
|
||||
if(!wcscmp(PropertyBuffer, L"ACPI"))
|
||||
{
|
||||
memset(PropertyBuffer, 0, sizeof(PropertyBuffer));
|
||||
if ( SetupDiGetDeviceInstanceIdW(devinfo, &DeviceInfoData, PropertyBuffer, bufsize, 0) )
|
||||
{
|
||||
_wcsupr_s(PropertyBuffer, bufsize);
|
||||
if(wcsstr(PropertyBuffer, L"ACPI\\ATK0100"))
|
||||
{
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
if(!wcscmp(PropertyBuffer, L"ACPI\\PNP0C14\\ATK"))
|
||||
{
|
||||
result = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
++n;
|
||||
}
|
||||
SetupDiDestroyDeviceInfoList(devinfo);
|
||||
return result;
|
||||
}
|
||||
|
||||
AsusTUFLaptopController::AsusTUFLaptopController()
|
||||
{
|
||||
/*---------------------------------------------------*\
|
||||
| Call AsWMI_Open at least once during initialization.|
|
||||
| Since it's part of the firmware it's guaranteed to |
|
||||
| always be there. This is necessary to issue further |
|
||||
| commands. |
|
||||
\*---------------------------------------------------*/
|
||||
AsWMI_Open();
|
||||
hDevice = CreateFileW(L"\\\\.\\ATKACPI", 0xC0000000, 3u, 0, 3u, 0, 0);
|
||||
}
|
||||
|
||||
AsusTUFLaptopController* AsusTUFLaptopController::checkAndCreate()
|
||||
{
|
||||
// This might cause issues when coInitialize() is used in multiple places
|
||||
HRESULT init = CoInitializeEx(0, COINIT_APARTMENTTHREADED);
|
||||
if ( init < 0 && init != 0x80010106 )
|
||||
return 0;
|
||||
coInitialized = 1;
|
||||
|
||||
int type = checkWMIType();
|
||||
if ( type == 2 )
|
||||
{
|
||||
AsusTUFLaptopController* controller = new AsusTUFLaptopController();
|
||||
if(controller->hDevice != HANDLE(-1))
|
||||
{
|
||||
return controller;
|
||||
}
|
||||
delete controller;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AsusTUFLaptopController::~AsusTUFLaptopController()
|
||||
{
|
||||
if ( hDevice && hDevice != HANDLE(-1) )
|
||||
{
|
||||
CloseHandle(hDevice);
|
||||
hDevice = 0;
|
||||
}
|
||||
// This might cause issues when coInitialize() is used in multiple places
|
||||
if ( coInitialized )
|
||||
{
|
||||
CoUninitialize();
|
||||
coInitialized = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void AsusTUFLaptopController::SetMode(unsigned char red,
|
||||
bool AsusTUFLaptopController::deviceIoControlWrapper(const void *dataIn, int commandIndex, int dataSizeIn, void *dataOut, int *dataSizeOut)
|
||||
{
|
||||
size_t BytesReturned;
|
||||
const int bufsize = 1024;
|
||||
char outBuffer[bufsize];
|
||||
|
||||
LPDWORD inBuffer = LPDWORD(malloc(dataSizeIn + 8));
|
||||
inBuffer[0] = commandIndex;
|
||||
inBuffer[1] = dataSizeIn;
|
||||
memmove(inBuffer + 2, dataIn, dataSizeIn);
|
||||
memset(outBuffer, 0, bufsize);
|
||||
BytesReturned = 0;
|
||||
bool result = DeviceIoControl(
|
||||
hDevice,
|
||||
0x22240Cu,
|
||||
inBuffer,
|
||||
dataSizeIn + 8,
|
||||
outBuffer,
|
||||
bufsize,
|
||||
LPDWORD(&BytesReturned),
|
||||
0);
|
||||
if ( result )
|
||||
{
|
||||
if ( *dataSizeOut < BytesReturned )
|
||||
{
|
||||
BytesReturned = *dataSizeOut;
|
||||
}
|
||||
memmove(dataOut, outBuffer, BytesReturned);
|
||||
}
|
||||
free(inBuffer);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool AsusTUFLaptopController::deviceControl(int a1, int a2)
|
||||
{
|
||||
if ( hDevice && hDevice != HANDLE(-1) )
|
||||
{
|
||||
int data[2];
|
||||
data[0] = a1;
|
||||
data[1] = a2;
|
||||
int result;
|
||||
int outBufSize = 4;
|
||||
if ( deviceIoControlWrapper(&data, 1398162756, 8, &result, &outBufSize) )
|
||||
{
|
||||
if(outBufSize < 4)
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
if ( result == 1 )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool AsusTUFLaptopController::deviceControl(int a1, int a2, int a3)
|
||||
{
|
||||
unsigned int data[3];
|
||||
data[0] = a1;
|
||||
data[1] = a2;
|
||||
data[2] = a3;
|
||||
int outBuf;
|
||||
int outBufSize = 4;
|
||||
|
||||
if ( hDevice && hDevice != HANDLE(-1) )
|
||||
{
|
||||
if ( deviceIoControlWrapper(data, 0x53564544, 12, &outBuf, &outBufSize) )
|
||||
{
|
||||
if(outBufSize < 4)
|
||||
{
|
||||
outBuf = 0;
|
||||
}
|
||||
if ( outBuf == 1 )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool AsusTUFLaptopController::getStatus(int a1, int *out)
|
||||
{
|
||||
int status;
|
||||
int statusSize = 4;
|
||||
|
||||
if ( !hDevice || hDevice == HANDLE(-1) || (!deviceIoControlWrapper(&a1, 1398035268, 4, &status, &statusSize)) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if(statusSize < 4)
|
||||
{
|
||||
status = 0;
|
||||
}
|
||||
*out = status;
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool AsusTUFLaptopController::getStatusExtended(int a1, int a2, int *status1, int *status2, int* status3)
|
||||
{
|
||||
int commandData[2];
|
||||
commandData[0] = a1;
|
||||
commandData[1] = a2;
|
||||
int statusBuffer[3];
|
||||
int statusSize = 12;
|
||||
|
||||
if ( hDevice && hDevice != HANDLE(-1)
|
||||
&& deviceIoControlWrapper(commandData, 1398035268, 8, statusBuffer, &statusSize) )
|
||||
{
|
||||
*status1 = statusBuffer[0];
|
||||
*status2 = statusBuffer[1];
|
||||
*status3 = statusBuffer[2];
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void AsusTUFLaptopController::setMode(unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue,
|
||||
unsigned char mode,
|
||||
@@ -63,14 +276,14 @@ void AsusTUFLaptopController::SetMode(unsigned char red,
|
||||
unsigned int high = save_val | (mode<<8) | (red<<16) | (green<<24);
|
||||
unsigned int low = blue | (speed_val<<8);
|
||||
|
||||
AsWMI_NB_DeviceControl_2arg(ASUS_WMI_DEVID_TUF_RGB_MODE, high, low);
|
||||
deviceControl(ASUS_WMI_DEVID_TUF_RGB_MODE, high, low);
|
||||
|
||||
}
|
||||
|
||||
unsigned char AsusTUFLaptopController::GetBrightness()
|
||||
unsigned char AsusTUFLaptopController::getBrightness()
|
||||
{
|
||||
int backlight_state = 0;
|
||||
AsWMI_NB_GetDeviceStatus(ASUS_WMI_DEVID_KBD_BACKLIGHT, &backlight_state);
|
||||
getStatus(ASUS_WMI_DEVID_KBD_BACKLIGHT, &backlight_state);
|
||||
|
||||
/*----------------------------------------------*\
|
||||
| Only lowest two bits indicate brightness level |
|
||||
@@ -78,19 +291,19 @@ unsigned char AsusTUFLaptopController::GetBrightness()
|
||||
return backlight_state & 0x7F;
|
||||
}
|
||||
|
||||
void AsusTUFLaptopController::SetBrightness(unsigned char brightness)
|
||||
void AsusTUFLaptopController::setBrightness(unsigned char brightness)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Only calls in this format persistently set brightness |
|
||||
\*-----------------------------------------------------*/
|
||||
int ctrl_param = 0x80 | (brightness & 0x7F);
|
||||
AsWMI_NB_DeviceControl(ASUS_WMI_DEVID_KBD_BACKLIGHT, ctrl_param);
|
||||
deviceControl(ASUS_WMI_DEVID_KBD_BACKLIGHT, ctrl_param);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*\
|
||||
| These settings will not persist a reboot unless save is set |
|
||||
\*-----------------------------------------------------------*/
|
||||
void AsusTUFLaptopController::SetPowerState(bool boot,
|
||||
void AsusTUFLaptopController::setPowerState(bool boot,
|
||||
bool awake,
|
||||
bool sleep,
|
||||
bool shutdown,
|
||||
@@ -105,7 +318,13 @@ void AsusTUFLaptopController::SetPowerState(bool boot,
|
||||
|
||||
if (save) state = state | ASUS_WMI_KEYBOARD_POWER_SAVE;
|
||||
|
||||
AsWMI_NB_DeviceControl(ASUS_WMI_DEVID_TUF_RGB_STATE, state);
|
||||
deviceControl(ASUS_WMI_DEVID_TUF_RGB_STATE, state);
|
||||
}
|
||||
|
||||
#endif // _WIN32
|
||||
void AsusTUFLaptopController::setFanMode(int mode)
|
||||
{
|
||||
deviceControl(ASUS_WMI_DEVID_FAN_BOOST_MODE, mode);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
#ifdef _WIN32
|
||||
|
||||
#ifndef ASUSTUFLAPTOPCONTROLLER_H
|
||||
#define ASUSTUFLAPTOPCONTROLLER_H
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define ASUS_WMI_DEVID_KBD_BACKLIGHT 0x00050021
|
||||
#define ASUS_WMI_DEVID_TUF_RGB_MODE 0x00100056
|
||||
#define ASUS_WMI_DEVID_TUF_RGB_STATE 0x00100057
|
||||
|
||||
#define ASUS_WMI_DEVID_FAN_BOOST_MODE 0x00110018
|
||||
#define ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY 0x00120075
|
||||
|
||||
#define ASUS_WMI_KEYBOARD_SPEED_SLOW 0xE1
|
||||
#define ASUS_WMI_KEYBOARD_SPEED_NORMAL 0xEB
|
||||
#define ASUS_WMI_KEYBOARD_SPEED_FAST 0xF5
|
||||
@@ -32,29 +37,46 @@
|
||||
|
||||
#define ASUS_WMI_KEYBOARD_POWER_SAVE 0x01<<8
|
||||
|
||||
#define ASUS_WMI_FAN_SPEED_NORMAL 0
|
||||
#define ASUS_WMI_FAN_SPEED_TURBO 1
|
||||
#define ASUS_WMI_FAN_SPEED_SILENT 2
|
||||
|
||||
class AsusTUFLaptopController
|
||||
{
|
||||
public:
|
||||
private:
|
||||
HANDLE hDevice;
|
||||
static int checkWMIType();
|
||||
AsusTUFLaptopController();
|
||||
|
||||
bool deviceIoControlWrapper(const void *dataIn, int commandIndex, int dataSizeIn, void *dataOut, int *dataSizeOut);
|
||||
bool deviceControl(int a1, int a2);
|
||||
bool deviceControl(int a1, int a2, int a3);
|
||||
bool getStatus(int a1, int *out);
|
||||
bool getStatusExtended(int a1, int a2, int *status1, int *status2, int* status3);
|
||||
|
||||
public:
|
||||
static AsusTUFLaptopController * checkAndCreate();
|
||||
~AsusTUFLaptopController();
|
||||
|
||||
void SetMode(unsigned char red,
|
||||
void setMode(unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue,
|
||||
unsigned char mode,
|
||||
unsigned char speed,
|
||||
bool save);
|
||||
|
||||
unsigned char GetBrightness();
|
||||
void SetBrightness(unsigned char brightness);
|
||||
unsigned char getBrightness();
|
||||
void setBrightness(unsigned char brightness);
|
||||
|
||||
void SetPowerState(bool boot,
|
||||
void setPowerState(bool boot,
|
||||
bool awake,
|
||||
bool sleep,
|
||||
bool shutdown,
|
||||
bool save);
|
||||
|
||||
void setFanMode(int mode);
|
||||
};
|
||||
|
||||
#endif // ASUSTUFLAPTOPCONTROLLER_H
|
||||
#endif
|
||||
|
||||
#endif // _WIN32
|
||||
#endif // ASUSTUFLAPTOPCONTROLLER_H
|
||||
|
||||
+1
-1
@@ -25,4 +25,4 @@ static void DetectAsusTUFLaptopLinuxControllers()
|
||||
return;
|
||||
}
|
||||
|
||||
REGISTER_DETECTOR("ASUS TUF Laptop Linux WMI", DetectAsusTUFLaptopLinuxControllers);
|
||||
REGISTER_DETECTOR("ASUS TUF Laptop", DetectAsusTUFLaptopLinuxControllers);
|
||||
@@ -3,7 +3,6 @@
|
||||
#include "AsusTUFLaptopController.h"
|
||||
#include "RGBController_AsusTUFLaptopWMI.h"
|
||||
|
||||
#include "acpiwmi.h"
|
||||
#include "Detector.h"
|
||||
#include "wmi.h"
|
||||
#include <string>
|
||||
@@ -36,16 +35,15 @@ static void DetectAsusTUFLaptopWMIControllers()
|
||||
return;
|
||||
}
|
||||
|
||||
if(AsWMI_Open())
|
||||
AsusTUFLaptopController* controller = AsusTUFLaptopController::checkAndCreate();
|
||||
if(controller)
|
||||
{
|
||||
AsusTUFLaptopController* asus_wmi_controller = new AsusTUFLaptopController();
|
||||
RGBController* new_controller = new RGBController_AsusTUFLaptopWMI(asus_wmi_controller);
|
||||
RGBController* new_controller = new RGBController_AsusTUFLaptopWMI(controller);
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(new_controller);
|
||||
// Success! No more if's
|
||||
}
|
||||
} /* DetectFaustusControllers() */
|
||||
} /* DetectAsusTUFLaptopWMIControllers() */
|
||||
|
||||
REGISTER_DETECTOR("TUF Laptop WMI", DetectAsusTUFLaptopWMIControllers);
|
||||
REGISTER_DETECTOR("ASUS TUF Laptop", DetectAsusTUFLaptopWMIControllers);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -133,7 +133,7 @@ void RGBController_AsusTUFLaptopWMI::ControllerSetMode(bool save)
|
||||
speed = (unsigned char)modes[(unsigned int)active_mode].speed;
|
||||
}
|
||||
|
||||
controller->SetMode(red, green, blue, mode, speed, save);
|
||||
controller->setMode(red, green, blue, mode, speed, save);
|
||||
}
|
||||
|
||||
void RGBController_AsusTUFLaptopWMI::DeviceUpdateLEDs()
|
||||
@@ -155,7 +155,7 @@ void RGBController_AsusTUFLaptopWMI::DeviceUpdateMode()
|
||||
{
|
||||
if (modes[(unsigned int)active_mode].flags & MODE_FLAG_HAS_BRIGHTNESS)
|
||||
{
|
||||
controller->SetBrightness((unsigned char)modes[(unsigned int)active_mode].brightness);
|
||||
controller->setBrightness((unsigned char)modes[(unsigned int)active_mode].brightness);
|
||||
}
|
||||
ControllerSetMode(false);
|
||||
}
|
||||
@@ -164,7 +164,7 @@ void RGBController_AsusTUFLaptopWMI::ReadConfiguration()
|
||||
{
|
||||
if (modes[(unsigned int)active_mode].flags & MODE_FLAG_HAS_BRIGHTNESS)
|
||||
{
|
||||
modes[(unsigned int)active_mode].brightness = controller->GetBrightness();
|
||||
modes[(unsigned int)active_mode].brightness = controller->getBrightness();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,16 @@
|
||||
|
||||
#include "RGBController_CryorigH7QuadLumi.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Cryorig H7 Quad Lumi
|
||||
@category Cooler
|
||||
@type USB
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :white_check_mark:
|
||||
@detectors DetectCryorigH7QuadLumi
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_CryorigH7QuadLumi::RGBController_CryorigH7QuadLumi(CryorigH7QuadLumiController* controller_ptr)
|
||||
{
|
||||
|
||||
@@ -31,8 +31,9 @@ static const char* ene_channels[] = /* ENE channel strings
|
||||
|
||||
ENESMBusController::ENESMBusController(ENESMBusInterface* interface, ene_dev_id dev)
|
||||
{
|
||||
this->interface = interface;
|
||||
this->dev = dev;
|
||||
this->interface = interface;
|
||||
this->dev = dev;
|
||||
supports_mode_14 = false;
|
||||
|
||||
UpdateDeviceName();
|
||||
|
||||
@@ -93,6 +94,17 @@ ENESMBusController::ENESMBusController(ENESMBusInterface* interface, ene_dev_id
|
||||
direct_reg = ENE_REG_COLORS_DIRECT_V2;
|
||||
effect_reg = ENE_REG_COLORS_EFFECT_V2;
|
||||
channel_cfg = ENE_CONFIG_CHANNEL_V1;
|
||||
|
||||
// Check for Mode 14 support, only known to exist on modules where the
|
||||
// DRAM 3 zone ID exists
|
||||
for(std::size_t cfg_zone_idx = 0; cfg_zone_idx < ENE_NUM_ZONES; cfg_zone_idx++)
|
||||
{
|
||||
if(config_table[channel_cfg + cfg_zone_idx] == (unsigned char)ENE_LED_CHANNEL_DRAM_3)
|
||||
{
|
||||
supports_mode_14 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// AUMA0-E6K5-0106 - Second generation motherboard controller
|
||||
else if (strcmp(device_name, "AUMA0-E6K5-0106") == 0)
|
||||
@@ -187,6 +199,8 @@ std::string ENESMBusController::GetDeviceLocation()
|
||||
|
||||
const char * ENESMBusController::GetChannelName(unsigned int cfg_zone)
|
||||
{
|
||||
LOG_TRACE("[%s] Config table for zone %02d: %02d", device_name, cfg_zone, config_table[channel_cfg + cfg_zone]);
|
||||
|
||||
switch(config_table[channel_cfg + cfg_zone])
|
||||
{
|
||||
case (unsigned char)ENE_LED_CHANNEL_AUDIO:
|
||||
@@ -211,6 +225,7 @@ const char * ENESMBusController::GetChannelName(unsigned int cfg_zone)
|
||||
|
||||
case (unsigned char)ENE_LED_CHANNEL_DRAM:
|
||||
case (unsigned char)ENE_LED_CHANNEL_DRAM_2:
|
||||
case (unsigned char)ENE_LED_CHANNEL_DRAM_3:
|
||||
return(ene_channels[5]);
|
||||
break;
|
||||
|
||||
@@ -238,6 +253,7 @@ const char * ENESMBusController::GetChannelName(unsigned int cfg_zone)
|
||||
|
||||
unsigned int ENESMBusController::GetLEDCount(unsigned int cfg_zone)
|
||||
{
|
||||
LOG_TRACE("[%s] LED Count for zone %02d: %02d", device_name, cfg_zone, config_table[0x03 + cfg_zone]);
|
||||
return(config_table[0x03 + cfg_zone]);
|
||||
}
|
||||
|
||||
@@ -367,6 +383,11 @@ void ENESMBusController::SetMode(unsigned char mode, unsigned char speed, unsign
|
||||
ENERegisterWrite(ENE_REG_APPLY, ENE_APPLY_VAL);
|
||||
}
|
||||
|
||||
bool ENESMBusController::SupportsMode14()
|
||||
{
|
||||
return(supports_mode_14);
|
||||
}
|
||||
|
||||
void ENESMBusController::UpdateDeviceName()
|
||||
{
|
||||
for (int i = 0; i < 16; i++)
|
||||
|
||||
@@ -53,6 +53,7 @@ enum
|
||||
ENE_MODE_SPECTRUM_CYCLE_WAVE = 11, /* Wave effect mode */
|
||||
ENE_MODE_CHASE_RAINBOW_PULSE = 12, /* Chase with Rainbow Pulse effect mode*/
|
||||
ENE_MODE_RANDOM_FLICKER = 13, /* Random flicker effect mode */
|
||||
ENE_MODE_DOUBLE_FADE = 14, /* Rainbow fade to dual color */
|
||||
ENE_NUMBER_MODES /* Number of Aura modes */
|
||||
};
|
||||
|
||||
@@ -74,6 +75,7 @@ enum
|
||||
enum
|
||||
{
|
||||
ENE_LED_CHANNEL_DRAM_2 = 0x05, /* DRAM LED channel */
|
||||
ENE_LED_CHANNEL_DRAM_3 = 0x0E, /* DRAM LED channel */
|
||||
ENE_LED_CHANNEL_CENTER_START = 0x82, /* Center zone first LED channel */
|
||||
ENE_LED_CHANNEL_CENTER = 0x83, /* Center zone LED channel */
|
||||
ENE_LED_CHANNEL_AUDIO = 0x84, /* Audio zone LED channel */
|
||||
@@ -118,6 +120,7 @@ public:
|
||||
void SetLEDColorDirect(unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetLEDColorEffect(unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetMode(unsigned char mode, unsigned char speed, unsigned char direction);
|
||||
bool SupportsMode14();
|
||||
|
||||
void UpdateDeviceName();
|
||||
|
||||
@@ -134,5 +137,5 @@ private:
|
||||
unsigned char channel_cfg;
|
||||
ENESMBusInterface* interface;
|
||||
ene_dev_id dev;
|
||||
|
||||
bool supports_mode_14;
|
||||
};
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController_ENESMBus.h"
|
||||
#include "LogManager.h"
|
||||
#include "ResourceManager.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name ENE SMBus Device
|
||||
@@ -23,6 +25,24 @@ RGBController_ENESMBus::RGBController_ENESMBus(ENESMBusController * controller_p
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Get ENEController settings |
|
||||
\*---------------------------------------------------------*/
|
||||
json ene_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("ENESMBusSettings");
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Check if save to device is enabled |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned int save_flag = 0;
|
||||
|
||||
if(ene_settings.contains("enable_save"))
|
||||
{
|
||||
if(ene_settings["enable_save"] == true)
|
||||
{
|
||||
save_flag = MODE_FLAG_MANUAL_SAVE;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Determine name and type (DRAM or Motherboard) by checking |
|
||||
| the ENE controller's version string |
|
||||
@@ -46,99 +66,112 @@ RGBController_ENESMBus::RGBController_ENESMBus(ENESMBusController * controller_p
|
||||
description = "ENE SMBus Device";
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0xFFFF;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0xFFFF;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Off;
|
||||
Off.name = "Off";
|
||||
Off.value = ENE_MODE_OFF;
|
||||
Off.flags = MODE_FLAG_MANUAL_SAVE;
|
||||
Off.color_mode = MODE_COLORS_NONE;
|
||||
Off.name = "Off";
|
||||
Off.value = ENE_MODE_OFF;
|
||||
Off.flags = save_flag;
|
||||
Off.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Off);
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = ENE_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE;
|
||||
Static.color_mode = MODE_COLORS_PER_LED;
|
||||
Static.name = "Static";
|
||||
Static.value = ENE_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR | save_flag;
|
||||
Static.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = ENE_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE;
|
||||
Breathing.color_mode = MODE_COLORS_PER_LED;
|
||||
Breathing.speed_min = ENE_SPEED_SLOWEST;
|
||||
Breathing.speed_max = ENE_SPEED_FASTEST;
|
||||
Breathing.speed = ENE_SPEED_NORMAL;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = ENE_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_SPEED | save_flag;
|
||||
Breathing.color_mode = MODE_COLORS_PER_LED;
|
||||
Breathing.speed_min = ENE_SPEED_SLOWEST;
|
||||
Breathing.speed_max = ENE_SPEED_FASTEST;
|
||||
Breathing.speed = ENE_SPEED_NORMAL;
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Flashing;
|
||||
Flashing.name = "Flashing";
|
||||
Flashing.value = ENE_MODE_FLASHING;
|
||||
Flashing.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE;
|
||||
Flashing.color_mode = MODE_COLORS_PER_LED;
|
||||
Flashing.speed_min = ENE_SPEED_SLOWEST;
|
||||
Flashing.speed_max = ENE_SPEED_FASTEST;
|
||||
Flashing.speed = ENE_SPEED_NORMAL;
|
||||
Flashing.name = "Flashing";
|
||||
Flashing.value = ENE_MODE_FLASHING;
|
||||
Flashing.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_SPEED | save_flag;
|
||||
Flashing.color_mode = MODE_COLORS_PER_LED;
|
||||
Flashing.speed_min = ENE_SPEED_SLOWEST;
|
||||
Flashing.speed_max = ENE_SPEED_FASTEST;
|
||||
Flashing.speed = ENE_SPEED_NORMAL;
|
||||
modes.push_back(Flashing);
|
||||
|
||||
mode SpectrumCycle;
|
||||
SpectrumCycle.name = "Spectrum Cycle";
|
||||
SpectrumCycle.value = ENE_MODE_SPECTRUM_CYCLE;
|
||||
SpectrumCycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE;
|
||||
SpectrumCycle.color_mode = MODE_COLORS_NONE;
|
||||
SpectrumCycle.speed_min = ENE_SPEED_SLOWEST;
|
||||
SpectrumCycle.speed_max = ENE_SPEED_FASTEST;
|
||||
SpectrumCycle.speed = ENE_SPEED_NORMAL;
|
||||
SpectrumCycle.name = "Spectrum Cycle";
|
||||
SpectrumCycle.value = ENE_MODE_SPECTRUM_CYCLE;
|
||||
SpectrumCycle.flags = MODE_FLAG_HAS_SPEED | save_flag;
|
||||
SpectrumCycle.color_mode = MODE_COLORS_NONE;
|
||||
SpectrumCycle.speed_min = ENE_SPEED_SLOWEST;
|
||||
SpectrumCycle.speed_max = ENE_SPEED_FASTEST;
|
||||
SpectrumCycle.speed = ENE_SPEED_NORMAL;
|
||||
modes.push_back(SpectrumCycle);
|
||||
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = ENE_MODE_RAINBOW;
|
||||
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_MANUAL_SAVE;
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
Rainbow.speed_min = ENE_SPEED_SLOWEST;
|
||||
Rainbow.speed_max = ENE_SPEED_FASTEST;
|
||||
Rainbow.speed = ENE_SPEED_NORMAL;
|
||||
Rainbow.direction = MODE_DIRECTION_LEFT;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = ENE_MODE_RAINBOW;
|
||||
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | save_flag;
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
Rainbow.speed_min = ENE_SPEED_SLOWEST;
|
||||
Rainbow.speed_max = ENE_SPEED_FASTEST;
|
||||
Rainbow.speed = ENE_SPEED_NORMAL;
|
||||
Rainbow.direction = MODE_DIRECTION_LEFT;
|
||||
modes.push_back(Rainbow);
|
||||
|
||||
mode ChaseFade;
|
||||
ChaseFade.name = "Chase Fade";
|
||||
ChaseFade.value = ENE_MODE_CHASE_FADE;
|
||||
ChaseFade.flags = MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_MANUAL_SAVE;
|
||||
ChaseFade.color_mode = MODE_COLORS_PER_LED;
|
||||
ChaseFade.speed_min = ENE_SPEED_SLOWEST;
|
||||
ChaseFade.speed_max = ENE_SPEED_FASTEST;
|
||||
ChaseFade.speed = ENE_SPEED_NORMAL;
|
||||
ChaseFade.direction = MODE_DIRECTION_LEFT;
|
||||
ChaseFade.name = "Chase Fade";
|
||||
ChaseFade.value = ENE_MODE_CHASE_FADE;
|
||||
ChaseFade.flags = MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | save_flag;
|
||||
ChaseFade.color_mode = MODE_COLORS_PER_LED;
|
||||
ChaseFade.speed_min = ENE_SPEED_SLOWEST;
|
||||
ChaseFade.speed_max = ENE_SPEED_FASTEST;
|
||||
ChaseFade.speed = ENE_SPEED_NORMAL;
|
||||
ChaseFade.direction = MODE_DIRECTION_LEFT;
|
||||
modes.push_back(ChaseFade);
|
||||
|
||||
mode Chase;
|
||||
Chase.name = "Chase";
|
||||
Chase.value = ENE_MODE_CHASE;
|
||||
Chase.flags = MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_MANUAL_SAVE;
|
||||
Chase.color_mode = MODE_COLORS_PER_LED;
|
||||
Chase.speed_min = ENE_SPEED_SLOWEST;
|
||||
Chase.speed_max = ENE_SPEED_FASTEST;
|
||||
Chase.speed = ENE_SPEED_NORMAL;
|
||||
ChaseFade.direction = MODE_DIRECTION_LEFT;
|
||||
Chase.name = "Chase";
|
||||
Chase.value = ENE_MODE_CHASE;
|
||||
Chase.flags = MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | save_flag;
|
||||
Chase.color_mode = MODE_COLORS_PER_LED;
|
||||
Chase.speed_min = ENE_SPEED_SLOWEST;
|
||||
Chase.speed_max = ENE_SPEED_FASTEST;
|
||||
Chase.speed = ENE_SPEED_NORMAL;
|
||||
ChaseFade.direction = MODE_DIRECTION_LEFT;
|
||||
modes.push_back(Chase);
|
||||
|
||||
mode RandomFlicker;
|
||||
RandomFlicker.name = "Random Flicker";
|
||||
RandomFlicker.value = ENE_MODE_RANDOM_FLICKER;
|
||||
RandomFlicker.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE;
|
||||
RandomFlicker.color_mode = MODE_COLORS_NONE;
|
||||
RandomFlicker.speed_min = ENE_SPEED_SLOWEST;
|
||||
RandomFlicker.speed_max = ENE_SPEED_FASTEST;
|
||||
RandomFlicker.speed = ENE_SPEED_NORMAL;
|
||||
RandomFlicker.name = "Random Flicker";
|
||||
RandomFlicker.value = ENE_MODE_RANDOM_FLICKER;
|
||||
RandomFlicker.flags = MODE_FLAG_HAS_SPEED | save_flag;
|
||||
RandomFlicker.color_mode = MODE_COLORS_NONE;
|
||||
RandomFlicker.speed_min = ENE_SPEED_SLOWEST;
|
||||
RandomFlicker.speed_max = ENE_SPEED_FASTEST;
|
||||
RandomFlicker.speed = ENE_SPEED_NORMAL;
|
||||
modes.push_back(RandomFlicker);
|
||||
|
||||
if(controller->SupportsMode14())
|
||||
{
|
||||
mode DoubleFade;
|
||||
DoubleFade.name = "Double Fade";
|
||||
DoubleFade.value = ENE_MODE_DOUBLE_FADE;
|
||||
DoubleFade.flags = MODE_FLAG_HAS_SPEED;
|
||||
DoubleFade.color_mode = MODE_COLORS_NONE;
|
||||
DoubleFade.speed_min = ENE_SPEED_SLOWEST;
|
||||
DoubleFade.speed_max = ENE_SPEED_FASTEST;
|
||||
DoubleFade.speed = ENE_SPEED_NORMAL;
|
||||
modes.push_back(DoubleFade);
|
||||
}
|
||||
|
||||
SetupZones();
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
@@ -162,6 +195,8 @@ int RGBController_ENESMBus::GetDeviceMode()
|
||||
int speed = controller->ENERegisterRead(ENE_REG_SPEED);
|
||||
int direction = controller->ENERegisterRead(ENE_REG_DIRECTION);
|
||||
|
||||
LOG_TRACE("[%s] Retrieved ENE mode from module: %02d", name.c_str(), dev_mode);
|
||||
|
||||
if(controller->ENERegisterRead(ENE_REG_DIRECT))
|
||||
{
|
||||
dev_mode = 0xFFFF;
|
||||
@@ -173,6 +208,7 @@ int RGBController_ENESMBus::GetDeviceMode()
|
||||
case ENE_MODE_RAINBOW:
|
||||
case ENE_MODE_SPECTRUM_CYCLE:
|
||||
case ENE_MODE_RANDOM_FLICKER:
|
||||
case ENE_MODE_DOUBLE_FADE:
|
||||
color_mode = MODE_COLORS_NONE;
|
||||
break;
|
||||
|
||||
|
||||
@@ -400,12 +400,12 @@ void RGBController_EpomakerController::ResizeZone(int /*zone*/, int /*new_size*/
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_EpomakerController::UpdateZoneLEDs(int zone)
|
||||
void RGBController_EpomakerController::UpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_EpomakerController::UpdateSingleLED(int led)
|
||||
void RGBController_EpomakerController::UpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
@@ -251,15 +251,21 @@ void GaiZhongGaiKeyboardController::SendColors
|
||||
for(uint8_t i = 0; i < 32; i++) //Maximum up to 640 RGB LED
|
||||
{
|
||||
if(i > color_data_size / 60)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
usb_buf[1] = i;
|
||||
for(uint8_t j = 0; j < 60; j++ )
|
||||
{
|
||||
if(i * 60 + j < color_data_size)
|
||||
if((unsigned int)(i * 60 + j) < color_data_size)
|
||||
{
|
||||
usb_buf[j + 2] = color_data[i * 60 + j];
|
||||
}
|
||||
else
|
||||
{
|
||||
usb_buf[j + 2] = 0; //Redundant data set 0
|
||||
}
|
||||
}
|
||||
hid_write(dev, usb_buf, 65);
|
||||
}
|
||||
|
||||
@@ -361,6 +361,19 @@ uint16_t LightBoard_init(uint8_t* p_in)
|
||||
@effects :x:
|
||||
@detectors DetectGaiZhongGaiKeyboardControllers
|
||||
@comment
|
||||
Open source web : https://oshwhub.com/yangzen/zui-gai68-
|
||||
|
||||
| function | command code | format | format | format | format |
|
||||
| ----------------------------- | ----------------- | -------- | -------- | -------- | ----------------------------------------- |
|
||||
| | [0] | [1] | [2] | [3] | [4] |
|
||||
| ----------------------------- | ----------------- | -------- | -------- | -------- | ----------------------------------------- |
|
||||
| Restore offline effects | 0xFF | undefined | undefined | undefined | undefined |
|
||||
| Set color | 0x10 | LED0_G | LED0_R | LED0_B | LED1_G(And so on to LED20) |
|
||||
| Set color | 0x11 | LED21_G | LED21_R | LED21_B | LED22_G(The sequence is WS2812 network) |
|
||||
| Get color | 0x20 | LED0_G | LED0_R | LED0_B | LED1_G(And so on to LED20) |
|
||||
| Get color | 0x21 | LED21_G | LED21_R | LED21_B | LED22_G(The sequence is WS2812 network) |
|
||||
|
||||
Note: Get color only sends command code, and the keyboard returns LED color data
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_GaiZhongGaiKeyboard::RGBController_GaiZhongGaiKeyboard(GaiZhongGaiKeyboardController* controller_ptr)
|
||||
|
||||
@@ -17,6 +17,69 @@
|
||||
@effects :white_check_mark:
|
||||
@detectors DetectGigabyteSuperIORGBControllers
|
||||
@comment
|
||||
Testing was done on an ITE8688 Chipset, and adds the support for motherboards that can only be controlled with Gigabyte’s “Ambient Led” NOT EITHER RGB Fusion 1.0/2.0.
|
||||
|
||||
You should first check to confirm that you DO NOT HAVE EITHER A USB OR SMBUS controllable chipset, use the following powershell command to confirm if you have a USB device:
|
||||
```powershell
|
||||
gwmi Win32_USBControllerDevice |%{[wmi]($_.Dependent)} | Sort Manufacturer,Description,DeviceID | Ft -GroupBy Manufacturer Description,Service,DeviceID
|
||||
```
|
||||
|
||||
If you see anything with a VID of 048D or 8297, DO NOT PROCEED, the software is likely supportable by OpenRGB's Fusion2 USB controller.
|
||||
|
||||
After that check output on the SMBus: Using the OpenRGB I2C Sniffer to confirm that no data is output on either bus while changing colors in “Ambient LED”, if either bus outputs data, DO NOT PROCEED, the software is likely supportable in Gigabyte RGB Fusion.
|
||||
|
||||
The following chipsets are likely supported:
|
||||
| Chipset ID |
|
||||
| :---: |
|
||||
| ITE8620E |
|
||||
| ITE8626 |
|
||||
| ITE8686E |
|
||||
| ITE8688 |
|
||||
| ITE8689 |
|
||||
| ITE8728F |
|
||||
| ITE8790F |
|
||||
| ITE8791E |
|
||||
|
||||
To confirm your chipset, you can open CPU-Z, the MCU chipset model is found under Mainboard like below:
|
||||
|
||||
To confirm that your RGB is compatible with this Controller in OpenRGB, you will need to add the motherboard DMI Model name, which is the output of the following powershell command:
|
||||
|
||||
```powershell
|
||||
wmic baseboard get product
|
||||
```
|
||||
|
||||
To the struct array that is found in GigabyteSuperIORGBControllerDetect.cpp, like below
|
||||
|
||||
```c++
|
||||
gig_device compatible_devices[] =
|
||||
{
|
||||
{"X570 UD"},
|
||||
{"EXAMPLEBASEBOARDPRODUCTNAME"}
|
||||
};
|
||||
```
|
||||
|
||||
If your chipset is also NOT an ITE8688, you will also need to add the chipset, to get this is a bit harder, for myself I added a breakpoint, on this line, in GigabyteSuperIORGBControllerDetect.cpp:
|
||||
```c++
|
||||
switch (val & SIO_ID_MASK)
|
||||
```
|
||||
|
||||
For an ITE8688, the value was 0x8688 in Hexidecimal, it is likely the case with other models as well that the code matches the MCU model.
|
||||
|
||||
To add this chipset you will need to first add it to the SuperIO definitions file, which is named super_io.h like below
|
||||
```c++
|
||||
#define SIO_ITE688_ID 0x8688 // Device ID for ITE8688 (8688)
|
||||
#define SIO_NEWCHIPSETMODEL_ID 0xFOUNDHEXIDECIMALVALUE // Device ID for NEWCHIPSETMODEL (FOUNDHEXIDECIMALVALUE)
|
||||
```
|
||||
|
||||
And lastly you will need to add the chip to the
|
||||
|
||||
GigabyteSuperIORGBControllerDetect.cpp like below:
|
||||
```c++
|
||||
switch (val & SIO_ID_MASK)
|
||||
{
|
||||
case SIO_ITE688_ID:
|
||||
case SIO_NEWCHIPSETMODEL_ID:
|
||||
```
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_GigabyteSuperIORGB::RGBController_GigabyteSuperIORGB(GigabyteSuperIORGBController* controller_ptr)
|
||||
|
||||
@@ -161,7 +161,7 @@ void KasaSmartController::SetColor(unsigned char red, unsigned char green, unsig
|
||||
| Normalize case where hue is "-1" undefined |
|
||||
\*------------------------------------------*/
|
||||
unsigned int normalized_hue = hsv.hue;
|
||||
if(hsv.hue == (int)-1)
|
||||
if(hsv.hue == (unsigned int)-1)
|
||||
{
|
||||
normalized_hue = 0;
|
||||
}
|
||||
|
||||
@@ -580,17 +580,17 @@ void LianLiUniHub_AL10Controller::Synchronize()
|
||||
\*--------------------------------------------------------------------*/
|
||||
// uint8_t control = 0;
|
||||
|
||||
// /*-------------------------------------*\
|
||||
// | Configure fan settings |
|
||||
// \*-------------------------------------*/
|
||||
/*-------------------------------------*\
|
||||
| Configure fan settings |
|
||||
\*-------------------------------------*/
|
||||
// for(const Channel& channel : channels)
|
||||
// {
|
||||
// if(channel.fanSpeed == UNIHUB_AL10_FAN_SPEED_PWM)
|
||||
// {
|
||||
// /*-----------------------------*\
|
||||
// | Configure the fan to pwm |
|
||||
// | control |
|
||||
// \*-----------------------------*/
|
||||
/*-----------------------------*\
|
||||
| Configure the fan to pwm |
|
||||
| control |
|
||||
\*-----------------------------*/
|
||||
// uint8_t config_pwm[1] = { 0x00 };
|
||||
|
||||
// control |= (0x01 << channel.index);
|
||||
@@ -600,10 +600,10 @@ void LianLiUniHub_AL10Controller::Synchronize()
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// /*-----------------------------*\
|
||||
// | Configure the fan to hub |
|
||||
// | control and set speed |
|
||||
// \*-----------------------------*/
|
||||
/*-----------------------------*\
|
||||
| Configure the fan to hub |
|
||||
| control and set speed |
|
||||
\*-----------------------------*/
|
||||
// uint8_t config_hub[2] = { (uint8_t)(channel.fanSpeed >> 0x08), (uint8_t)(channel.fanSpeed & 0xFF) };
|
||||
|
||||
// SendConfig(channel.fanHubActionAddress, config_hub, sizeof(config_hub));
|
||||
@@ -611,9 +611,9 @@ void LianLiUniHub_AL10Controller::Synchronize()
|
||||
// }
|
||||
// }
|
||||
|
||||
// /*-------------------------------------*\
|
||||
// | Configure fan control modes |
|
||||
// \*-------------------------------------*/
|
||||
/*-------------------------------------*\
|
||||
| Configure fan control modes |
|
||||
\*-------------------------------------*/
|
||||
// uint8_t config_fan_mode[2] = { 0x31, (uint8_t)(0xF0 | control) };
|
||||
|
||||
// SendConfig(UNIHUB_AL10_ACTION_ADDRESS, config_fan_mode, sizeof(config_fan_mode));
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
@name NZXT Hue 1
|
||||
@category LEDStrip
|
||||
@type USB
|
||||
@save :robot:
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :white_check_mark:
|
||||
@detectors DetectNZXTHue1Controllers
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
NollieController::NollieController(hid_device* dev_handle, const char* path, unsigned short pid)
|
||||
NollieController::NollieController(hid_device* dev_handle, const char* path, unsigned short /*pid*/)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
|
||||
@@ -152,7 +152,7 @@ void RGBController_Nollie::DeviceUpdateLEDs()
|
||||
}
|
||||
}
|
||||
std::sort(ChSort.begin(), ChSort.end());
|
||||
for (int i = 0; i < ChSort.size(); i++)
|
||||
for (std::size_t i = 0; i < ChSort.size(); i++)
|
||||
{
|
||||
int* ptr = std::find(channel_index, channel_index + 32, ChSort[i]);
|
||||
int zone_idx = ptr - channel_index;
|
||||
|
||||
@@ -50,7 +50,7 @@ unsigned short OKSKeyboardController::GetUSBPID()
|
||||
return(usb_pid);
|
||||
}
|
||||
|
||||
void OKSKeyboardController::SendColors(unsigned char* color_data, unsigned int color_data_size)
|
||||
void OKSKeyboardController::SendColors(unsigned char* color_data, unsigned int /*color_data_size*/)
|
||||
{
|
||||
char usb_buf[65];
|
||||
union kb2_port_t Pack;
|
||||
@@ -86,7 +86,7 @@ void OKSKeyboardController::SendColors(unsigned char* color_data, unsigned int c
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(5));
|
||||
}
|
||||
|
||||
void OKSKeyboardController::SendKeyboardModeEx(const mode &m, unsigned char red, unsigned char green, unsigned char blue)
|
||||
void OKSKeyboardController::SendKeyboardModeEx(const mode &m, unsigned char /*red*/, unsigned char /*green*/, unsigned char /*blue*/)
|
||||
{
|
||||
union kb2_port_t Pack;
|
||||
kb2M_wrgb(&Pack, m.brightness, m.value, m.speed, m.direction);
|
||||
|
||||
@@ -269,7 +269,7 @@ void RGBController_OKSKeyboard::DeviceUpdateLEDs()
|
||||
controller->SendColors(colordata, colors.size()*3);
|
||||
}
|
||||
|
||||
void RGBController_OKSKeyboard::UpdateZoneLEDs(int zone)
|
||||
void RGBController_OKSKeyboard::UpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
@@ -290,7 +290,7 @@ void RGBController_OKSKeyboard::DeviceUpdateMode()
|
||||
unsigned char red = 0x00;
|
||||
unsigned char grn = 0x00;
|
||||
unsigned char blu = 0x00;
|
||||
unsigned char random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
|
||||
//unsigned char random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
|
||||
|
||||
if(modes[active_mode].colors.size() > 0)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ void DetectPalitGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr, const
|
||||
}
|
||||
|
||||
const uint8_t palit[] = {'P', 'A', 'L', 'I', 'T'};
|
||||
for (int i = 0; i < sizeof(palit); i++)
|
||||
for (size_t i = 0; i < sizeof(palit); i++)
|
||||
{
|
||||
int32_t letter = bus->i2c_smbus_read_byte_data(i2c_addr, 0x07 + i);
|
||||
if (palit[i] != letter)
|
||||
|
||||
@@ -56,14 +56,14 @@ RGBController_Razer::RGBController_Razer(RazerController* controller_ptr)
|
||||
mode Off;
|
||||
Off.name = "Off";
|
||||
Off.value = RAZER_MODE_OFF;
|
||||
Off.flags = MODE_FLAG_MANUAL_SAVE;
|
||||
Off.flags = 0;
|
||||
Off.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Off);
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = RAZER_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
@@ -78,7 +78,7 @@ RGBController_Razer::RGBController_Razer(RazerController* controller_ptr)
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = RAZER_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 2;
|
||||
@@ -92,7 +92,7 @@ RGBController_Razer::RGBController_Razer(RazerController* controller_ptr)
|
||||
mode SpectrumCycle;
|
||||
SpectrumCycle.name = "Spectrum Cycle";
|
||||
SpectrumCycle.value = RAZER_MODE_SPECTRUM_CYCLE;
|
||||
SpectrumCycle.flags = MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
SpectrumCycle.flags = MODE_FLAG_HAS_BRIGHTNESS;
|
||||
SpectrumCycle.color_mode = MODE_COLORS_NONE;
|
||||
SpectrumCycle.brightness_min = 0;
|
||||
SpectrumCycle.brightness_max = max_brightness;
|
||||
@@ -104,7 +104,7 @@ RGBController_Razer::RGBController_Razer(RazerController* controller_ptr)
|
||||
mode Wave;
|
||||
Wave.name = "Wave";
|
||||
Wave.value = RAZER_MODE_WAVE;
|
||||
Wave.flags = MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
Wave.flags = MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Wave.direction = MODE_DIRECTION_RIGHT;
|
||||
Wave.color_mode = MODE_COLORS_NONE;
|
||||
Wave.brightness_min = 0;
|
||||
@@ -374,21 +374,11 @@ void RGBController_Razer::UpdateSingleLED(int /*led*/)
|
||||
}
|
||||
|
||||
void RGBController_Razer::DeviceUpdateMode()
|
||||
{
|
||||
SendMode(false);
|
||||
}
|
||||
|
||||
void RGBController_Razer::DeviceSaveMode()
|
||||
{
|
||||
SendMode(true);
|
||||
}
|
||||
|
||||
void RGBController_Razer::SendMode(bool save)
|
||||
{
|
||||
switch(modes[active_mode].value)
|
||||
{
|
||||
case RAZER_MODE_OFF:
|
||||
controller->SetModeOff(save);
|
||||
controller->SetModeOff();
|
||||
break;
|
||||
|
||||
case RAZER_MODE_STATIC:
|
||||
@@ -398,14 +388,14 @@ void RGBController_Razer::SendMode(bool save)
|
||||
unsigned char grn = RGBGetGValue(modes[active_mode].colors[0]);
|
||||
unsigned char blu = RGBGetBValue(modes[active_mode].colors[0]);
|
||||
|
||||
controller->SetModeStatic(red, grn, blu, save);
|
||||
controller->SetModeStatic(red, grn, blu);
|
||||
}
|
||||
break;
|
||||
|
||||
case RAZER_MODE_BREATHING:
|
||||
if(modes[active_mode].color_mode == MODE_COLORS_RANDOM)
|
||||
{
|
||||
controller->SetModeBreathingRandom(save);
|
||||
controller->SetModeBreathingRandom();
|
||||
}
|
||||
else if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
|
||||
{
|
||||
@@ -415,7 +405,7 @@ void RGBController_Razer::SendMode(bool save)
|
||||
unsigned char grn = RGBGetGValue(modes[active_mode].colors[0]);
|
||||
unsigned char blu = RGBGetBValue(modes[active_mode].colors[0]);
|
||||
|
||||
controller->SetModeBreathingOneColor(red, grn, blu, save);
|
||||
controller->SetModeBreathingOneColor(red, grn, blu);
|
||||
}
|
||||
else if(modes[active_mode].colors.size() == 2)
|
||||
{
|
||||
@@ -426,24 +416,24 @@ void RGBController_Razer::SendMode(bool save)
|
||||
unsigned char grn2 = RGBGetGValue(modes[active_mode].colors[1]);
|
||||
unsigned char blu2 = RGBGetBValue(modes[active_mode].colors[1]);
|
||||
|
||||
controller->SetModeBreathingTwoColors(red1, grn1, blu1, red2, grn2, blu2, save);
|
||||
controller->SetModeBreathingTwoColors(red1, grn1, blu1, red2, grn2, blu2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case RAZER_MODE_SPECTRUM_CYCLE:
|
||||
controller->SetModeSpectrumCycle(save);
|
||||
controller->SetModeSpectrumCycle();
|
||||
break;
|
||||
|
||||
case RAZER_MODE_WAVE:
|
||||
switch(modes[active_mode].direction)
|
||||
{
|
||||
case MODE_DIRECTION_LEFT:
|
||||
controller->SetModeWave(2, save);
|
||||
controller->SetModeWave(2);
|
||||
break;
|
||||
|
||||
default:
|
||||
controller->SetModeWave(1, save);
|
||||
controller->SetModeWave(1);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -38,10 +38,7 @@ public:
|
||||
void UpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
void DeviceSaveMode();
|
||||
|
||||
private:
|
||||
RazerController* controller;
|
||||
|
||||
void SendMode(bool save);
|
||||
};
|
||||
|
||||
@@ -269,39 +269,39 @@ void RazerController::SetLEDs(RGBColor* colors)
|
||||
delete[] output_array;
|
||||
}
|
||||
|
||||
void RazerController::SetModeBreathingOneColor(unsigned char red, unsigned char grn, unsigned char blu, bool save)
|
||||
void RazerController::SetModeBreathingOneColor(unsigned char red, unsigned char grn, unsigned char blu)
|
||||
{
|
||||
razer_set_mode_breathing_one_color(red, grn, blu, save);
|
||||
razer_set_mode_breathing_one_color(red, grn, blu);
|
||||
}
|
||||
|
||||
void RazerController::SetModeBreathingRandom(bool save)
|
||||
void RazerController::SetModeBreathingRandom()
|
||||
{
|
||||
razer_set_mode_breathing_random(save);
|
||||
razer_set_mode_breathing_random();
|
||||
}
|
||||
|
||||
void RazerController::SetModeBreathingTwoColors(unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2, bool save)
|
||||
void RazerController::SetModeBreathingTwoColors(unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2)
|
||||
{
|
||||
razer_set_mode_breathing_two_colors(r1, g1, b1, r2, g2, b2, save);
|
||||
razer_set_mode_breathing_two_colors(r1, g1, b1, r2, g2, b2);
|
||||
}
|
||||
|
||||
void RazerController::SetModeOff(bool save)
|
||||
void RazerController::SetModeOff()
|
||||
{
|
||||
razer_set_mode_none(save);
|
||||
razer_set_mode_none();
|
||||
}
|
||||
|
||||
void RazerController::SetModeSpectrumCycle(bool save)
|
||||
void RazerController::SetModeSpectrumCycle()
|
||||
{
|
||||
razer_set_mode_spectrum_cycle(save);
|
||||
razer_set_mode_spectrum_cycle();
|
||||
}
|
||||
|
||||
void RazerController::SetModeStatic(unsigned char red, unsigned char grn, unsigned char blu, bool save)
|
||||
void RazerController::SetModeStatic(unsigned char red, unsigned char grn, unsigned char blu)
|
||||
{
|
||||
razer_set_mode_static(red, grn, blu, save);
|
||||
razer_set_mode_static(red, grn, blu);
|
||||
}
|
||||
|
||||
void RazerController::SetModeWave(unsigned char direction, bool save)
|
||||
void RazerController::SetModeWave(unsigned char direction)
|
||||
{
|
||||
razer_set_mode_wave(direction, save);
|
||||
razer_set_mode_wave(direction);
|
||||
}
|
||||
|
||||
bool RazerController::SupportsBreathing()
|
||||
@@ -1250,27 +1250,21 @@ void RazerController::razer_set_device_mode(unsigned char device_mode)
|
||||
razer_usb_send(&report);
|
||||
}
|
||||
|
||||
void RazerController::razer_set_mode_breathing_one_color(unsigned char red, unsigned char grn, unsigned char blu, bool save)
|
||||
void RazerController::razer_set_mode_breathing_one_color(unsigned char red, unsigned char grn, unsigned char blu)
|
||||
{
|
||||
unsigned char storage_mode = RAZER_STORAGE_NO_SAVE;
|
||||
razer_report report;
|
||||
|
||||
if(save)
|
||||
{
|
||||
storage_mode = RAZER_STORAGE_SAVE;
|
||||
}
|
||||
razer_report report;
|
||||
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_MATRIX_TYPE_STANDARD:
|
||||
case RAZER_MATRIX_TYPE_LINEAR:
|
||||
report = razer_create_mode_breathing_one_color_standard_matrix_report(storage_mode, dev_led_id, red, grn, blu);
|
||||
report = razer_create_mode_breathing_one_color_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, red, grn, blu);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_MATRIX_TYPE_EXTENDED:
|
||||
case RAZER_MATRIX_TYPE_EXTENDED_ARGB:
|
||||
report = razer_create_mode_breathing_one_color_extended_matrix_report(storage_mode, dev_led_id, red, grn, blu);
|
||||
report = razer_create_mode_breathing_one_color_extended_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, red, grn, blu);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1289,41 +1283,41 @@ void RazerController::razer_set_mode_breathing_one_color(unsigned char red, unsi
|
||||
| These devices use individual LED effect reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_TARTARUS_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_BACKLIGHT, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_BACKLIGHT, 2);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 2);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_DEATHADDER_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
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(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 2);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 2);
|
||||
razer_usb_send(&report);
|
||||
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_LOGO, &rgb_data[3]);
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, &rgb_data[3]);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_LOGO, 2);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, 2);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_NAGA_EPIC_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 2);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 2);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_BACKLIGHT, &rgb_data[3]);
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, &rgb_data[3]);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_BACKLIGHT, 2);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 2);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1331,7 +1325,7 @@ void RazerController::razer_set_mode_breathing_one_color(unsigned char red, unsi
|
||||
| These devices use standard matrix reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_ORBWEAVER_CHROMA_PID:
|
||||
report = razer_create_mode_breathing_one_color_standard_matrix_report(storage_mode, dev_led_id, red, grn, blu);
|
||||
report = razer_create_mode_breathing_one_color_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, red, grn, blu);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
}
|
||||
@@ -1339,27 +1333,21 @@ void RazerController::razer_set_mode_breathing_one_color(unsigned char red, unsi
|
||||
}
|
||||
}
|
||||
|
||||
void RazerController::razer_set_mode_breathing_random(bool save)
|
||||
void RazerController::razer_set_mode_breathing_random()
|
||||
{
|
||||
unsigned char storage_mode = RAZER_STORAGE_NO_SAVE;
|
||||
razer_report report;
|
||||
|
||||
if(save)
|
||||
{
|
||||
storage_mode = RAZER_STORAGE_SAVE;
|
||||
}
|
||||
razer_report report;
|
||||
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_MATRIX_TYPE_STANDARD:
|
||||
case RAZER_MATRIX_TYPE_LINEAR:
|
||||
report = razer_create_mode_breathing_random_standard_matrix_report(storage_mode, dev_led_id);
|
||||
report = razer_create_mode_breathing_random_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_MATRIX_TYPE_EXTENDED:
|
||||
case RAZER_MATRIX_TYPE_EXTENDED_ARGB:
|
||||
report = razer_create_mode_breathing_random_extended_matrix_report(storage_mode, dev_led_id);
|
||||
report = razer_create_mode_breathing_random_extended_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1370,7 +1358,7 @@ void RazerController::razer_set_mode_breathing_random(bool save)
|
||||
| These devices use standard matrix reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_ORBWEAVER_CHROMA_PID:
|
||||
report = razer_create_mode_breathing_random_standard_matrix_report(storage_mode, dev_led_id);
|
||||
report = razer_create_mode_breathing_random_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
}
|
||||
@@ -1378,27 +1366,21 @@ void RazerController::razer_set_mode_breathing_random(bool save)
|
||||
}
|
||||
}
|
||||
|
||||
void RazerController::razer_set_mode_breathing_two_colors(unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2, bool save)
|
||||
void RazerController::razer_set_mode_breathing_two_colors(unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2)
|
||||
{
|
||||
unsigned char storage_mode = RAZER_STORAGE_NO_SAVE;
|
||||
razer_report report;
|
||||
|
||||
if(save)
|
||||
{
|
||||
storage_mode = RAZER_STORAGE_SAVE;
|
||||
}
|
||||
razer_report report;
|
||||
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_MATRIX_TYPE_STANDARD:
|
||||
case RAZER_MATRIX_TYPE_LINEAR:
|
||||
report = razer_create_mode_breathing_two_colors_standard_matrix_report(storage_mode, dev_led_id, r1, g1, b1, r2, g2, b2);
|
||||
report = razer_create_mode_breathing_two_colors_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, r1, g1, b1, r2, g2, b2);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_MATRIX_TYPE_EXTENDED:
|
||||
case RAZER_MATRIX_TYPE_EXTENDED_ARGB:
|
||||
report = razer_create_mode_breathing_two_colors_extended_matrix_report(storage_mode, dev_led_id, r1, g1, b1, r2, g2, b2);
|
||||
report = razer_create_mode_breathing_two_colors_extended_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, r1, g1, b1, r2, g2, b2);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1409,7 +1391,7 @@ void RazerController::razer_set_mode_breathing_two_colors(unsigned char r1, unsi
|
||||
| These devices use standard matrix reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_ORBWEAVER_CHROMA_PID:
|
||||
report = razer_create_mode_breathing_two_colors_standard_matrix_report(storage_mode, dev_led_id, r1, g1, b1, r2, g2, b2);
|
||||
report = razer_create_mode_breathing_two_colors_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, r1, g1, b1, r2, g2, b2);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
}
|
||||
@@ -1478,27 +1460,21 @@ void RazerController::razer_set_mode_custom()
|
||||
}
|
||||
}
|
||||
|
||||
void RazerController::razer_set_mode_none(bool save)
|
||||
void RazerController::razer_set_mode_none()
|
||||
{
|
||||
unsigned char storage_mode = RAZER_STORAGE_NO_SAVE;
|
||||
razer_report report;
|
||||
|
||||
if(save)
|
||||
{
|
||||
storage_mode = RAZER_STORAGE_SAVE;
|
||||
}
|
||||
razer_report report;
|
||||
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_MATRIX_TYPE_STANDARD:
|
||||
case RAZER_MATRIX_TYPE_LINEAR:
|
||||
report = razer_create_mode_none_standard_matrix_report(storage_mode, dev_led_id);
|
||||
report = razer_create_mode_none_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_MATRIX_TYPE_EXTENDED:
|
||||
case RAZER_MATRIX_TYPE_EXTENDED_ARGB:
|
||||
report = razer_create_mode_none_extended_matrix_report(storage_mode, dev_led_id);
|
||||
report = razer_create_mode_none_extended_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1517,49 +1493,49 @@ void RazerController::razer_set_mode_none(bool save)
|
||||
| These devices use individual LED effect reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_TARTARUS_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_BACKLIGHT, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_BACKLIGHT, 0);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 0);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_DEATHADDER_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
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(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
razer_usb_send(&report);
|
||||
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_LOGO, &rgb_data[3]);
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, &rgb_data[3]);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_LOGO, 0);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, 0);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_NAGA_EPIC_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_BACKLIGHT, &rgb_data[3]);
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, &rgb_data[3]);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_BACKLIGHT, 0);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 0);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_MAMBA_2012_WIRED_PID:
|
||||
case RAZER_MAMBA_2012_WIRELESS_PID:
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
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(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1567,7 +1543,7 @@ void RazerController::razer_set_mode_none(bool save)
|
||||
| These devices use standard matrix reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_ORBWEAVER_CHROMA_PID:
|
||||
report = razer_create_mode_none_standard_matrix_report(storage_mode, dev_led_id);
|
||||
report = razer_create_mode_none_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
}
|
||||
@@ -1575,27 +1551,21 @@ void RazerController::razer_set_mode_none(bool save)
|
||||
}
|
||||
}
|
||||
|
||||
void RazerController::razer_set_mode_spectrum_cycle(bool save)
|
||||
void RazerController::razer_set_mode_spectrum_cycle()
|
||||
{
|
||||
unsigned char storage_mode = RAZER_STORAGE_NO_SAVE;
|
||||
razer_report report;
|
||||
|
||||
if(save)
|
||||
{
|
||||
storage_mode = RAZER_STORAGE_SAVE;
|
||||
}
|
||||
razer_report report;
|
||||
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_MATRIX_TYPE_STANDARD:
|
||||
case RAZER_MATRIX_TYPE_LINEAR:
|
||||
report = razer_create_mode_spectrum_cycle_standard_matrix_report(storage_mode, dev_led_id);
|
||||
report = razer_create_mode_spectrum_cycle_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_MATRIX_TYPE_EXTENDED:
|
||||
case RAZER_MATRIX_TYPE_EXTENDED_ARGB:
|
||||
report = razer_create_mode_spectrum_cycle_extended_matrix_report(storage_mode, dev_led_id);
|
||||
report = razer_create_mode_spectrum_cycle_extended_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1606,31 +1576,31 @@ void RazerController::razer_set_mode_spectrum_cycle(bool save)
|
||||
| These devices use individual LED effect reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_TARTARUS_CHROMA_PID:
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_BACKLIGHT, 4);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 4);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_DEATHADDER_CHROMA_PID:
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 4);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 4);
|
||||
razer_usb_send(&report);
|
||||
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_LOGO, 4);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, 4);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_NAGA_EPIC_CHROMA_PID:
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 4);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 4);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_BACKLIGHT, 4);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 4);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_MAMBA_2012_WIRED_PID:
|
||||
case RAZER_MAMBA_2012_WIRELESS_PID:
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 4);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 4);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1638,7 +1608,7 @@ void RazerController::razer_set_mode_spectrum_cycle(bool save)
|
||||
| These devices use standard matrix reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_ORBWEAVER_CHROMA_PID:
|
||||
report = razer_create_mode_spectrum_cycle_standard_matrix_report(storage_mode, dev_led_id);
|
||||
report = razer_create_mode_spectrum_cycle_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
}
|
||||
@@ -1646,27 +1616,21 @@ void RazerController::razer_set_mode_spectrum_cycle(bool save)
|
||||
}
|
||||
}
|
||||
|
||||
void RazerController::razer_set_mode_static(unsigned char red, unsigned char grn, unsigned char blu, bool save)
|
||||
void RazerController::razer_set_mode_static(unsigned char red, unsigned char grn, unsigned char blu)
|
||||
{
|
||||
unsigned char storage_mode = RAZER_STORAGE_NO_SAVE;
|
||||
razer_report report;
|
||||
|
||||
if(save)
|
||||
{
|
||||
storage_mode = RAZER_STORAGE_SAVE;
|
||||
}
|
||||
razer_report report;
|
||||
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_MATRIX_TYPE_STANDARD:
|
||||
case RAZER_MATRIX_TYPE_LINEAR:
|
||||
report = razer_create_mode_static_standard_matrix_report(storage_mode, dev_led_id, red, grn, blu);
|
||||
report = razer_create_mode_static_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, red, grn, blu);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_MATRIX_TYPE_EXTENDED:
|
||||
case RAZER_MATRIX_TYPE_EXTENDED_ARGB:
|
||||
report = razer_create_mode_static_extended_matrix_report(storage_mode, dev_led_id, red, grn, blu);
|
||||
report = razer_create_mode_static_extended_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, red, grn, blu);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1685,49 +1649,49 @@ void RazerController::razer_set_mode_static(unsigned char red, unsigned char grn
|
||||
| These devices use individual LED effect reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_TARTARUS_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_BACKLIGHT, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_BACKLIGHT, 0);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 0);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_DEATHADDER_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
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(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
razer_usb_send(&report);
|
||||
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_LOGO, &rgb_data[3]);
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, &rgb_data[3]);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_LOGO, 0);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, 0);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_NAGA_EPIC_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_BACKLIGHT, &rgb_data[3]);
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, &rgb_data[3]);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_BACKLIGHT, 0);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 0);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_MAMBA_2012_WIRED_PID:
|
||||
case RAZER_MAMBA_2012_WIRELESS_PID:
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
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(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1735,7 +1699,7 @@ void RazerController::razer_set_mode_static(unsigned char red, unsigned char grn
|
||||
| These devices use standard matrix reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_ORBWEAVER_CHROMA_PID:
|
||||
report = razer_create_mode_static_standard_matrix_report(storage_mode, dev_led_id, red, grn, blu);
|
||||
report = razer_create_mode_static_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, red, grn, blu);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
}
|
||||
@@ -1743,27 +1707,21 @@ void RazerController::razer_set_mode_static(unsigned char red, unsigned char grn
|
||||
}
|
||||
}
|
||||
|
||||
void RazerController::razer_set_mode_wave(unsigned char direction, bool save)
|
||||
void RazerController::razer_set_mode_wave(unsigned char direction)
|
||||
{
|
||||
unsigned char storage_mode = RAZER_STORAGE_NO_SAVE;
|
||||
razer_report report;
|
||||
|
||||
if(save)
|
||||
{
|
||||
storage_mode = RAZER_STORAGE_SAVE;
|
||||
}
|
||||
razer_report report;
|
||||
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_MATRIX_TYPE_STANDARD:
|
||||
case RAZER_MATRIX_TYPE_LINEAR:
|
||||
report = razer_create_mode_wave_standard_matrix_report(storage_mode, dev_led_id, direction);
|
||||
report = razer_create_mode_wave_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, direction);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_MATRIX_TYPE_EXTENDED:
|
||||
case RAZER_MATRIX_TYPE_EXTENDED_ARGB:
|
||||
report = razer_create_mode_wave_extended_matrix_report(storage_mode, dev_led_id, direction);
|
||||
report = razer_create_mode_wave_extended_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, direction);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1774,7 +1732,7 @@ void RazerController::razer_set_mode_wave(unsigned char direction, bool save)
|
||||
| These devices use standard matrix reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_ORBWEAVER_CHROMA_PID:
|
||||
report = razer_create_mode_wave_standard_matrix_report(storage_mode, dev_led_id, direction);
|
||||
report = razer_create_mode_wave_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, direction);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -234,13 +234,13 @@ public:
|
||||
void SetLEDs(RGBColor* colors);
|
||||
void SetAddressableZoneSizes(unsigned char zone_1_size, unsigned char zone_2_size, unsigned char zone_3_size, unsigned char zone_4_size, unsigned char zone_5_size, unsigned char zone_6_size);
|
||||
|
||||
void SetModeBreathingRandom(bool save = false);
|
||||
void SetModeBreathingOneColor(unsigned char red, unsigned char grn, unsigned char blu, bool save = false);
|
||||
void SetModeBreathingTwoColors(unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2, bool save = false);
|
||||
void SetModeOff(bool save = false);
|
||||
void SetModeSpectrumCycle(bool save = false);
|
||||
void SetModeStatic(unsigned char red, unsigned char grn, unsigned char blu, bool save = false);
|
||||
void SetModeWave(unsigned char direction, bool save = false);
|
||||
void SetModeBreathingRandom();
|
||||
void SetModeBreathingOneColor(unsigned char red, unsigned char grn, unsigned char blu);
|
||||
void SetModeBreathingTwoColors(unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2);
|
||||
void SetModeOff();
|
||||
void SetModeSpectrumCycle();
|
||||
void SetModeStatic(unsigned char red, unsigned char grn, unsigned char blu);
|
||||
void SetModeWave(unsigned char direction);
|
||||
|
||||
bool SupportsBreathing();
|
||||
bool SupportsReactive();
|
||||
@@ -325,14 +325,14 @@ private:
|
||||
|
||||
void razer_set_device_mode(unsigned char device_mode);
|
||||
|
||||
void razer_set_mode_breathing_random(bool save);
|
||||
void razer_set_mode_breathing_one_color(unsigned char red, unsigned char grn, unsigned char blu, bool save);
|
||||
void razer_set_mode_breathing_two_colors(unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2, bool save);
|
||||
void razer_set_mode_breathing_random();
|
||||
void razer_set_mode_breathing_one_color(unsigned char red, unsigned char grn, unsigned char blu);
|
||||
void razer_set_mode_breathing_two_colors(unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2);
|
||||
void razer_set_mode_custom();
|
||||
void razer_set_mode_none(bool save);
|
||||
void razer_set_mode_spectrum_cycle(bool save);
|
||||
void razer_set_mode_static(unsigned char red, unsigned char grn, unsigned char blu, bool save);
|
||||
void razer_set_mode_wave(unsigned char direction, bool save);
|
||||
void razer_set_mode_none();
|
||||
void razer_set_mode_spectrum_cycle();
|
||||
void razer_set_mode_static(unsigned char red, unsigned char grn, unsigned char blu);
|
||||
void razer_set_mode_wave(unsigned char direction);
|
||||
|
||||
int razer_usb_receive(razer_report* report);
|
||||
int razer_usb_send(razer_report* report);
|
||||
|
||||
@@ -43,7 +43,7 @@ std::string SRGBmodsLEDControllerV1::GetSerialString()
|
||||
return(return_string);
|
||||
}
|
||||
|
||||
void SRGBmodsLEDControllerV1::SetChannelLEDs(unsigned char channel, RGBColor* colors, unsigned int num_colors)
|
||||
void SRGBmodsLEDControllerV1::SetChannelLEDs(unsigned char /*channel*/, RGBColor* colors, unsigned int num_colors)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Determine number of packets to send |
|
||||
|
||||
@@ -53,15 +53,8 @@ RGBController_ZotacV2GPU::RGBController_ZotacV2GPU(ZotacV2GPUController* control
|
||||
location = controller->GetDeviceLocation();
|
||||
type = DEVICE_TYPE_GPU;
|
||||
|
||||
try
|
||||
{
|
||||
config = ZOTAC_V2_GPU_CONFIG.at(controller->GetVersion());
|
||||
}
|
||||
catch(std::out_of_range)
|
||||
{
|
||||
LOG_ERROR("No zone config found for %s", version.c_str());
|
||||
config = ZotacV2GPUConfig();
|
||||
}
|
||||
config = ZOTAC_V2_GPU_CONFIG.at(controller->GetVersion());
|
||||
|
||||
version += std::to_string(config.numberOfZones) + " zones, "
|
||||
+ (config.supportsExternalLEDStrip ? "with" : "without") + " external LED strip support";
|
||||
|
||||
@@ -408,7 +401,7 @@ void RGBController_ZotacV2GPU::DeviceUpdateMode()
|
||||
if(zoneConfig.mode == ZOTAC_V2_GPU_MODE_DUET)
|
||||
{
|
||||
zoneConfig.colorPreset = ZOTAC_V2_GPU_DUET_PRESETS.size(); // custom
|
||||
for(int i = 0; i < ZOTAC_V2_GPU_DUET_PRESETS.size(); ++i)
|
||||
for(size_t i = 0; i < ZOTAC_V2_GPU_DUET_PRESETS.size(); ++i)
|
||||
{
|
||||
if(zoneConfig.color1 == ZOTAC_V2_GPU_DUET_PRESETS[i].first &&
|
||||
zoneConfig.color2 == ZOTAC_V2_GPU_DUET_PRESETS[i].second)
|
||||
|
||||
@@ -356,26 +356,30 @@ KeyboardLayoutManager::KeyboardLayoutManager(KEYBOARD_LAYOUT layout, KEYBOARD_SI
|
||||
tmp_name.append(KEYBOARD_NAME_QWERTY);
|
||||
break;
|
||||
|
||||
case KEYBOARD_LAYOUT::KEYBOARD_LAYOUT_ISO_AZERTY:
|
||||
ChangeKeys(iso_azerty);
|
||||
tmp_name = KEYBOARD_NAME_AZERTY;
|
||||
break;
|
||||
|
||||
case KEYBOARD_LAYOUT::KEYBOARD_LAYOUT_ISO_QWERTY:
|
||||
ChangeKeys(iso_qwerty);
|
||||
tmp_name = KEYBOARD_NAME_ISO;
|
||||
tmp_name.append(KEYBOARD_NAME_QWERTY);
|
||||
break;
|
||||
|
||||
case KEYBOARD_LAYOUT::KEYBOARD_LAYOUT_ISO_QWERTZ:
|
||||
ChangeKeys(iso_qwertz);
|
||||
tmp_name = KEYBOARD_NAME_QWERTZ;
|
||||
break;
|
||||
/*-------------------------------------------------*\
|
||||
| Non-English, non-QWERTY layouts are disabled |
|
||||
| until proper translation feature is implemented |
|
||||
\*-------------------------------------------------*/
|
||||
// case KEYBOARD_LAYOUT::KEYBOARD_LAYOUT_ISO_AZERTY:
|
||||
// ChangeKeys(iso_azerty);
|
||||
// tmp_name = KEYBOARD_NAME_AZERTY;
|
||||
// break;
|
||||
|
||||
case KEYBOARD_LAYOUT::KEYBOARD_LAYOUT_JIS:
|
||||
ChangeKeys(jis);
|
||||
tmp_name = KEYBOARD_NAME_JIS;
|
||||
break;
|
||||
// case KEYBOARD_LAYOUT::KEYBOARD_LAYOUT_ISO_QWERTZ:
|
||||
// ChangeKeys(iso_qwertz);
|
||||
// tmp_name = KEYBOARD_NAME_QWERTZ;
|
||||
// break;
|
||||
|
||||
// case KEYBOARD_LAYOUT::KEYBOARD_LAYOUT_JIS:
|
||||
// ChangeKeys(jis);
|
||||
// tmp_name = KEYBOARD_NAME_JIS;
|
||||
// break;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------*\
|
||||
|
||||
+12
-11
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "NetworkServer.h"
|
||||
#include "LogManager.h"
|
||||
#include "StringUtils.h"
|
||||
#include <cstring>
|
||||
|
||||
#ifndef WIN32
|
||||
@@ -266,7 +267,7 @@ void NetworkServer::StartServer()
|
||||
for(res = result; res && socket_count < MAXSOCK; res = res->ai_next)
|
||||
{
|
||||
server_sock[socket_count] = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
|
||||
|
||||
|
||||
if(server_sock[socket_count] == INVALID_SOCKET)
|
||||
{
|
||||
printf("Error: network socket could not be created\n");
|
||||
@@ -320,7 +321,7 @@ void NetworkServer::StartServer()
|
||||
|
||||
freeaddrinfo(result);
|
||||
server_online = true;
|
||||
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Start the connection thread |
|
||||
\*-------------------------------------------------*/
|
||||
@@ -430,7 +431,7 @@ void NetworkServer::ConnectionThreadFunction(int socket_idx)
|
||||
socklen_t len;
|
||||
len = sizeof(tmp_addr);
|
||||
getpeername(client_info->client_sock, (struct sockaddr*)&tmp_addr, &len);
|
||||
|
||||
|
||||
if(tmp_addr.ss_family == AF_INET)
|
||||
{
|
||||
struct sockaddr_in *s_4 = (struct sockaddr_in *)&tmp_addr;
|
||||
@@ -780,7 +781,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
|
||||
|
||||
if(profile_manager)
|
||||
{
|
||||
profile_manager->SaveProfile(data);
|
||||
profile_manager->SaveProfile(StringUtils::make_filename(data));
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -793,7 +794,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
|
||||
|
||||
if(profile_manager)
|
||||
{
|
||||
profile_manager->LoadProfile(data);
|
||||
profile_manager->LoadProfile(StringUtils::make_filename(data));
|
||||
}
|
||||
|
||||
for(RGBController* controller : controllers)
|
||||
@@ -811,7 +812,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
|
||||
|
||||
if(profile_manager)
|
||||
{
|
||||
profile_manager->DeleteProfile(data);
|
||||
profile_manager->DeleteProfile(StringUtils::make_filename(data));
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1028,7 +1029,7 @@ void NetworkServer::SendReply_PluginList(SOCKET client_sock)
|
||||
{
|
||||
unsigned int data_size = 0;
|
||||
unsigned int data_ptr = 0;
|
||||
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Calculate data size |
|
||||
\*---------------------------------------------------------*/
|
||||
@@ -1045,12 +1046,12 @@ void NetworkServer::SendReply_PluginList(SOCKET client_sock)
|
||||
data_size += strlen(plugins[i].version.c_str()) + 1;
|
||||
data_size += sizeof(unsigned int) * 2;
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Create data buffer |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char *data_buf = new unsigned char[data_size];
|
||||
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Copy in data size |
|
||||
\*---------------------------------------------------------*/
|
||||
@@ -1103,14 +1104,14 @@ void NetworkServer::SendReply_PluginList(SOCKET client_sock)
|
||||
\*---------------------------------------------------------*/
|
||||
memcpy(&data_buf[data_ptr], &i, sizeof(unsigned int));
|
||||
data_ptr += sizeof(unsigned int);
|
||||
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Copy in plugin sdk version (data) |
|
||||
\*---------------------------------------------------------*/
|
||||
memcpy(&data_buf[data_ptr], &plugins[i].protocol_version, sizeof(int));
|
||||
data_ptr += sizeof(int);
|
||||
}
|
||||
|
||||
|
||||
NetPacketHeader reply_hdr;
|
||||
unsigned int reply_size;
|
||||
|
||||
|
||||
+99
-75
@@ -35,8 +35,8 @@ greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
# Application Configuration #
|
||||
#-----------------------------------------------------------------------------------------------#
|
||||
MAJOR = 0
|
||||
MINOR = 8
|
||||
REVISION = 1
|
||||
MINOR = 9
|
||||
REVISION =
|
||||
VERSION = $$MAJOR"."$$MINOR$$REVISION
|
||||
TARGET = OpenRGB
|
||||
TEMPLATE = app
|
||||
@@ -79,6 +79,32 @@ INCLUDEPATH +=
|
||||
serial_port/ \
|
||||
super_io/ \
|
||||
AutoStart/ \
|
||||
qt/OpenRGBClientInfoPage/ \
|
||||
qt/OpenRGBConsolePage/ \
|
||||
qt/OpenRGBDeviceInfoPage/ \
|
||||
qt/OpenRGBDevicePage/ \
|
||||
qt/OpenRGBDialog2/ \
|
||||
qt/OpenRGBDMXSettingsPage/ \
|
||||
qt/OpenRGBE131SettingsPage/ \
|
||||
qt/OpenRGBElgatoKeyLightSettingsPage/ \
|
||||
qt/OpenRGBHardwareIDsDialog/ \
|
||||
qt/OpenRGBKasaSmartSettingsPage/ \
|
||||
qt/OpenRGBLIFXSettingsPage/ \
|
||||
qt/OpenRGBNanoleafSettingsPage/ \
|
||||
qt/OpenRGBPhilipsHueSettingsPage/ \
|
||||
qt/OpenRGBPhilipsWizSettingsPage/ \
|
||||
qt/OpenRGBPluginContainer/ \
|
||||
qt/OpenRGBProfileSaveDialog/ \
|
||||
qt/OpenRGBQMKORGBSettingsPage/ \
|
||||
qt/OpenRGBSerialSettingsPage/ \
|
||||
qt/OpenRGBServerInfoPage/ \
|
||||
qt/OpenRGBSettingsPage/ \
|
||||
qt/OpenRGBSoftwareInfoPage/ \
|
||||
qt/OpenRGBSupportedDevicesPage/ \
|
||||
qt/OpenRGBSystemInfoPage/ \
|
||||
qt/OpenRGBYeelightSettingsPage/ \
|
||||
qt/OpenRGBZoneResizeDialog/ \
|
||||
qt/OpenRGBZonesBulkResizer/ \
|
||||
Controllers/A4TechController/ \
|
||||
Controllers/AlienwareController/ \
|
||||
Controllers/AlienwareKeyboardController/ \
|
||||
@@ -218,39 +244,30 @@ HEADERS +=
|
||||
DeviceDetector.h \
|
||||
filesystem.h \
|
||||
qt/DetectorTableModel.h \
|
||||
qt/OpenRGBClientInfoPage.h \
|
||||
qt/OpenRGBConsolePage.h \
|
||||
qt/OpenRGBDeviceInfoPage.h \
|
||||
qt/OpenRGBDevicePage.h \
|
||||
qt/OpenRGBDialog.h \
|
||||
hidapi_wrapper/hidapi_wrapper.h \
|
||||
i2c_smbus/i2c_smbus.h \
|
||||
i2c_tools/i2c_tools.h \
|
||||
net_port/net_port.h \
|
||||
pci_ids/pci_ids.h \
|
||||
qt/DeviceView.h \
|
||||
qt/OpenRGBDialog2.h \
|
||||
qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.h \
|
||||
qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.h \
|
||||
qt/OpenRGBHardwareIDsDialog.h \
|
||||
qt/OpenRGBKasaSmartSettingsPage/OpenRGBKasaSmartSettingsEntry.h \
|
||||
qt/OpenRGBKasaSmartSettingsPage/OpenRGBKasaSmartSettingsPage.h \
|
||||
qt/OpenRGBPluginContainer.h \
|
||||
qt/OpenRGBPluginsPage/OpenRGBPluginsEntry.h \
|
||||
qt/OpenRGBPluginsPage/OpenRGBPluginsList.h \
|
||||
qt/OpenRGBPluginsPage/OpenRGBPluginsPage.h \
|
||||
qt/OpenRGBProfileSaveDialog.h \
|
||||
qt/OpenRGBServerInfoPage.h \
|
||||
qt/OpenRGBSettingsPage.h \
|
||||
qt/OpenRGBSoftwareInfoPage.h \
|
||||
qt/OpenRGBSupportedDevicesPage.h \
|
||||
qt/OpenRGBSystemInfoPage.h \
|
||||
qt/OpenRGBFont.h \
|
||||
qt/OpenRGBThemeManager.h \
|
||||
qt/OpenRGBZoneResizeDialog.h \
|
||||
qt/QTooltipedSlider.h \
|
||||
qt/TabLabel.h \
|
||||
qt/OpenRGBClientInfoPage/OpenRGBClientInfoPage.h \
|
||||
qt/OpenRGBConsolePage/OpenRGBConsolePage.h \
|
||||
qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.h \
|
||||
qt/OpenRGBDevicePage/OpenRGBDevicePage.h \
|
||||
qt/OpenRGBDialog2/OpenRGBDialog2.h \
|
||||
qt/OpenRGBDMXSettingsPage/OpenRGBDMXSettingsEntry.h \
|
||||
qt/OpenRGBDMXSettingsPage/OpenRGBDMXSettingsPage.h \
|
||||
qt/OpenRGBE131SettingsPage/OpenRGBE131SettingsEntry.h \
|
||||
qt/OpenRGBE131SettingsPage/OpenRGBE131SettingsPage.h \
|
||||
qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.h \
|
||||
qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.h \
|
||||
qt/OpenRGBHardwareIDsDialog/OpenRGBHardwareIDsDialog.h \
|
||||
qt/OpenRGBKasaSmartSettingsPage/OpenRGBKasaSmartSettingsEntry.h \
|
||||
qt/OpenRGBKasaSmartSettingsPage/OpenRGBKasaSmartSettingsPage.h \
|
||||
qt/OpenRGBLIFXSettingsPage/OpenRGBLIFXSettingsEntry.h \
|
||||
qt/OpenRGBLIFXSettingsPage/OpenRGBLIFXSettingsPage.h \
|
||||
qt/OpenRGBNanoleafSettingsPage/OpenRGBNanoleafSettingsEntry.h \
|
||||
@@ -260,15 +277,24 @@ HEADERS +=
|
||||
qt/OpenRGBPhilipsHueSettingsPage/OpenRGBPhilipsHueSettingsPage.h \
|
||||
qt/OpenRGBPhilipsWizSettingsPage/OpenRGBPhilipsWizSettingsEntry.h \
|
||||
qt/OpenRGBPhilipsWizSettingsPage/OpenRGBPhilipsWizSettingsPage.h \
|
||||
qt/OpenRGBPluginContainer/OpenRGBPluginContainer.h \
|
||||
qt/OpenRGBPluginsPage/OpenRGBPluginsEntry.h \
|
||||
qt/OpenRGBPluginsPage/OpenRGBPluginsList.h \
|
||||
qt/OpenRGBPluginsPage/OpenRGBPluginsPage.h \
|
||||
qt/OpenRGBProfileSaveDialog/OpenRGBProfileSaveDialog.h \
|
||||
qt/OpenRGBQMKORGBSettingsPage/OpenRGBQMKORGBSettingsEntry.h \
|
||||
qt/OpenRGBQMKORGBSettingsPage/OpenRGBQMKORGBSettingsPage.h \
|
||||
qt/OpenRGBSerialSettingsPage/OpenRGBSerialSettingsEntry.h \
|
||||
qt/OpenRGBSerialSettingsPage/OpenRGBSerialSettingsPage.h \
|
||||
qt/OpenRGBServerInfoPage/OpenRGBServerInfoPage.h \
|
||||
qt/OpenRGBSettingsPage/OpenRGBSettingsPage.h \
|
||||
qt/OpenRGBSoftwareInfoPage/OpenRGBSoftwareInfoPage.h \
|
||||
qt/OpenRGBSupportedDevicesPage/OpenRGBSupportedDevicesPage.h \
|
||||
qt/OpenRGBSystemInfoPage/OpenRGBSystemInfoPage.h \
|
||||
qt/OpenRGBYeelightSettingsPage/OpenRGBYeelightSettingsEntry.h \
|
||||
qt/OpenRGBYeelightSettingsPage/OpenRGBYeelightSettingsPage.h \
|
||||
qt/OpenRGBZonesBulkResizer.h \
|
||||
qt/QTooltipedSlider.h \
|
||||
qt/TabLabel.h \
|
||||
qt/OpenRGBZoneResizeDialog/OpenRGBZoneResizeDialog.h \
|
||||
qt/OpenRGBZonesBulkResizer/OpenRGBZonesBulkResizer.h \
|
||||
serial_port/find_usb_serial_port.h \
|
||||
serial_port/serial_port.h \
|
||||
StringUtils.h \
|
||||
@@ -798,41 +824,29 @@ SOURCES +=
|
||||
ResourceManager.cpp \
|
||||
SettingsManager.cpp \
|
||||
qt/DetectorTableModel.cpp \
|
||||
qt/OpenRGBClientInfoPage.cpp \
|
||||
qt/OpenRGBConsolePage.cpp \
|
||||
qt/OpenRGBDeviceInfoPage.cpp \
|
||||
qt/OpenRGBDevicePage.cpp \
|
||||
qt/OpenRGBDialog.cpp \
|
||||
i2c_smbus/i2c_smbus.cpp \
|
||||
i2c_tools/i2c_tools.cpp \
|
||||
net_port/net_port.cpp \
|
||||
qt/DeviceView.cpp \
|
||||
qt/OpenRGBDialog2.cpp \
|
||||
qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.cpp \
|
||||
qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.cpp \
|
||||
qt/OpenRGBHardwareIDsDialog.cpp \
|
||||
qt/OpenRGBKasaSmartSettingsPage/OpenRGBKasaSmartSettingsEntry.cpp \
|
||||
qt/OpenRGBKasaSmartSettingsPage/OpenRGBKasaSmartSettingsPage.cpp \
|
||||
qt/OpenRGBPluginContainer.cpp \
|
||||
qt/OpenRGBPluginsPage/OpenRGBPluginsEntry.cpp \
|
||||
qt/OpenRGBPluginsPage/OpenRGBPluginsList.cpp \
|
||||
qt/OpenRGBPluginsPage/OpenRGBPluginsPage.cpp \
|
||||
qt/OpenRGBProfileSaveDialog.cpp \
|
||||
qt/OpenRGBServerInfoPage.cpp \
|
||||
qt/OpenRGBSettingsPage.cpp \
|
||||
qt/OpenRGBSoftwareInfoPage.cpp \
|
||||
qt/OpenRGBSupportedDevicesPage.cpp \
|
||||
qt/OpenRGBSystemInfoPage.cpp \
|
||||
qt/hsv.cpp \
|
||||
qt/OpenRGBFont.cpp \
|
||||
qt/OpenRGBThemeManager.cpp \
|
||||
qt/OpenRGBZoneResizeDialog.cpp \
|
||||
qt/OpenRGBZonesBulkResizer.cpp \
|
||||
qt/QTooltipedSlider.cpp \
|
||||
qt/TabLabel.cpp \
|
||||
qt/hsv.cpp \
|
||||
qt/OpenRGBClientInfoPage/OpenRGBClientInfoPage.cpp \
|
||||
qt/OpenRGBConsolePage/OpenRGBConsolePage.cpp \
|
||||
qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.cpp \
|
||||
qt/OpenRGBDevicePage/OpenRGBDevicePage.cpp \
|
||||
qt/OpenRGBDialog2/OpenRGBDialog2.cpp \
|
||||
qt/OpenRGBDMXSettingsPage/OpenRGBDMXSettingsEntry.cpp \
|
||||
qt/OpenRGBDMXSettingsPage/OpenRGBDMXSettingsPage.cpp \
|
||||
qt/OpenRGBE131SettingsPage/OpenRGBE131SettingsEntry.cpp \
|
||||
qt/OpenRGBE131SettingsPage/OpenRGBE131SettingsPage.cpp \
|
||||
qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.cpp \
|
||||
qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.cpp \
|
||||
qt/OpenRGBHardwareIDsDialog/OpenRGBHardwareIDsDialog.cpp \
|
||||
qt/OpenRGBKasaSmartSettingsPage/OpenRGBKasaSmartSettingsEntry.cpp \
|
||||
qt/OpenRGBKasaSmartSettingsPage/OpenRGBKasaSmartSettingsPage.cpp \
|
||||
qt/OpenRGBLIFXSettingsPage/OpenRGBLIFXSettingsEntry.cpp \
|
||||
qt/OpenRGBLIFXSettingsPage/OpenRGBLIFXSettingsPage.cpp \
|
||||
qt/OpenRGBNanoleafSettingsPage/OpenRGBNanoleafSettingsEntry.cpp \
|
||||
@@ -842,12 +856,24 @@ SOURCES +=
|
||||
qt/OpenRGBPhilipsHueSettingsPage/OpenRGBPhilipsHueSettingsPage.cpp \
|
||||
qt/OpenRGBPhilipsWizSettingsPage/OpenRGBPhilipsWizSettingsEntry.cpp \
|
||||
qt/OpenRGBPhilipsWizSettingsPage/OpenRGBPhilipsWizSettingsPage.cpp \
|
||||
qt/OpenRGBPluginContainer/OpenRGBPluginContainer.cpp \
|
||||
qt/OpenRGBPluginsPage/OpenRGBPluginsEntry.cpp \
|
||||
qt/OpenRGBPluginsPage/OpenRGBPluginsList.cpp \
|
||||
qt/OpenRGBPluginsPage/OpenRGBPluginsPage.cpp \
|
||||
qt/OpenRGBProfileSaveDialog/OpenRGBProfileSaveDialog.cpp \
|
||||
qt/OpenRGBQMKORGBSettingsPage/OpenRGBQMKORGBSettingsEntry.cpp \
|
||||
qt/OpenRGBQMKORGBSettingsPage/OpenRGBQMKORGBSettingsPage.cpp \
|
||||
qt/OpenRGBSerialSettingsPage/OpenRGBSerialSettingsEntry.cpp \
|
||||
qt/OpenRGBSerialSettingsPage/OpenRGBSerialSettingsPage.cpp \
|
||||
qt/OpenRGBServerInfoPage/OpenRGBServerInfoPage.cpp \
|
||||
qt/OpenRGBSettingsPage/OpenRGBSettingsPage.cpp \
|
||||
qt/OpenRGBSoftwareInfoPage/OpenRGBSoftwareInfoPage.cpp \
|
||||
qt/OpenRGBSupportedDevicesPage/OpenRGBSupportedDevicesPage.cpp \
|
||||
qt/OpenRGBSystemInfoPage/OpenRGBSystemInfoPage.cpp \
|
||||
qt/OpenRGBYeelightSettingsPage/OpenRGBYeelightSettingsEntry.cpp \
|
||||
qt/OpenRGBYeelightSettingsPage/OpenRGBYeelightSettingsPage.cpp \
|
||||
qt/OpenRGBZoneResizeDialog/OpenRGBZoneResizeDialog.cpp \
|
||||
qt/OpenRGBZonesBulkResizer/OpenRGBZonesBulkResizer.cpp \
|
||||
serial_port/serial_port.cpp \
|
||||
StringUtils.cpp \
|
||||
super_io/super_io.cpp \
|
||||
@@ -1465,6 +1491,7 @@ TRANSLATIONS +=
|
||||
qt/i18n/OpenRGB_en_GB.ts \
|
||||
qt/i18n/OpenRGB_es.ts \
|
||||
qt/i18n/OpenRGB_fr.ts \
|
||||
qt/i18n/OpenRGB_hr.ts \
|
||||
qt/i18n/OpenRGB_ms_MY.ts \
|
||||
qt/i18n/OpenRGB_pl.ts \
|
||||
qt/i18n/OpenRGB_pt_BR.ts \
|
||||
@@ -1473,27 +1500,19 @@ TRANSLATIONS +=
|
||||
qt/i18n/OpenRGB_zh_TW.ts \
|
||||
|
||||
FORMS += \
|
||||
qt/OpenRGBClientInfoPage.ui \
|
||||
qt/OpenRGBConsolePage.ui \
|
||||
qt/OpenRGBDeviceInfoPage.ui \
|
||||
qt/OpenRGBDevicePage.ui \
|
||||
qt/OpenRGBDialog.ui \
|
||||
qt/OpenRGBDialog2.ui \
|
||||
qt/OpenRGBHardwareIDsDialog.ui \
|
||||
qt/OpenRGBPluginContainer.ui \
|
||||
qt/OpenRGBProfileSaveDialog.ui \
|
||||
qt/OpenRGBServerInfoPage.ui \
|
||||
qt/OpenRGBSettingsPage.ui \
|
||||
qt/OpenRGBSoftwareInfoPage.ui \
|
||||
qt/OpenRGBSupportedDevicesPage.ui \
|
||||
qt/OpenRGBSystemInfoPage.ui \
|
||||
qt/OpenRGBZoneResizeDialog.ui \
|
||||
qt/TabLabel.ui \
|
||||
qt/OpenRGBClientInfoPage/OpenRGBClientInfoPage.ui \
|
||||
qt/OpenRGBConsolePage/OpenRGBConsolePage.ui \
|
||||
qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.ui \
|
||||
qt/OpenRGBDevicePage/OpenRGBDevicePage.ui \
|
||||
qt/OpenRGBDialog2/OpenRGBDialog2.ui \
|
||||
qt/OpenRGBDMXSettingsPage/OpenRGBDMXSettingsEntry.ui \
|
||||
qt/OpenRGBDMXSettingsPage/OpenRGBDMXSettingsPage.ui \
|
||||
qt/OpenRGBE131SettingsPage/OpenRGBE131SettingsEntry.ui \
|
||||
qt/OpenRGBE131SettingsPage/OpenRGBE131SettingsPage.ui \
|
||||
qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.ui \
|
||||
qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.ui \
|
||||
qt/OpenRGBHardwareIDsDialog/OpenRGBHardwareIDsDialog.ui \
|
||||
qt/OpenRGBKasaSmartSettingsPage/OpenRGBKasaSmartSettingsEntry.ui \
|
||||
qt/OpenRGBKasaSmartSettingsPage/OpenRGBKasaSmartSettingsPage.ui \
|
||||
qt/OpenRGBLIFXSettingsPage/OpenRGBLIFXSettingsEntry.ui \
|
||||
@@ -1504,16 +1523,23 @@ FORMS +=
|
||||
qt/OpenRGBPhilipsHueSettingsPage/OpenRGBPhilipsHueSettingsPage.ui \
|
||||
qt/OpenRGBPhilipsWizSettingsPage/OpenRGBPhilipsWizSettingsEntry.ui \
|
||||
qt/OpenRGBPhilipsWizSettingsPage/OpenRGBPhilipsWizSettingsPage.ui \
|
||||
qt/OpenRGBPluginContainer/OpenRGBPluginContainer.ui \
|
||||
qt/OpenRGBPluginsPage/OpenRGBPluginsEntry.ui \
|
||||
qt/OpenRGBPluginsPage/OpenRGBPluginsPage.ui \
|
||||
qt/OpenRGBProfileSaveDialog/OpenRGBProfileSaveDialog.ui \
|
||||
qt/OpenRGBQMKORGBSettingsPage/OpenRGBQMKORGBSettingsEntry.ui \
|
||||
qt/OpenRGBQMKORGBSettingsPage/OpenRGBQMKORGBSettingsPage.ui \
|
||||
qt/OpenRGBSerialSettingsPage/OpenRGBSerialSettingsEntry.ui \
|
||||
qt/OpenRGBSerialSettingsPage/OpenRGBSerialSettingsPage.ui \
|
||||
qt/OpenRGBServerInfoPage/OpenRGBServerInfoPage.ui \
|
||||
qt/OpenRGBSettingsPage/OpenRGBSettingsPage.ui \
|
||||
qt/OpenRGBSoftwareInfoPage/OpenRGBSoftwareInfoPage.ui \
|
||||
qt/OpenRGBSupportedDevicesPage/OpenRGBSupportedDevicesPage.ui \
|
||||
qt/OpenRGBSystemInfoPage/OpenRGBSystemInfoPage.ui \
|
||||
qt/OpenRGBYeelightSettingsPage/OpenRGBYeelightSettingsEntry.ui \
|
||||
qt/OpenRGBYeelightSettingsPage/OpenRGBYeelightSettingsPage.ui \
|
||||
qt/OpenRGBZonesBulkResizer.ui \
|
||||
qt/TabLabel.ui \
|
||||
qt/OpenRGBZoneResizeDialog/OpenRGBZoneResizeDialog.ui \
|
||||
qt/OpenRGBZonesBulkResizer/OpenRGBZonesBulkResizer.ui \
|
||||
|
||||
#-----------------------------------------------------------------------------------------------#
|
||||
# Windows-specific Configuration #
|
||||
@@ -1625,7 +1651,6 @@ win32:SOURCES +=
|
||||
i2c_smbus/i2c_smbus_piix4.cpp \
|
||||
serial_port/find_usb_serial_port_win.cpp \
|
||||
wmi/wmi.cpp \
|
||||
wmi/acpiwmi.cpp \
|
||||
AutoStart/AutoStart-Windows.cpp \
|
||||
Controllers/AsusTUFLaptopController/AsusTUFLaptopController.cpp \
|
||||
Controllers/AsusTUFLaptopController/AsusTUFLaptopWMIDetect.cpp \
|
||||
@@ -1650,7 +1675,6 @@ win32:HEADERS +=
|
||||
i2c_smbus/i2c_smbus_nvapi.h \
|
||||
i2c_smbus/i2c_smbus_piix4.h \
|
||||
wmi/wmi.h \
|
||||
wmi/acpiwmi.h \
|
||||
AutoStart/AutoStart-Windows.h \
|
||||
Controllers/AsusTUFLaptopController/AsusTUFLaptopController.h \
|
||||
Controllers/AsusTUFLaptopController/RGBController_AsusTUFLaptopWMI.h \
|
||||
@@ -1751,8 +1775,8 @@ contains(QMAKE_PLATFORM, linux) {
|
||||
HEADERS += \
|
||||
i2c_smbus/i2c_smbus_linux.h \
|
||||
AutoStart/AutoStart-Linux.h \
|
||||
Controllers/AsusTUFLaptopLinuxController/AsusTUFLaptopLinuxController.h \
|
||||
Controllers/AsusTUFLaptopLinuxController/RGBController_AsusTUFLaptopLinux.h \
|
||||
Controllers/AsusTUFLaptopController/AsusTUFLaptopLinuxController.h \
|
||||
Controllers/AsusTUFLaptopController/RGBController_AsusTUFLaptopLinux.h \
|
||||
Controllers/ENESMBusController/ENESMBusInterface/ENESMBusInterface_SpectrixS40G.h \
|
||||
Controllers/FaustusController/RGBController_Faustus.h \
|
||||
Controllers/LinuxLEDController/LinuxLEDController.h \
|
||||
@@ -1801,9 +1825,9 @@ contains(QMAKE_PLATFORM, linux) {
|
||||
i2c_smbus/i2c_smbus_linux.cpp \
|
||||
serial_port/find_usb_serial_port_linux.cpp \
|
||||
AutoStart/AutoStart-Linux.cpp \
|
||||
Controllers/AsusTUFLaptopLinuxController/AsusTUFLaptopLinuxController.cpp \
|
||||
Controllers/AsusTUFLaptopLinuxController/AsusTUFLaptopLinuxDetect.cpp \
|
||||
Controllers/AsusTUFLaptopLinuxController/RGBController_AsusTUFLaptopLinux.cpp \
|
||||
Controllers/AsusTUFLaptopController/AsusTUFLaptopLinuxController.cpp \
|
||||
Controllers/AsusTUFLaptopController/AsusTUFLaptopLinuxDetect.cpp \
|
||||
Controllers/AsusTUFLaptopController/RGBController_AsusTUFLaptopLinux.cpp \
|
||||
Controllers/ENESMBusController/XPGSpectrixS40GDetect.cpp \
|
||||
Controllers/ENESMBusController/ENESMBusInterface/ENESMBusInterface_SpectrixS40G.cpp \
|
||||
Controllers/FaustusController/RGBController_Faustus.cpp \
|
||||
|
||||
@@ -1239,6 +1239,7 @@ void ResourceManager::DetectDevicesThreadFunction()
|
||||
| Reset current device pointer to first device |
|
||||
\*-------------------------------------------------*/
|
||||
#ifdef __linux__
|
||||
#ifdef __GLIBC__
|
||||
LOG_INFO("------------------------------------------------------");
|
||||
LOG_INFO("| Detecting libusb HID devices |");
|
||||
LOG_INFO("------------------------------------------------------");
|
||||
@@ -1352,6 +1353,7 @@ void ResourceManager::DetectDevicesThreadFunction()
|
||||
\*-------------------------------------------------*/
|
||||
wrapper.hid_free_enumeration(hid_devices);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
@@ -1431,6 +1433,9 @@ void ResourceManager::DetectDevicesThreadFunction()
|
||||
"<p>See <a href='https://openrgb.org/udev'>https://openrgb.org/udev</a> to install the udev rules manually</p>";
|
||||
|
||||
LOG_DIALOG("%s", message);
|
||||
|
||||
udev_multiple = false;
|
||||
i2c_interface_fail = false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
@@ -1445,6 +1450,8 @@ void ResourceManager::DetectDevicesThreadFunction()
|
||||
"<p>Multiple udev rules files can conflict, it is recommended to remove one of them.</p>";
|
||||
|
||||
LOG_DIALOG("%s", message);
|
||||
|
||||
i2c_interface_fail = false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -38,3 +38,31 @@ const char* StringUtils::wchar_to_char(const wchar_t* pwchar)
|
||||
|
||||
return filePathC;
|
||||
}
|
||||
|
||||
std::string StringUtils::make_filename(std::string input)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Replace : characters with - characters |
|
||||
\*-----------------------------------------------------*/
|
||||
input = std::regex_replace(input, std::regex(":"), "-");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Remove all other characters |
|
||||
\*-----------------------------------------------------*/
|
||||
input = std::regex_replace(input, std::regex("[#%&\\{\\}\\\\<>\\*\\?/!`';@+|=]"), "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Remove leading . characters |
|
||||
\*-----------------------------------------------------*/
|
||||
input = std::regex_replace(input, std::regex("^\\.+"), "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Remove control characters |
|
||||
\*-----------------------------------------------------*/
|
||||
input = std::regex_replace(input, std::regex("[\\x00-\\x1F\\x7F]"), "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Return complete string |
|
||||
\*-----------------------------------------------------*/
|
||||
return(input);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ class StringUtils
|
||||
{
|
||||
public:
|
||||
static const char* wchar_to_char(const wchar_t* pwchar);
|
||||
static std::string make_filename(std::string input);
|
||||
};
|
||||
|
||||
#endif // STRING_UTILS_H
|
||||
|
||||
+3
-2
@@ -30,8 +30,9 @@ extern "C" {
|
||||
#define CMMK_ROWS_MAX 7
|
||||
#define CMMK_COLS_MAX 22
|
||||
|
||||
#define CMMK_KEYLIST_SIZE 256
|
||||
#define CMMK_BUFFER_SIZE 65
|
||||
#define CMMK_FW_SIZE 16
|
||||
#define CMMK_KEYLIST_SIZE 256
|
||||
#define CMMK_BUFFER_SIZE 65
|
||||
|
||||
/*
|
||||
* If we have C99 support (which we do, because libusb-1.0 requires it...), define some handy
|
||||
|
||||
Vendored
+6
-8
@@ -236,12 +236,12 @@ int cmmk_find_device(int *product)
|
||||
|
||||
static int cmmk_try_determine_layout(struct cmmk *dev, int product)
|
||||
{
|
||||
char fw[16];
|
||||
char fw[CMMK_FW_SIZE];
|
||||
|
||||
enum cmmk_layout_type general_layout = CMMK_LAYOUT_TYPE_ANSI;
|
||||
enum cmmk_product_type device_model;
|
||||
enum cmmk_layout_type general_layout = CMMK_LAYOUT_TYPE_ANSI;
|
||||
enum cmmk_product_type device_model = 0;
|
||||
|
||||
if (cmmk_get_firmware_version(dev, fw, sizeof(fw)) == 0) {
|
||||
if (cmmk_get_firmware_version(dev, fw, CMMK_FW_SIZE) == 0) {
|
||||
if (fw[0] == '1') {
|
||||
/* ANSI firmware */
|
||||
general_layout = CMMK_LAYOUT_TYPE_ANSI;
|
||||
@@ -399,7 +399,7 @@ int cmmk_get_firmware_version(struct cmmk *dev, char *fw, size_t fwsiz)
|
||||
fwsiz = 60;
|
||||
}
|
||||
|
||||
strncpy(fw, (char *)data + 4, fwsiz);
|
||||
memcpy(fw, (char *)data + 4, fwsiz);
|
||||
|
||||
return CMMK_OK;
|
||||
}
|
||||
@@ -890,7 +890,6 @@ int cmmk_get_multilayer_map(struct cmmk *dev, struct cmmk_effect_matrix *effmap)
|
||||
{
|
||||
const unsigned char HEADER_SIZE = 9;
|
||||
unsigned char data_size = CMMK_BUFFER_SIZE - HEADER_SIZE;
|
||||
unsigned char data_size_in_bytes = data_size / BYTE_SIZE;
|
||||
int r;
|
||||
|
||||
unsigned char data[CMMK_BUFFER_SIZE];
|
||||
@@ -939,7 +938,6 @@ int cmmk_set_multilayer_map(struct cmmk *dev, struct cmmk_effect_matrix const *e
|
||||
{
|
||||
const unsigned char HEADER_SIZE = 9;
|
||||
unsigned char data_size = CMMK_BUFFER_SIZE - HEADER_SIZE;
|
||||
unsigned char data_size_in_bytes = data_size / BYTE_SIZE;
|
||||
int r;
|
||||
|
||||
unsigned char data[CMMK_BUFFER_SIZE];
|
||||
@@ -1035,7 +1033,7 @@ int cmmk_set_all_single(struct cmmk *dev, struct rgb const *col)
|
||||
*/
|
||||
int cmmk_set_leds(struct cmmk *dev, struct cmmk_color_matrix const *colmap)
|
||||
{
|
||||
unsigned char data[CMMK_BUFFER_SIZE];
|
||||
unsigned char data[CMMK_BUFFER_SIZE];
|
||||
|
||||
int i;
|
||||
int j;
|
||||
|
||||
@@ -47,6 +47,9 @@ fi
|
||||
%doc README.md
|
||||
|
||||
%changelog
|
||||
* Sun Jul 9 2023 Adam Honse <[email protected]> - 0.9-0
|
||||
- Updated to 0.9
|
||||
|
||||
* Tue Nov 29 2022 Adam Honse <[email protected]> - 0.8.1-0
|
||||
- Updated to 0.8.1
|
||||
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
#include "OpenRGBConsolePage.h"
|
||||
#include "LogManager.h"
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace Ui;
|
||||
|
||||
OpenRGBConsolePage::OpenRGBConsolePage(QWidget *parent) :
|
||||
QFrame(parent),
|
||||
ui(new Ui::OpenRGBConsolePageUi)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->log_level->blockSignals(true);
|
||||
ui->log_level->addItems({
|
||||
"Fatal",
|
||||
"Error",
|
||||
"Warning",
|
||||
"Info",
|
||||
"Verbose",
|
||||
"Debug",
|
||||
"Trace"
|
||||
});
|
||||
|
||||
ui->log_level->setCurrentIndex(LogManager::get()->getLoglevel());
|
||||
ui->log_level->blockSignals(false);
|
||||
|
||||
#ifdef _WIN32
|
||||
ui->logs->setFontFamily("Courier New");
|
||||
#endif
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void OpenRGBConsolePage::Refresh()
|
||||
{
|
||||
QString log;
|
||||
|
||||
unsigned int current_level = LogManager::get()->getLoglevel();
|
||||
|
||||
for(PLogMessage& message: LogManager::get()->messages())
|
||||
{
|
||||
unsigned int message_level = message.get()->level;
|
||||
|
||||
if(message_level <= current_level || message_level == LL_DIALOG)
|
||||
{
|
||||
log += "[";
|
||||
log += LogManager::log_codes[message_level];
|
||||
log += "] ";
|
||||
log += QString::fromStdString(message.get()->buffer);
|
||||
log += "\n";
|
||||
}
|
||||
}
|
||||
|
||||
ui->logs->setText(log);
|
||||
}
|
||||
|
||||
void OpenRGBConsolePage::on_log_level_currentIndexChanged(int index)
|
||||
{
|
||||
LogManager::get()->setLoglevel(index);
|
||||
}
|
||||
|
||||
void OpenRGBConsolePage::on_clear_clicked()
|
||||
{
|
||||
LogManager::get()->clearMessages();
|
||||
ui->logs->clear();
|
||||
}
|
||||
|
||||
void OpenRGBConsolePage::on_refresh_clicked()
|
||||
{
|
||||
Refresh();
|
||||
}
|
||||
|
||||
OpenRGBConsolePage::~OpenRGBConsolePage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBConsolePage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
#ifndef OPENRGBCONSOLEPAGE_H
|
||||
#define OPENRGBCONSOLEPAGE_H
|
||||
|
||||
#include <QFrame>
|
||||
#include "ui_OpenRGBConsolePage.h"
|
||||
|
||||
namespace Ui {
|
||||
class OpenRGBConsolePage;
|
||||
}
|
||||
|
||||
class Ui::OpenRGBConsolePage : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBConsolePage(QWidget *parent = nullptr);
|
||||
~OpenRGBConsolePage();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_log_level_currentIndexChanged(int);
|
||||
void on_clear_clicked();
|
||||
void on_refresh_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBConsolePageUi *ui;
|
||||
|
||||
void Refresh();
|
||||
};
|
||||
|
||||
#endif // OPENRGBCONSOLEPAGE_H
|
||||
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBConsolePageUi</class>
|
||||
<widget class="QFrame" name="OpenRGBConsolePageUi">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1328</width>
|
||||
<height>915</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Log console page</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Log level</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="log_level"/>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="refresh">
|
||||
<property name="text">
|
||||
<string>Refresh logs</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="clear">
|
||||
<property name="text">
|
||||
<string>Clear log</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="4">
|
||||
<widget class="QTextEdit" name="logs">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Monospace</family>
|
||||
</font>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <functional>
|
||||
#include <functional>
|
||||
#include "OpenRGBDialog2.h"
|
||||
#include "LogManager.h"
|
||||
#include "PluginManager.h"
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <QMessageBox>
|
||||
#include <QCloseEvent>
|
||||
#include <QStyleFactory>
|
||||
#include "OpenRGBFont.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include "macutils.h"
|
||||
@@ -24,82 +25,79 @@
|
||||
|
||||
using namespace Ui;
|
||||
|
||||
static QString GetIconString(device_type type, bool dark)
|
||||
static int GetIcon(device_type type)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Return the icon filename string for the given device |
|
||||
| Return the icon int value for the given device |
|
||||
| type value |
|
||||
\*-----------------------------------------------------*/
|
||||
QString filename;
|
||||
int icon;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case DEVICE_TYPE_ACCESSORY:
|
||||
filename = "accessory";
|
||||
icon = OpenRGBFont::usb;
|
||||
break;
|
||||
case DEVICE_TYPE_MOTHERBOARD:
|
||||
filename = "motherboard";
|
||||
icon = OpenRGBFont::mainboard;
|
||||
break;
|
||||
case DEVICE_TYPE_DRAM:
|
||||
filename = "dram";
|
||||
icon = OpenRGBFont::dram;
|
||||
break;
|
||||
case DEVICE_TYPE_GPU:
|
||||
filename = "gpu";
|
||||
icon = OpenRGBFont::gpu;
|
||||
break;
|
||||
case DEVICE_TYPE_COOLER:
|
||||
filename = "fan";
|
||||
icon = OpenRGBFont::cooler;
|
||||
break;
|
||||
case DEVICE_TYPE_LEDSTRIP:
|
||||
filename = "ledstrip";
|
||||
icon = OpenRGBFont::ledstrip;
|
||||
break;
|
||||
case DEVICE_TYPE_KEYBOARD:
|
||||
filename = "keyboard";
|
||||
icon = OpenRGBFont::keyboard;
|
||||
break;
|
||||
case DEVICE_TYPE_MICROPHONE:
|
||||
filename = "microphone";
|
||||
icon = OpenRGBFont::mic;
|
||||
break;
|
||||
case DEVICE_TYPE_MOUSE:
|
||||
filename = "mouse";
|
||||
icon = OpenRGBFont::mouse;
|
||||
break;
|
||||
case DEVICE_TYPE_MOUSEMAT:
|
||||
filename = "mousemat";
|
||||
icon = OpenRGBFont::mousemat;
|
||||
break;
|
||||
case DEVICE_TYPE_HEADSET:
|
||||
filename = "headset";
|
||||
icon = OpenRGBFont::headset;
|
||||
break;
|
||||
case DEVICE_TYPE_HEADSET_STAND:
|
||||
filename = "headsetstand";
|
||||
icon = OpenRGBFont::headsetstand;
|
||||
break;
|
||||
case DEVICE_TYPE_GAMEPAD:
|
||||
filename = "gamepad";
|
||||
icon = OpenRGBFont::gamepad;
|
||||
break;
|
||||
case DEVICE_TYPE_LIGHT:
|
||||
filename = "light";
|
||||
icon = OpenRGBFont::bulb;
|
||||
break;
|
||||
case DEVICE_TYPE_SPEAKER:
|
||||
filename = "speaker";
|
||||
icon = OpenRGBFont::music_speaker;
|
||||
break;
|
||||
case DEVICE_TYPE_VIRTUAL:
|
||||
filename = "virtual";
|
||||
icon = OpenRGBFont::virtual_controller;
|
||||
break;
|
||||
case DEVICE_TYPE_STORAGE:
|
||||
filename = "storage";
|
||||
icon = OpenRGBFont::drive;
|
||||
break;
|
||||
case DEVICE_TYPE_CASE:
|
||||
filename = "case";
|
||||
icon = OpenRGBFont::pc_case;
|
||||
break;
|
||||
case DEVICE_TYPE_KEYPAD:
|
||||
filename = "keypad";
|
||||
icon = OpenRGBFont::keypad;
|
||||
break;
|
||||
default:
|
||||
filename = "unknown";
|
||||
icon = OpenRGBFont::unknown;
|
||||
break;
|
||||
}
|
||||
if(dark)
|
||||
{
|
||||
filename += "_dark";
|
||||
}
|
||||
filename += ".png";
|
||||
return filename;
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
static void UpdateDeviceListCallback(void * this_ptr)
|
||||
@@ -652,21 +650,10 @@ void OpenRGBDialog2::AddPluginsPage()
|
||||
|
||||
ui->SettingsTabBar->addTab(PluginsPage, "");
|
||||
|
||||
QString PluginsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
PluginsLabelString = "plugin_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
PluginsLabelString = "plugin.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* PluginTabLabel = new TabLabel(PluginsLabelString, tr("Plugins"), (char *)"Plugins", (char *)context);
|
||||
TabLabel* PluginTabLabel = new TabLabel(OpenRGBFont::extension, tr("Plugins"), (char *)"Plugins", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, PluginTabLabel);
|
||||
}
|
||||
@@ -680,21 +667,10 @@ void OpenRGBDialog2::AddSoftwareInfoPage()
|
||||
|
||||
ui->InformationTabBar->addTab(SoftInfoPage, "");
|
||||
|
||||
QString SoftwareLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SoftwareLabelString = "software_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SoftwareLabelString = "software.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SoftwareTabLabel = new TabLabel(SoftwareLabelString, tr("Software"), (char *)"Software", (char *)context);
|
||||
TabLabel* SoftwareTabLabel = new TabLabel(OpenRGBFont::info, tr("Software"), (char *)"Software", (char *)context);
|
||||
|
||||
ui->InformationTabBar->tabBar()->setTabButton(ui->InformationTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SoftwareTabLabel);
|
||||
}
|
||||
@@ -708,26 +684,14 @@ void OpenRGBDialog2::AddSupportedDevicesPage()
|
||||
|
||||
ui->SettingsTabBar->addTab(SupportedPage, "");
|
||||
|
||||
QString SettingsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SettingsLabelString = "software_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsLabelString = "software.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SupportedTabLabel = new TabLabel(SettingsLabelString, tr("Supported Devices"), (char *)"Supported Devices", (char *)context);
|
||||
TabLabel* SupportedTabLabel = new TabLabel(OpenRGBFont::controller, tr("Supported Devices"), (char *)"Supported Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SupportedTabLabel);
|
||||
}
|
||||
|
||||
|
||||
void OpenRGBDialog2::AddSettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
@@ -737,21 +701,10 @@ void OpenRGBDialog2::AddSettingsPage()
|
||||
|
||||
ui->SettingsTabBar->addTab(SettingsPage, "");
|
||||
|
||||
QString SettingsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SettingsLabelString = "settings_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsLabelString = "settings.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("General Settings"), (char *)"General Settings", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::options, tr("General Settings"), (char *)"General Settings", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
|
||||
@@ -771,21 +724,10 @@ void OpenRGBDialog2::AddDMXSettingsPage()
|
||||
|
||||
ui->SettingsTabBar->addTab(DMXSettingsPage, "");
|
||||
|
||||
QString SettingsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SettingsLabelString = "serial_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsLabelString = "serial.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("DMX Devices"), (char *)"DMX Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::serial, tr("DMX Devices"), (char *)"DMX Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -799,21 +741,10 @@ void OpenRGBDialog2::AddE131SettingsPage()
|
||||
|
||||
ui->SettingsTabBar->addTab(E131SettingsPage, "");
|
||||
|
||||
QString SettingsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SettingsLabelString = "wireless_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsLabelString = "wireless.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("E1.31 Devices"), (char *)"E1.31 Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::data, tr("E1.31 Devices"), (char *)"E1.31 Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -841,7 +772,7 @@ void OpenRGBDialog2::AddKasaSmartSettingsPage()
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("Kasa Smart Devices"), (char *)"Kasa Smart Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Kasa Smart Devices"), (char *)"Kasa Smart Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -855,21 +786,10 @@ void OpenRGBDialog2::AddLIFXSettingsPage()
|
||||
|
||||
ui->SettingsTabBar->addTab(LIFXSettingsPage, "");
|
||||
|
||||
QString SettingsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SettingsLabelString = "light_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsLabelString = "light.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("LIFX Devices"), (char *)"LIFX Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("LIFX Devices"), (char *)"LIFX Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -883,21 +803,10 @@ void OpenRGBDialog2::AddPhilipsHueSettingsPage()
|
||||
|
||||
ui->SettingsTabBar->addTab(PhilipsHueSettingsPage, "");
|
||||
|
||||
QString SettingsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SettingsLabelString = "light_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsLabelString = "light.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("Philips Hue Devices"), (char *)"Philips Hue Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Philips Hue Devices"), (char *)"Philips Hue Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -911,21 +820,10 @@ void OpenRGBDialog2::AddPhilipsWizSettingsPage()
|
||||
|
||||
ui->SettingsTabBar->addTab(PhilipsWizSettingsPage, "");
|
||||
|
||||
QString SettingsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SettingsLabelString = "light_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsLabelString = "light.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("Philips Wiz Devices"), (char *)"Philips Wiz Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Philips Wiz Devices"), (char *)"Philips Wiz Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -939,21 +837,10 @@ void OpenRGBDialog2::AddQMKORGBSettingsPage()
|
||||
|
||||
ui->SettingsTabBar->addTab(QMKORGBSettingsPage, "");
|
||||
|
||||
QString SettingsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SettingsLabelString = "keyboard_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsLabelString = "keyboard.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("OpenRGB QMK Protocol"), (char *)"OpenRGB QMK Protocol", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::keyboard, tr("OpenRGB QMK Protocol"), (char *)"OpenRGB QMK Protocol", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -965,25 +852,14 @@ void OpenRGBDialog2::AddSerialSettingsPage()
|
||||
\*-----------------------------------------------------*/
|
||||
SerialSettingsPage = new OpenRGBSerialSettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(SerialSettingsPage, "");
|
||||
|
||||
QString SettingsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SettingsLabelString = "serial_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsLabelString = "serial.png";
|
||||
}
|
||||
ui->SettingsTabBar->addTab(SerialSettingsPage, "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("Serial Devices"), (char *)"Serial Devices", (char *)context);
|
||||
TabLabel* SerialSettingsTabLabel = new TabLabel(OpenRGBFont::serial, tr("Serial Devices"), (char *)"Serial Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SerialSettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog2::AddYeelightSettingsPage()
|
||||
@@ -995,21 +871,10 @@ void OpenRGBDialog2::AddYeelightSettingsPage()
|
||||
|
||||
ui->SettingsTabBar->addTab(YeelightSettingsPage, "");
|
||||
|
||||
QString SettingsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SettingsLabelString = "light_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsLabelString = "light.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("Yeelight Devices"), (char *)"Yeelight Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Yeelight Devices"), (char *)"Yeelight Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -1023,21 +888,10 @@ void OpenRGBDialog2::AddNanoleafSettingsPage()
|
||||
|
||||
ui->SettingsTabBar->addTab(NanoleafSettingsPage, "");
|
||||
|
||||
QString SettingsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SettingsLabelString = "light_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsLabelString = "light.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("Nanoleaf Devices"), (char *)"Nanoleaf Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Nanoleaf Devices"), (char *)"Nanoleaf Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -1051,51 +905,20 @@ void OpenRGBDialog2::AddElgatoKeyLightSettingsPage()
|
||||
|
||||
ui->SettingsTabBar->addTab(ElgatoKeyLightSettingsPage, "");
|
||||
|
||||
QString SettingsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SettingsLabelString = "light_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsLabelString = "light.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("Elgato KeyLight Devices"), (char *)"Elgato KeyLight Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Elgato KeyLight Devices"), (char *)"Elgato KeyLight Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog2::AddPlugin(OpenRGBPluginEntry* plugin)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create Label for the Tab |
|
||||
\*-----------------------------------------------------*/
|
||||
QLabel* PluginTabLabel = new QLabel;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| If the plugin has custom information, use it, |
|
||||
| otherwise generate it |
|
||||
\*-----------------------------------------------------*/
|
||||
QString PluginLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
PluginLabelString = "plugin_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
PluginLabelString = "plugin.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
PluginTabLabel = (QLabel*)new TabLabel(PluginLabelString, QString::fromStdString(plugin->info.Label), (char *)plugin->info.Label.c_str(), (char *)context);
|
||||
TabLabel* PluginTabLabel = new TabLabel(OpenRGBFont::extension, QString::fromStdString(plugin->info.Label), (char *)plugin->info.Label.c_str(), (char *)context);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Place plugin as its own top level tab |
|
||||
@@ -1265,21 +1088,10 @@ void OpenRGBDialog2::AddI2CToolsPage()
|
||||
\*-----------------------------------------------------*/
|
||||
ui->InformationTabBar->addTab(SMBusToolsPage, "");
|
||||
|
||||
QString SMBusToolsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SMBusToolsLabelString = "tools_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SMBusToolsLabelString = "tools.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SMBusToolsTabLabel = new TabLabel(SMBusToolsLabelString, tr("SMBus Tools"), (char *)"SMBus Tools", (char *)context);
|
||||
TabLabel* SMBusToolsTabLabel = new TabLabel(OpenRGBFont::toolbox, tr("SMBus Tools"), (char *)"SMBus Tools", (char *)context);
|
||||
|
||||
ui->InformationTabBar->tabBar()->setTabButton(ui->InformationTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SMBusToolsTabLabel);
|
||||
}
|
||||
@@ -1400,7 +1212,7 @@ void OpenRGBDialog2::UpdateDevicesList()
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* NewTabLabel = new TabLabel(GetIconString(controllers[controller_idx]->type, OpenRGBThemeManager::IsDarkTheme()), QString::fromStdString(controllers[controller_idx]->name), (char *)controllers[controller_idx]->name.c_str(), (char *)context);
|
||||
TabLabel* NewTabLabel = new TabLabel(GetIcon(controllers[controller_idx]->type), QString::fromStdString(controllers[controller_idx]->name), (char *)controllers[controller_idx]->name.c_str(), (char *)context);
|
||||
|
||||
ui->DevicesTabBar->tabBar()->setTabButton(ui->DevicesTabBar->count() - 1, QTabBar::LeftSide, NewTabLabel);
|
||||
ui->DevicesTabBar->tabBar()->setTabToolTip(ui->DevicesTabBar->count() - 1, QString::fromStdString(controllers[controller_idx]->name));
|
||||
@@ -1451,7 +1263,7 @@ void OpenRGBDialog2::UpdateDevicesList()
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* NewTabLabel = new TabLabel(GetIconString(controllers[controller_idx]->type, OpenRGBThemeManager::IsDarkTheme()), QString::fromStdString(controllers[controller_idx]->name), (char *)controllers[controller_idx]->name.c_str(), (char *)context);
|
||||
TabLabel* NewTabLabel = new TabLabel(GetIcon(controllers[controller_idx]->type), QString::fromStdString(controllers[controller_idx]->name), (char *)controllers[controller_idx]->name.c_str(), (char *)context);
|
||||
|
||||
ui->InformationTabBar->tabBar()->setTabButton(ui->InformationTabBar->count() - 1, QTabBar::LeftSide, NewTabLabel);
|
||||
ui->InformationTabBar->tabBar()->setTabToolTip(ui->InformationTabBar->count() - 1, QString::fromStdString(controllers[controller_idx]->name));
|
||||
@@ -2069,21 +1881,10 @@ void Ui::OpenRGBDialog2::AddConsolePage()
|
||||
|
||||
ui->InformationTabBar->addTab(page, "");
|
||||
|
||||
QString ConsoleLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
ConsoleLabelString = "console_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
ConsoleLabelString = "console.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* ConsoleTabLabel = new TabLabel(ConsoleLabelString, tr("Log Console"), (char *)"Log Console", (char *)context);
|
||||
TabLabel* ConsoleTabLabel = new TabLabel(OpenRGBFont::terminal, tr("Log Console"), (char *)"Log Console", (char *)context);
|
||||
|
||||
ui->InformationTabBar->tabBar()->setTabButton(ui->InformationTabBar->tabBar()->count() - 1, QTabBar::LeftSide, ConsoleTabLabel);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
#include "OpenRGBFont.h"
|
||||
#include <QFontDatabase>
|
||||
|
||||
OpenRGBFont* OpenRGBFont::instance;
|
||||
|
||||
OpenRGBFont::OpenRGBFont(){}
|
||||
|
||||
OpenRGBFont *OpenRGBFont::Get()
|
||||
{
|
||||
if(!instance)
|
||||
{
|
||||
instance = new OpenRGBFont();
|
||||
instance->fontId = QFontDatabase::addApplicationFont(":/fonts/OpenRGB.ttf");
|
||||
|
||||
if(instance->fontId == -1)
|
||||
{
|
||||
printf("Cannot load requested font.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
QString family = QFontDatabase::applicationFontFamilies(instance->fontId).at(0);
|
||||
instance->font = QFont(family);
|
||||
instance->font.setStyleStrategy(QFont::PreferAntialias);
|
||||
}
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
QString OpenRGBFont::icon(int glyph)
|
||||
{
|
||||
return QChar(glyph);
|
||||
}
|
||||
|
||||
QFont OpenRGBFont::GetFont()
|
||||
{
|
||||
return Get()->font;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
#ifndef OPENRGBFONT_H
|
||||
#define OPENRGBFONT_H
|
||||
|
||||
#include <QFont>
|
||||
#include <QString>
|
||||
|
||||
class OpenRGBFont
|
||||
{
|
||||
public:
|
||||
static OpenRGBFont* Get();
|
||||
|
||||
enum Glyph {
|
||||
bulb = 0xF001,
|
||||
controller = 0xF002,
|
||||
cooler = 0xF003,
|
||||
data = 0xF004,
|
||||
dram = 0xF005,
|
||||
drive = 0xF006,
|
||||
extension = 0xF007,
|
||||
gamepad = 0xF008,
|
||||
gpu = 0xF009,
|
||||
headset = 0xF00A,
|
||||
headsetstand = 0xF00B,
|
||||
info = 0xF00C,
|
||||
keyboard = 0xF00D,
|
||||
keypad = 0xF00E,
|
||||
ledstrip = 0xF00F,
|
||||
mainboard = 0xF010,
|
||||
mic = 0xF011,
|
||||
mouse = 0xF012,
|
||||
mousemat = 0xF013,
|
||||
music_speaker = 0xF014,
|
||||
options = 0xF015,
|
||||
pc_case = 0xF016,
|
||||
serial = 0xF017,
|
||||
terminal = 0xF018,
|
||||
toolbox = 0xF019,
|
||||
unknown = 0xF01A,
|
||||
virtual_controller = 0xF01B,
|
||||
usb = 0xF01C
|
||||
};
|
||||
|
||||
static QString icon(int);
|
||||
static QFont GetFont();
|
||||
|
||||
private:
|
||||
OpenRGBFont();
|
||||
|
||||
static OpenRGBFont* instance;
|
||||
int fontId = -1;
|
||||
QFont font;
|
||||
};
|
||||
|
||||
#endif // OPENRGBFONT_H
|
||||
+16
-7
@@ -31,11 +31,16 @@ int Ui::OpenRGBHardwareIDsDialog::show()
|
||||
\*---------------------------------------------------------*/
|
||||
std::vector<i2c_smbus_interface*> i2CBusses = ResourceManager::get()->GetI2CBusses();
|
||||
|
||||
strings.push_back("i2c busses");
|
||||
// The widget takes control over items after creation
|
||||
QTreeWidgetItem* i2c_top = new QTreeWidgetItem(ui->HardwareIdsList, {"i2c busses"});
|
||||
strings.push_back("[ i2c busses ]");
|
||||
|
||||
for(i2c_smbus_interface* bus : i2CBusses)
|
||||
{
|
||||
char line[550];
|
||||
snprintf(line, 550, "%04X:%04X %04X:%04X", bus->pci_vendor, bus->pci_device, bus->pci_subsystem_vendor, bus->pci_subsystem_device);
|
||||
new QTreeWidgetItem(i2c_top, {line, bus->device_name});
|
||||
|
||||
snprintf(line, 550, "%04X:%04X %04X:%04X - %s", bus->pci_vendor, bus->pci_device, bus->pci_subsystem_vendor, bus->pci_subsystem_device, bus->device_name);
|
||||
strings.push_back(line);
|
||||
}
|
||||
@@ -49,7 +54,8 @@ int Ui::OpenRGBHardwareIDsDialog::show()
|
||||
hid_device_info* current_hid_device;
|
||||
current_hid_device = hid_devices;
|
||||
|
||||
strings.push_back("HID devices");
|
||||
QTreeWidgetItem* hid_top = new QTreeWidgetItem(ui->HardwareIdsList, {"HID devices"});
|
||||
strings.push_back("\n[ i2c devices ]");
|
||||
|
||||
while(current_hid_device)
|
||||
{
|
||||
@@ -58,9 +64,12 @@ int Ui::OpenRGBHardwareIDsDialog::show()
|
||||
|
||||
char line[550];
|
||||
|
||||
snprintf(line, 550, "[%04X:%04X U=%04X P=0x%04X I=%d] %s - %s", current_hid_device->vendor_id, current_hid_device->product_id, current_hid_device->usage, current_hid_device->usage_page, current_hid_device->interface_number, manu_name, prod_name);
|
||||
snprintf(line, 550, "[%04X:%04X U=%04X P=0x%04X I=%d]", current_hid_device->vendor_id, current_hid_device->product_id, current_hid_device->usage, current_hid_device->usage_page, current_hid_device->interface_number);
|
||||
new QTreeWidgetItem(hid_top, {line, prod_name, manu_name});
|
||||
|
||||
snprintf(line, 550, "[%04X:%04X U=%04X P=0x%04X I=%d] %s - %s", current_hid_device->vendor_id, current_hid_device->product_id, current_hid_device->usage, current_hid_device->usage_page, current_hid_device->interface_number, manu_name, prod_name);
|
||||
strings.push_back(line);
|
||||
|
||||
current_hid_device = current_hid_device->next;
|
||||
}
|
||||
|
||||
@@ -69,7 +78,8 @@ int Ui::OpenRGBHardwareIDsDialog::show()
|
||||
\*---------------------------------------------------------*/
|
||||
libusb_device** devices = nullptr;
|
||||
|
||||
strings.push_back("LibUSB devices");
|
||||
QTreeWidgetItem* libusb_top = new QTreeWidgetItem(ui->HardwareIdsList, {"LibUSB devices"});
|
||||
strings.push_back("\n[ LibUSB devices ]");
|
||||
|
||||
int ret;
|
||||
|
||||
@@ -102,7 +112,8 @@ int Ui::OpenRGBHardwareIDsDialog::show()
|
||||
}
|
||||
|
||||
char line[512];
|
||||
sprintf(line, "%04X:%04X", descriptor.idVendor, descriptor.idProduct);
|
||||
snprintf(line, 512, "%04X:%04X", descriptor.idVendor, descriptor.idProduct);
|
||||
new QTreeWidgetItem(libusb_top, {line});
|
||||
strings.push_back(line);
|
||||
}
|
||||
|
||||
@@ -111,8 +122,6 @@ int Ui::OpenRGBHardwareIDsDialog::show()
|
||||
libusb_free_device_list(devices, 1);
|
||||
}
|
||||
|
||||
ui->HardwareIdsList->addItems(strings);
|
||||
|
||||
return this->exec();
|
||||
}
|
||||
|
||||
+20
-4
@@ -11,12 +11,9 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
<string>Hardware IDs</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QListWidget" name="HardwareIdsList"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="CopyToClipboardButton">
|
||||
<property name="text">
|
||||
@@ -24,6 +21,25 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTreeWidget" name="HardwareIdsList">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Location</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Device</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Vendor</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
+10
-2
@@ -1,13 +1,21 @@
|
||||
#include "TabLabel.h"
|
||||
#include <QFontMetrics>
|
||||
#include "OpenRGBFont.h"
|
||||
|
||||
Ui::TabLabel::TabLabel(QString icon, QString name, char* original, char* context) :
|
||||
Ui::TabLabel::TabLabel(int icon, QString name, char* original, char* context) :
|
||||
QWidget(nullptr),
|
||||
ui(new Ui::TabLabelUi)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->icon->setText("<img src=':/" + icon + "' height='16' width='16' />");
|
||||
|
||||
QFont font = OpenRGBFont::GetFont();
|
||||
font.setPointSize(18);
|
||||
|
||||
ui->icon->setFont(font);
|
||||
ui->icon->setText(OpenRGBFont::icon(icon));
|
||||
|
||||
ui->name->setText(name);
|
||||
|
||||
label = original;
|
||||
ctxt = context;
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ class Ui::TabLabel : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TabLabel(QString icon, QString name, char* original, char* context);
|
||||
TabLabel(int icon, QString name, char* original, char* context);
|
||||
~TabLabel();
|
||||
|
||||
private:
|
||||
|
||||
@@ -47,18 +47,6 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="icon">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
@@ -113,4 +101,3 @@
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user