Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2286d5c8b4 |
@@ -55,8 +55,8 @@ std::string AuraMousematController::GetVersion()
|
||||
unsigned char usb_buf_out[65];
|
||||
hid_read(dev, usb_buf_out, 65);
|
||||
|
||||
char version[9];
|
||||
snprintf(version, 9, "%X.%02X.%02X", usb_buf_out[6], usb_buf_out[7], usb_buf_out[8]);
|
||||
char version[8];
|
||||
snprintf(version, 8, "%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,238 +1,25 @@
|
||||
#ifdef _WIN32
|
||||
|
||||
#include "AsusTUFLaptopController.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;
|
||||
}
|
||||
#include "acpiwmi.h"
|
||||
|
||||
AsusTUFLaptopController::AsusTUFLaptopController()
|
||||
{
|
||||
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;
|
||||
/*---------------------------------------------------*\
|
||||
| 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();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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,
|
||||
void AsusTUFLaptopController::SetMode(unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue,
|
||||
unsigned char mode,
|
||||
@@ -276,14 +63,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);
|
||||
|
||||
deviceControl(ASUS_WMI_DEVID_TUF_RGB_MODE, high, low);
|
||||
AsWMI_NB_DeviceControl_2arg(ASUS_WMI_DEVID_TUF_RGB_MODE, high, low);
|
||||
|
||||
}
|
||||
|
||||
unsigned char AsusTUFLaptopController::getBrightness()
|
||||
unsigned char AsusTUFLaptopController::GetBrightness()
|
||||
{
|
||||
int backlight_state = 0;
|
||||
getStatus(ASUS_WMI_DEVID_KBD_BACKLIGHT, &backlight_state);
|
||||
AsWMI_NB_GetDeviceStatus(ASUS_WMI_DEVID_KBD_BACKLIGHT, &backlight_state);
|
||||
|
||||
/*----------------------------------------------*\
|
||||
| Only lowest two bits indicate brightness level |
|
||||
@@ -291,19 +78,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);
|
||||
deviceControl(ASUS_WMI_DEVID_KBD_BACKLIGHT, ctrl_param);
|
||||
AsWMI_NB_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,
|
||||
@@ -318,13 +105,7 @@ void AsusTUFLaptopController::setPowerState(bool boot,
|
||||
|
||||
if (save) state = state | ASUS_WMI_KEYBOARD_POWER_SAVE;
|
||||
|
||||
deviceControl(ASUS_WMI_DEVID_TUF_RGB_STATE, state);
|
||||
AsWMI_NB_DeviceControl(ASUS_WMI_DEVID_TUF_RGB_STATE, state);
|
||||
}
|
||||
|
||||
void AsusTUFLaptopController::setFanMode(int mode)
|
||||
{
|
||||
deviceControl(ASUS_WMI_DEVID_FAN_BOOST_MODE, mode);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
#endif // _WIN32
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
#ifndef ASUSTUFLAPTOPCONTROLLER_H
|
||||
#define ASUSTUFLAPTOPCONTROLLER_H
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <windows.h>
|
||||
#ifndef ASUSTUFLAPTOPCONTROLLER_H
|
||||
#define ASUSTUFLAPTOPCONTROLLER_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
|
||||
@@ -37,46 +32,29 @@
|
||||
|
||||
#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
|
||||
{
|
||||
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();
|
||||
~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
|
||||
|
||||
#endif // ASUSTUFLAPTOPCONTROLLER_H
|
||||
|
||||
#endif // _WIN32
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "AsusTUFLaptopController.h"
|
||||
#include "RGBController_AsusTUFLaptopWMI.h"
|
||||
|
||||
#include "acpiwmi.h"
|
||||
#include "Detector.h"
|
||||
#include "wmi.h"
|
||||
#include <string>
|
||||
@@ -35,15 +36,16 @@ static void DetectAsusTUFLaptopWMIControllers()
|
||||
return;
|
||||
}
|
||||
|
||||
AsusTUFLaptopController* controller = AsusTUFLaptopController::checkAndCreate();
|
||||
if(controller)
|
||||
if(AsWMI_Open())
|
||||
{
|
||||
RGBController* new_controller = new RGBController_AsusTUFLaptopWMI(controller);
|
||||
AsusTUFLaptopController* asus_wmi_controller = new AsusTUFLaptopController();
|
||||
RGBController* new_controller = new RGBController_AsusTUFLaptopWMI(asus_wmi_controller);
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(new_controller);
|
||||
// Success! No more if's
|
||||
}
|
||||
} /* DetectAsusTUFLaptopWMIControllers() */
|
||||
} /* DetectFaustusControllers() */
|
||||
|
||||
REGISTER_DETECTOR("ASUS TUF Laptop", DetectAsusTUFLaptopWMIControllers);
|
||||
REGISTER_DETECTOR("TUF Laptop WMI", 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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,4 +25,4 @@ static void DetectAsusTUFLaptopLinuxControllers()
|
||||
return;
|
||||
}
|
||||
|
||||
REGISTER_DETECTOR("ASUS TUF Laptop", DetectAsusTUFLaptopLinuxControllers);
|
||||
REGISTER_DETECTOR("ASUS TUF Laptop Linux WMI", DetectAsusTUFLaptopLinuxControllers);
|
||||
@@ -7,7 +7,6 @@
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController_ENESMBus.h"
|
||||
#include "LogManager.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name ENE SMBus Device
|
||||
@@ -47,112 +46,99 @@ 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 = MODE_FLAG_MANUAL_SAVE;
|
||||
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 | MODE_FLAG_MANUAL_SAVE;
|
||||
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 | 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;
|
||||
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 | 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;
|
||||
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 | 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;
|
||||
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 | 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;
|
||||
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 | 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;
|
||||
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 | 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;
|
||||
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 | 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;
|
||||
modes.push_back(RandomFlicker);
|
||||
|
||||
if(1)
|
||||
{
|
||||
mode Mode14;
|
||||
Mode14.name = "Mode 14";
|
||||
Mode14.value = 14;
|
||||
Mode14.flags = MODE_FLAG_HAS_SPEED;
|
||||
Mode14.color_mode = MODE_COLORS_NONE;
|
||||
Mode14.speed_min = ENE_SPEED_SLOWEST;
|
||||
Mode14.speed_max = ENE_SPEED_FASTEST;
|
||||
Mode14.speed = ENE_SPEED_NORMAL;
|
||||
modes.push_back(Mode14);
|
||||
}
|
||||
|
||||
SetupZones();
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
@@ -176,8 +162,6 @@ int RGBController_ENESMBus::GetDeviceMode()
|
||||
int speed = controller->ENERegisterRead(ENE_REG_SPEED);
|
||||
int direction = controller->ENERegisterRead(ENE_REG_DIRECTION);
|
||||
|
||||
LOG_TRACE("[%s] ENE mode: %02d", name.c_str(), dev_mode);
|
||||
|
||||
if(controller->ENERegisterRead(ENE_REG_DIRECT))
|
||||
{
|
||||
dev_mode = 0xFFFF;
|
||||
|
||||
@@ -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,21 +251,15 @@ 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((unsigned int)(i * 60 + j) < color_data_size)
|
||||
{
|
||||
if(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);
|
||||
}
|
||||
|
||||
@@ -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 == (unsigned int)-1)
|
||||
if(hsv.hue == (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));
|
||||
|
||||
@@ -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 (std::size_t i = 0; i < ChSort.size(); i++)
|
||||
for (int 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 /
|
||||
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 (size_t i = 0; i < sizeof(palit); i++)
|
||||
for (int 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 = 0;
|
||||
Off.flags = MODE_FLAG_MANUAL_SAVE;
|
||||
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;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
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;
|
||||
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
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;
|
||||
SpectrumCycle.flags = MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
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;
|
||||
Wave.flags = MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
Wave.direction = MODE_DIRECTION_RIGHT;
|
||||
Wave.color_mode = MODE_COLORS_NONE;
|
||||
Wave.brightness_min = 0;
|
||||
@@ -374,11 +374,21 @@ 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();
|
||||
controller->SetModeOff(save);
|
||||
break;
|
||||
|
||||
case RAZER_MODE_STATIC:
|
||||
@@ -388,14 +398,14 @@ void RGBController_Razer::DeviceUpdateMode()
|
||||
unsigned char grn = RGBGetGValue(modes[active_mode].colors[0]);
|
||||
unsigned char blu = RGBGetBValue(modes[active_mode].colors[0]);
|
||||
|
||||
controller->SetModeStatic(red, grn, blu);
|
||||
controller->SetModeStatic(red, grn, blu, save);
|
||||
}
|
||||
break;
|
||||
|
||||
case RAZER_MODE_BREATHING:
|
||||
if(modes[active_mode].color_mode == MODE_COLORS_RANDOM)
|
||||
{
|
||||
controller->SetModeBreathingRandom();
|
||||
controller->SetModeBreathingRandom(save);
|
||||
}
|
||||
else if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
|
||||
{
|
||||
@@ -405,7 +415,7 @@ void RGBController_Razer::DeviceUpdateMode()
|
||||
unsigned char grn = RGBGetGValue(modes[active_mode].colors[0]);
|
||||
unsigned char blu = RGBGetBValue(modes[active_mode].colors[0]);
|
||||
|
||||
controller->SetModeBreathingOneColor(red, grn, blu);
|
||||
controller->SetModeBreathingOneColor(red, grn, blu, save);
|
||||
}
|
||||
else if(modes[active_mode].colors.size() == 2)
|
||||
{
|
||||
@@ -416,24 +426,24 @@ void RGBController_Razer::DeviceUpdateMode()
|
||||
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);
|
||||
controller->SetModeBreathingTwoColors(red1, grn1, blu1, red2, grn2, blu2, save);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case RAZER_MODE_SPECTRUM_CYCLE:
|
||||
controller->SetModeSpectrumCycle();
|
||||
controller->SetModeSpectrumCycle(save);
|
||||
break;
|
||||
|
||||
case RAZER_MODE_WAVE:
|
||||
switch(modes[active_mode].direction)
|
||||
{
|
||||
case MODE_DIRECTION_LEFT:
|
||||
controller->SetModeWave(2);
|
||||
controller->SetModeWave(2, save);
|
||||
break;
|
||||
|
||||
default:
|
||||
controller->SetModeWave(1);
|
||||
controller->SetModeWave(1, save);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -38,7 +38,10 @@ 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)
|
||||
void RazerController::SetModeBreathingOneColor(unsigned char red, unsigned char grn, unsigned char blu, bool save)
|
||||
{
|
||||
razer_set_mode_breathing_one_color(red, grn, blu);
|
||||
razer_set_mode_breathing_one_color(red, grn, blu, save);
|
||||
}
|
||||
|
||||
void RazerController::SetModeBreathingRandom()
|
||||
void RazerController::SetModeBreathingRandom(bool save)
|
||||
{
|
||||
razer_set_mode_breathing_random();
|
||||
razer_set_mode_breathing_random(save);
|
||||
}
|
||||
|
||||
void RazerController::SetModeBreathingTwoColors(unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2)
|
||||
void RazerController::SetModeBreathingTwoColors(unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2, bool save)
|
||||
{
|
||||
razer_set_mode_breathing_two_colors(r1, g1, b1, r2, g2, b2);
|
||||
razer_set_mode_breathing_two_colors(r1, g1, b1, r2, g2, b2, save);
|
||||
}
|
||||
|
||||
void RazerController::SetModeOff()
|
||||
void RazerController::SetModeOff(bool save)
|
||||
{
|
||||
razer_set_mode_none();
|
||||
razer_set_mode_none(save);
|
||||
}
|
||||
|
||||
void RazerController::SetModeSpectrumCycle()
|
||||
void RazerController::SetModeSpectrumCycle(bool save)
|
||||
{
|
||||
razer_set_mode_spectrum_cycle();
|
||||
razer_set_mode_spectrum_cycle(save);
|
||||
}
|
||||
|
||||
void RazerController::SetModeStatic(unsigned char red, unsigned char grn, unsigned char blu)
|
||||
void RazerController::SetModeStatic(unsigned char red, unsigned char grn, unsigned char blu, bool save)
|
||||
{
|
||||
razer_set_mode_static(red, grn, blu);
|
||||
razer_set_mode_static(red, grn, blu, save);
|
||||
}
|
||||
|
||||
void RazerController::SetModeWave(unsigned char direction)
|
||||
void RazerController::SetModeWave(unsigned char direction, bool save)
|
||||
{
|
||||
razer_set_mode_wave(direction);
|
||||
razer_set_mode_wave(direction, save);
|
||||
}
|
||||
|
||||
bool RazerController::SupportsBreathing()
|
||||
@@ -1250,21 +1250,27 @@ 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)
|
||||
void RazerController::razer_set_mode_breathing_one_color(unsigned char red, unsigned char grn, unsigned char blu, bool save)
|
||||
{
|
||||
razer_report report;
|
||||
unsigned char storage_mode = RAZER_STORAGE_NO_SAVE;
|
||||
razer_report report;
|
||||
|
||||
if(save)
|
||||
{
|
||||
storage_mode = RAZER_STORAGE_SAVE;
|
||||
}
|
||||
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_MATRIX_TYPE_STANDARD:
|
||||
case RAZER_MATRIX_TYPE_LINEAR:
|
||||
report = razer_create_mode_breathing_one_color_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, red, grn, blu);
|
||||
report = razer_create_mode_breathing_one_color_standard_matrix_report(storage_mode, 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(RAZER_STORAGE_NO_SAVE, dev_led_id, red, grn, blu);
|
||||
report = razer_create_mode_breathing_one_color_extended_matrix_report(storage_mode, dev_led_id, red, grn, blu);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1283,41 +1289,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(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_BACKLIGHT, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 2);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_BACKLIGHT, 2);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_DEATHADDER_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 2);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 2);
|
||||
razer_usb_send(&report);
|
||||
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, &rgb_data[3]);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_LOGO, &rgb_data[3]);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, 2);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_LOGO, 2);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_NAGA_EPIC_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 2);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 2);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, &rgb_data[3]);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_BACKLIGHT, &rgb_data[3]);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 2);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_BACKLIGHT, 2);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1325,7 +1331,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(RAZER_STORAGE_NO_SAVE, dev_led_id, red, grn, blu);
|
||||
report = razer_create_mode_breathing_one_color_standard_matrix_report(storage_mode, dev_led_id, red, grn, blu);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
}
|
||||
@@ -1333,21 +1339,27 @@ void RazerController::razer_set_mode_breathing_one_color(unsigned char red, unsi
|
||||
}
|
||||
}
|
||||
|
||||
void RazerController::razer_set_mode_breathing_random()
|
||||
void RazerController::razer_set_mode_breathing_random(bool save)
|
||||
{
|
||||
razer_report report;
|
||||
unsigned char storage_mode = RAZER_STORAGE_NO_SAVE;
|
||||
razer_report report;
|
||||
|
||||
if(save)
|
||||
{
|
||||
storage_mode = RAZER_STORAGE_SAVE;
|
||||
}
|
||||
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_MATRIX_TYPE_STANDARD:
|
||||
case RAZER_MATRIX_TYPE_LINEAR:
|
||||
report = razer_create_mode_breathing_random_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
report = razer_create_mode_breathing_random_standard_matrix_report(storage_mode, 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(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
report = razer_create_mode_breathing_random_extended_matrix_report(storage_mode, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1358,7 +1370,7 @@ void RazerController::razer_set_mode_breathing_random()
|
||||
| These devices use standard matrix reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_ORBWEAVER_CHROMA_PID:
|
||||
report = razer_create_mode_breathing_random_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
report = razer_create_mode_breathing_random_standard_matrix_report(storage_mode, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
}
|
||||
@@ -1366,21 +1378,27 @@ void RazerController::razer_set_mode_breathing_random()
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
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)
|
||||
{
|
||||
razer_report report;
|
||||
unsigned char storage_mode = RAZER_STORAGE_NO_SAVE;
|
||||
razer_report report;
|
||||
|
||||
if(save)
|
||||
{
|
||||
storage_mode = RAZER_STORAGE_SAVE;
|
||||
}
|
||||
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_MATRIX_TYPE_STANDARD:
|
||||
case RAZER_MATRIX_TYPE_LINEAR:
|
||||
report = razer_create_mode_breathing_two_colors_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, r1, g1, b1, r2, g2, b2);
|
||||
report = razer_create_mode_breathing_two_colors_standard_matrix_report(storage_mode, 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(RAZER_STORAGE_NO_SAVE, dev_led_id, r1, g1, b1, r2, g2, b2);
|
||||
report = razer_create_mode_breathing_two_colors_extended_matrix_report(storage_mode, dev_led_id, r1, g1, b1, r2, g2, b2);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1391,7 +1409,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(RAZER_STORAGE_NO_SAVE, dev_led_id, r1, g1, b1, r2, g2, b2);
|
||||
report = razer_create_mode_breathing_two_colors_standard_matrix_report(storage_mode, dev_led_id, r1, g1, b1, r2, g2, b2);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
}
|
||||
@@ -1460,21 +1478,27 @@ void RazerController::razer_set_mode_custom()
|
||||
}
|
||||
}
|
||||
|
||||
void RazerController::razer_set_mode_none()
|
||||
void RazerController::razer_set_mode_none(bool save)
|
||||
{
|
||||
razer_report report;
|
||||
unsigned char storage_mode = RAZER_STORAGE_NO_SAVE;
|
||||
razer_report report;
|
||||
|
||||
if(save)
|
||||
{
|
||||
storage_mode = RAZER_STORAGE_SAVE;
|
||||
}
|
||||
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_MATRIX_TYPE_STANDARD:
|
||||
case RAZER_MATRIX_TYPE_LINEAR:
|
||||
report = razer_create_mode_none_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
report = razer_create_mode_none_standard_matrix_report(storage_mode, 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(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
report = razer_create_mode_none_extended_matrix_report(storage_mode, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1493,49 +1517,49 @@ void RazerController::razer_set_mode_none()
|
||||
| These devices use individual LED effect reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_TARTARUS_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_BACKLIGHT, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 0);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_BACKLIGHT, 0);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_DEATHADDER_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
razer_usb_send(&report);
|
||||
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, &rgb_data[3]);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_LOGO, &rgb_data[3]);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, 0);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_LOGO, 0);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_NAGA_EPIC_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, &rgb_data[3]);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_BACKLIGHT, &rgb_data[3]);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 0);
|
||||
report = razer_create_set_led_effect_report(storage_mode, 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(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1543,7 +1567,7 @@ void RazerController::razer_set_mode_none()
|
||||
| These devices use standard matrix reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_ORBWEAVER_CHROMA_PID:
|
||||
report = razer_create_mode_none_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
report = razer_create_mode_none_standard_matrix_report(storage_mode, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
}
|
||||
@@ -1551,21 +1575,27 @@ void RazerController::razer_set_mode_none()
|
||||
}
|
||||
}
|
||||
|
||||
void RazerController::razer_set_mode_spectrum_cycle()
|
||||
void RazerController::razer_set_mode_spectrum_cycle(bool save)
|
||||
{
|
||||
razer_report report;
|
||||
unsigned char storage_mode = RAZER_STORAGE_NO_SAVE;
|
||||
razer_report report;
|
||||
|
||||
if(save)
|
||||
{
|
||||
storage_mode = RAZER_STORAGE_SAVE;
|
||||
}
|
||||
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_MATRIX_TYPE_STANDARD:
|
||||
case RAZER_MATRIX_TYPE_LINEAR:
|
||||
report = razer_create_mode_spectrum_cycle_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
report = razer_create_mode_spectrum_cycle_standard_matrix_report(storage_mode, 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(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
report = razer_create_mode_spectrum_cycle_extended_matrix_report(storage_mode, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1576,31 +1606,31 @@ void RazerController::razer_set_mode_spectrum_cycle()
|
||||
| These devices use individual LED effect reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_TARTARUS_CHROMA_PID:
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 4);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_BACKLIGHT, 4);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_DEATHADDER_CHROMA_PID:
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 4);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 4);
|
||||
razer_usb_send(&report);
|
||||
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, 4);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_LOGO, 4);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_NAGA_EPIC_CHROMA_PID:
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 4);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 4);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 4);
|
||||
report = razer_create_set_led_effect_report(storage_mode, 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(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 4);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 4);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1608,7 +1638,7 @@ void RazerController::razer_set_mode_spectrum_cycle()
|
||||
| These devices use standard matrix reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_ORBWEAVER_CHROMA_PID:
|
||||
report = razer_create_mode_spectrum_cycle_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id);
|
||||
report = razer_create_mode_spectrum_cycle_standard_matrix_report(storage_mode, dev_led_id);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
}
|
||||
@@ -1616,21 +1646,27 @@ void RazerController::razer_set_mode_spectrum_cycle()
|
||||
}
|
||||
}
|
||||
|
||||
void RazerController::razer_set_mode_static(unsigned char red, unsigned char grn, unsigned char blu)
|
||||
void RazerController::razer_set_mode_static(unsigned char red, unsigned char grn, unsigned char blu, bool save)
|
||||
{
|
||||
razer_report report;
|
||||
unsigned char storage_mode = RAZER_STORAGE_NO_SAVE;
|
||||
razer_report report;
|
||||
|
||||
if(save)
|
||||
{
|
||||
storage_mode = RAZER_STORAGE_SAVE;
|
||||
}
|
||||
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_MATRIX_TYPE_STANDARD:
|
||||
case RAZER_MATRIX_TYPE_LINEAR:
|
||||
report = razer_create_mode_static_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, red, grn, blu);
|
||||
report = razer_create_mode_static_standard_matrix_report(storage_mode, 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(RAZER_STORAGE_NO_SAVE, dev_led_id, red, grn, blu);
|
||||
report = razer_create_mode_static_extended_matrix_report(storage_mode, dev_led_id, red, grn, blu);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1649,49 +1685,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(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_BACKLIGHT, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 0);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_BACKLIGHT, 0);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_DEATHADDER_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
razer_usb_send(&report);
|
||||
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, &rgb_data[3]);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_LOGO, &rgb_data[3]);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, 0);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_LOGO, 0);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
case RAZER_NAGA_EPIC_CHROMA_PID:
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, &rgb_data[3]);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_BACKLIGHT, &rgb_data[3]);
|
||||
razer_usb_send(&report);
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 0);
|
||||
report = razer_create_set_led_effect_report(storage_mode, 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(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
report = razer_create_set_led_rgb_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, rgb_data);
|
||||
razer_usb_send(&report);
|
||||
report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
report = razer_create_set_led_effect_report(storage_mode, RAZER_LED_ID_SCROLL_WHEEL, 0);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1699,7 +1735,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(RAZER_STORAGE_NO_SAVE, dev_led_id, red, grn, blu);
|
||||
report = razer_create_mode_static_standard_matrix_report(storage_mode, dev_led_id, red, grn, blu);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
}
|
||||
@@ -1707,21 +1743,27 @@ void RazerController::razer_set_mode_static(unsigned char red, unsigned char grn
|
||||
}
|
||||
}
|
||||
|
||||
void RazerController::razer_set_mode_wave(unsigned char direction)
|
||||
void RazerController::razer_set_mode_wave(unsigned char direction, bool save)
|
||||
{
|
||||
razer_report report;
|
||||
unsigned char storage_mode = RAZER_STORAGE_NO_SAVE;
|
||||
razer_report report;
|
||||
|
||||
if(save)
|
||||
{
|
||||
storage_mode = RAZER_STORAGE_SAVE;
|
||||
}
|
||||
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_MATRIX_TYPE_STANDARD:
|
||||
case RAZER_MATRIX_TYPE_LINEAR:
|
||||
report = razer_create_mode_wave_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, direction);
|
||||
report = razer_create_mode_wave_standard_matrix_report(storage_mode, 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(RAZER_STORAGE_NO_SAVE, dev_led_id, direction);
|
||||
report = razer_create_mode_wave_extended_matrix_report(storage_mode, dev_led_id, direction);
|
||||
razer_usb_send(&report);
|
||||
break;
|
||||
|
||||
@@ -1732,7 +1774,7 @@ void RazerController::razer_set_mode_wave(unsigned char direction)
|
||||
| These devices use standard matrix reports |
|
||||
\*-------------------------------------------------*/
|
||||
case RAZER_ORBWEAVER_CHROMA_PID:
|
||||
report = razer_create_mode_wave_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, direction);
|
||||
report = razer_create_mode_wave_standard_matrix_report(storage_mode, 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();
|
||||
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);
|
||||
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);
|
||||
|
||||
bool SupportsBreathing();
|
||||
bool SupportsReactive();
|
||||
@@ -325,14 +325,14 @@ private:
|
||||
|
||||
void razer_set_device_mode(unsigned char device_mode);
|
||||
|
||||
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_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_custom();
|
||||
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);
|
||||
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);
|
||||
|
||||
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 |
|
||||
|
||||
@@ -408,7 +408,7 @@ void RGBController_ZotacV2GPU::DeviceUpdateMode()
|
||||
if(zoneConfig.mode == ZOTAC_V2_GPU_MODE_DUET)
|
||||
{
|
||||
zoneConfig.colorPreset = ZOTAC_V2_GPU_DUET_PRESETS.size(); // custom
|
||||
for(size_t i = 0; i < ZOTAC_V2_GPU_DUET_PRESETS.size(); ++i)
|
||||
for(int 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)
|
||||
|
||||
@@ -79,32 +79,6 @@ 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/ \
|
||||
@@ -244,30 +218,39 @@ 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/OpenRGBFont.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/OpenRGBThemeManager.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/OpenRGBZoneResizeDialog.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 \
|
||||
@@ -277,24 +260,15 @@ 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/OpenRGBZoneResizeDialog/OpenRGBZoneResizeDialog.h \
|
||||
qt/OpenRGBZonesBulkResizer/OpenRGBZonesBulkResizer.h \
|
||||
qt/OpenRGBZonesBulkResizer.h \
|
||||
qt/QTooltipedSlider.h \
|
||||
qt/TabLabel.h \
|
||||
serial_port/find_usb_serial_port.h \
|
||||
serial_port/serial_port.h \
|
||||
StringUtils.h \
|
||||
@@ -824,29 +798,41 @@ 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/hsv.cpp \
|
||||
qt/OpenRGBFont.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/OpenRGBThemeManager.cpp \
|
||||
qt/OpenRGBZoneResizeDialog.cpp \
|
||||
qt/OpenRGBZonesBulkResizer.cpp \
|
||||
qt/QTooltipedSlider.cpp \
|
||||
qt/TabLabel.cpp \
|
||||
qt/OpenRGBClientInfoPage/OpenRGBClientInfoPage.cpp \
|
||||
qt/OpenRGBConsolePage/OpenRGBConsolePage.cpp \
|
||||
qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.cpp \
|
||||
qt/OpenRGBDevicePage/OpenRGBDevicePage.cpp \
|
||||
qt/OpenRGBDialog2/OpenRGBDialog2.cpp \
|
||||
qt/hsv.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 \
|
||||
@@ -856,24 +842,12 @@ 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 \
|
||||
@@ -1491,7 +1465,6 @@ 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 \
|
||||
@@ -1500,19 +1473,27 @@ TRANSLATIONS +=
|
||||
qt/i18n/OpenRGB_zh_TW.ts \
|
||||
|
||||
FORMS += \
|
||||
qt/TabLabel.ui \
|
||||
qt/OpenRGBClientInfoPage/OpenRGBClientInfoPage.ui \
|
||||
qt/OpenRGBConsolePage/OpenRGBConsolePage.ui \
|
||||
qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.ui \
|
||||
qt/OpenRGBDevicePage/OpenRGBDevicePage.ui \
|
||||
qt/OpenRGBDialog2/OpenRGBDialog2.ui \
|
||||
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/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 \
|
||||
@@ -1523,23 +1504,16 @@ 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/OpenRGBZoneResizeDialog/OpenRGBZoneResizeDialog.ui \
|
||||
qt/OpenRGBZonesBulkResizer/OpenRGBZonesBulkResizer.ui \
|
||||
qt/OpenRGBZonesBulkResizer.ui \
|
||||
qt/TabLabel.ui \
|
||||
|
||||
#-----------------------------------------------------------------------------------------------#
|
||||
# Windows-specific Configuration #
|
||||
@@ -1651,6 +1625,7 @@ 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 \
|
||||
@@ -1675,6 +1650,7 @@ 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 \
|
||||
@@ -1775,8 +1751,8 @@ contains(QMAKE_PLATFORM, linux) {
|
||||
HEADERS += \
|
||||
i2c_smbus/i2c_smbus_linux.h \
|
||||
AutoStart/AutoStart-Linux.h \
|
||||
Controllers/AsusTUFLaptopController/AsusTUFLaptopLinuxController.h \
|
||||
Controllers/AsusTUFLaptopController/RGBController_AsusTUFLaptopLinux.h \
|
||||
Controllers/AsusTUFLaptopLinuxController/AsusTUFLaptopLinuxController.h \
|
||||
Controllers/AsusTUFLaptopLinuxController/RGBController_AsusTUFLaptopLinux.h \
|
||||
Controllers/ENESMBusController/ENESMBusInterface/ENESMBusInterface_SpectrixS40G.h \
|
||||
Controllers/FaustusController/RGBController_Faustus.h \
|
||||
Controllers/LinuxLEDController/LinuxLEDController.h \
|
||||
@@ -1825,9 +1801,9 @@ contains(QMAKE_PLATFORM, linux) {
|
||||
i2c_smbus/i2c_smbus_linux.cpp \
|
||||
serial_port/find_usb_serial_port_linux.cpp \
|
||||
AutoStart/AutoStart-Linux.cpp \
|
||||
Controllers/AsusTUFLaptopController/AsusTUFLaptopLinuxController.cpp \
|
||||
Controllers/AsusTUFLaptopController/AsusTUFLaptopLinuxDetect.cpp \
|
||||
Controllers/AsusTUFLaptopController/RGBController_AsusTUFLaptopLinux.cpp \
|
||||
Controllers/AsusTUFLaptopLinuxController/AsusTUFLaptopLinuxController.cpp \
|
||||
Controllers/AsusTUFLaptopLinuxController/AsusTUFLaptopLinuxDetect.cpp \
|
||||
Controllers/AsusTUFLaptopLinuxController/RGBController_AsusTUFLaptopLinux.cpp \
|
||||
Controllers/ENESMBusController/XPGSpectrixS40GDetect.cpp \
|
||||
Controllers/ENESMBusController/ENESMBusInterface/ENESMBusInterface_SpectrixS40G.cpp \
|
||||
Controllers/FaustusController/RGBController_Faustus.cpp \
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
#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);
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
#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
|
||||
@@ -1,54 +0,0 @@
|
||||
<?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,7 +17,6 @@
|
||||
#include <QMessageBox>
|
||||
#include <QCloseEvent>
|
||||
#include <QStyleFactory>
|
||||
#include "OpenRGBFont.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include "macutils.h"
|
||||
@@ -25,79 +24,82 @@
|
||||
|
||||
using namespace Ui;
|
||||
|
||||
static int GetIcon(device_type type)
|
||||
static QString GetIconString(device_type type, bool dark)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Return the icon int value for the given device |
|
||||
| Return the icon filename string for the given device |
|
||||
| type value |
|
||||
\*-----------------------------------------------------*/
|
||||
int icon;
|
||||
|
||||
QString filename;
|
||||
switch(type)
|
||||
{
|
||||
case DEVICE_TYPE_ACCESSORY:
|
||||
icon = OpenRGBFont::usb;
|
||||
filename = "accessory";
|
||||
break;
|
||||
case DEVICE_TYPE_MOTHERBOARD:
|
||||
icon = OpenRGBFont::mainboard;
|
||||
filename = "motherboard";
|
||||
break;
|
||||
case DEVICE_TYPE_DRAM:
|
||||
icon = OpenRGBFont::dram;
|
||||
filename = "dram";
|
||||
break;
|
||||
case DEVICE_TYPE_GPU:
|
||||
icon = OpenRGBFont::gpu;
|
||||
filename = "gpu";
|
||||
break;
|
||||
case DEVICE_TYPE_COOLER:
|
||||
icon = OpenRGBFont::cooler;
|
||||
filename = "fan";
|
||||
break;
|
||||
case DEVICE_TYPE_LEDSTRIP:
|
||||
icon = OpenRGBFont::ledstrip;
|
||||
filename = "ledstrip";
|
||||
break;
|
||||
case DEVICE_TYPE_KEYBOARD:
|
||||
icon = OpenRGBFont::keyboard;
|
||||
filename = "keyboard";
|
||||
break;
|
||||
case DEVICE_TYPE_MICROPHONE:
|
||||
icon = OpenRGBFont::mic;
|
||||
filename = "microphone";
|
||||
break;
|
||||
case DEVICE_TYPE_MOUSE:
|
||||
icon = OpenRGBFont::mouse;
|
||||
filename = "mouse";
|
||||
break;
|
||||
case DEVICE_TYPE_MOUSEMAT:
|
||||
icon = OpenRGBFont::mousemat;
|
||||
filename = "mousemat";
|
||||
break;
|
||||
case DEVICE_TYPE_HEADSET:
|
||||
icon = OpenRGBFont::headset;
|
||||
filename = "headset";
|
||||
break;
|
||||
case DEVICE_TYPE_HEADSET_STAND:
|
||||
icon = OpenRGBFont::headsetstand;
|
||||
filename = "headsetstand";
|
||||
break;
|
||||
case DEVICE_TYPE_GAMEPAD:
|
||||
icon = OpenRGBFont::gamepad;
|
||||
filename = "gamepad";
|
||||
break;
|
||||
case DEVICE_TYPE_LIGHT:
|
||||
icon = OpenRGBFont::bulb;
|
||||
filename = "light";
|
||||
break;
|
||||
case DEVICE_TYPE_SPEAKER:
|
||||
icon = OpenRGBFont::music_speaker;
|
||||
filename = "speaker";
|
||||
break;
|
||||
case DEVICE_TYPE_VIRTUAL:
|
||||
icon = OpenRGBFont::virtual_controller;
|
||||
filename = "virtual";
|
||||
break;
|
||||
case DEVICE_TYPE_STORAGE:
|
||||
icon = OpenRGBFont::drive;
|
||||
filename = "storage";
|
||||
break;
|
||||
case DEVICE_TYPE_CASE:
|
||||
icon = OpenRGBFont::pc_case;
|
||||
filename = "case";
|
||||
break;
|
||||
case DEVICE_TYPE_KEYPAD:
|
||||
icon = OpenRGBFont::keypad;
|
||||
filename = "keypad";
|
||||
break;
|
||||
default:
|
||||
icon = OpenRGBFont::unknown;
|
||||
filename = "unknown";
|
||||
break;
|
||||
}
|
||||
|
||||
return icon;
|
||||
if(dark)
|
||||
{
|
||||
filename += "_dark";
|
||||
}
|
||||
filename += ".png";
|
||||
return filename;
|
||||
}
|
||||
|
||||
static void UpdateDeviceListCallback(void * this_ptr)
|
||||
@@ -650,10 +652,21 @@ 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(OpenRGBFont::extension, tr("Plugins"), (char *)"Plugins", (char *)context);
|
||||
TabLabel* PluginTabLabel = new TabLabel(PluginsLabelString, tr("Plugins"), (char *)"Plugins", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, PluginTabLabel);
|
||||
}
|
||||
@@ -667,10 +680,21 @@ 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(OpenRGBFont::info, tr("Software"), (char *)"Software", (char *)context);
|
||||
TabLabel* SoftwareTabLabel = new TabLabel(SoftwareLabelString, tr("Software"), (char *)"Software", (char *)context);
|
||||
|
||||
ui->InformationTabBar->tabBar()->setTabButton(ui->InformationTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SoftwareTabLabel);
|
||||
}
|
||||
@@ -684,14 +708,26 @@ 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(OpenRGBFont::controller, tr("Supported Devices"), (char *)"Supported Devices", (char *)context);
|
||||
TabLabel* SupportedTabLabel = new TabLabel(SettingsLabelString, tr("Supported Devices"), (char *)"Supported Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SupportedTabLabel);
|
||||
}
|
||||
|
||||
|
||||
void OpenRGBDialog2::AddSettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
@@ -701,10 +737,21 @@ 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(OpenRGBFont::options, tr("General Settings"), (char *)"General Settings", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("General Settings"), (char *)"General Settings", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
|
||||
@@ -724,10 +771,21 @@ 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(OpenRGBFont::serial, tr("DMX Devices"), (char *)"DMX Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("DMX Devices"), (char *)"DMX Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -741,10 +799,21 @@ 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(OpenRGBFont::data, tr("E1.31 Devices"), (char *)"E1.31 Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("E1.31 Devices"), (char *)"E1.31 Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -772,7 +841,7 @@ void OpenRGBDialog2::AddKasaSmartSettingsPage()
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Kasa Smart Devices"), (char *)"Kasa Smart Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("Kasa Smart Devices"), (char *)"Kasa Smart Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -786,10 +855,21 @@ 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(OpenRGBFont::bulb, tr("LIFX Devices"), (char *)"LIFX Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("LIFX Devices"), (char *)"LIFX Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -803,10 +883,21 @@ 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(OpenRGBFont::bulb, tr("Philips Hue Devices"), (char *)"Philips Hue Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("Philips Hue Devices"), (char *)"Philips Hue Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -820,10 +911,21 @@ 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(OpenRGBFont::bulb, tr("Philips Wiz Devices"), (char *)"Philips Wiz Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("Philips Wiz Devices"), (char *)"Philips Wiz Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -837,10 +939,21 @@ 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(OpenRGBFont::keyboard, tr("OpenRGB QMK Protocol"), (char *)"OpenRGB QMK Protocol", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("OpenRGB QMK Protocol"), (char *)"OpenRGB QMK Protocol", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -852,14 +965,25 @@ void OpenRGBDialog2::AddSerialSettingsPage()
|
||||
\*-----------------------------------------------------*/
|
||||
SerialSettingsPage = new OpenRGBSerialSettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(SerialSettingsPage, "");
|
||||
ui->SettingsTabBar->addTab(SerialSettingsPage, "");
|
||||
|
||||
QString SettingsLabelString;
|
||||
|
||||
if(OpenRGBThemeManager::IsDarkTheme())
|
||||
{
|
||||
SettingsLabelString = "serial_dark.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsLabelString = "serial.png";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SerialSettingsTabLabel = new TabLabel(OpenRGBFont::serial, tr("Serial Devices"), (char *)"Serial Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("Serial Devices"), (char *)"Serial Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SerialSettingsTabLabel);
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog2::AddYeelightSettingsPage()
|
||||
@@ -871,10 +995,21 @@ 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(OpenRGBFont::bulb, tr("Yeelight Devices"), (char *)"Yeelight Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("Yeelight Devices"), (char *)"Yeelight Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -888,10 +1023,21 @@ 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(OpenRGBFont::bulb, tr("Nanoleaf Devices"), (char *)"Nanoleaf Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, tr("Nanoleaf Devices"), (char *)"Nanoleaf Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
@@ -905,20 +1051,51 @@ 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(OpenRGBFont::bulb, tr("Elgato KeyLight Devices"), (char *)"Elgato KeyLight Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, 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 |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* PluginTabLabel = new TabLabel(OpenRGBFont::extension, QString::fromStdString(plugin->info.Label), (char *)plugin->info.Label.c_str(), (char *)context);
|
||||
PluginTabLabel = (QLabel*)new TabLabel(PluginLabelString, QString::fromStdString(plugin->info.Label), (char *)plugin->info.Label.c_str(), (char *)context);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Place plugin as its own top level tab |
|
||||
@@ -1088,10 +1265,21 @@ 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(OpenRGBFont::toolbox, tr("SMBus Tools"), (char *)"SMBus Tools", (char *)context);
|
||||
TabLabel* SMBusToolsTabLabel = new TabLabel(SMBusToolsLabelString, tr("SMBus Tools"), (char *)"SMBus Tools", (char *)context);
|
||||
|
||||
ui->InformationTabBar->tabBar()->setTabButton(ui->InformationTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SMBusToolsTabLabel);
|
||||
}
|
||||
@@ -1212,7 +1400,7 @@ void OpenRGBDialog2::UpdateDevicesList()
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* NewTabLabel = new TabLabel(GetIcon(controllers[controller_idx]->type), QString::fromStdString(controllers[controller_idx]->name), (char *)controllers[controller_idx]->name.c_str(), (char *)context);
|
||||
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);
|
||||
|
||||
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));
|
||||
@@ -1263,7 +1451,7 @@ void OpenRGBDialog2::UpdateDevicesList()
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* NewTabLabel = new TabLabel(GetIcon(controllers[controller_idx]->type), QString::fromStdString(controllers[controller_idx]->name), (char *)controllers[controller_idx]->name.c_str(), (char *)context);
|
||||
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);
|
||||
|
||||
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));
|
||||
@@ -1881,10 +2069,21 @@ 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(OpenRGBFont::terminal, tr("Log Console"), (char *)"Log Console", (char *)context);
|
||||
TabLabel* ConsoleTabLabel = new TabLabel(ConsoleLabelString, tr("Log Console"), (char *)"Log Console", (char *)context);
|
||||
|
||||
ui->InformationTabBar->tabBar()->setTabButton(ui->InformationTabBar->tabBar()->count() - 1, QTabBar::LeftSide, ConsoleTabLabel);
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
#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;
|
||||
}
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
#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
|
||||
@@ -31,16 +31,11 @@ int Ui::OpenRGBHardwareIDsDialog::show()
|
||||
\*---------------------------------------------------------*/
|
||||
std::vector<i2c_smbus_interface*> i2CBusses = ResourceManager::get()->GetI2CBusses();
|
||||
|
||||
// The widget takes control over items after creation
|
||||
QTreeWidgetItem* i2c_top = new QTreeWidgetItem(ui->HardwareIdsList, {"i2c busses"});
|
||||
strings.push_back("[ 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);
|
||||
}
|
||||
@@ -54,8 +49,7 @@ int Ui::OpenRGBHardwareIDsDialog::show()
|
||||
hid_device_info* current_hid_device;
|
||||
current_hid_device = hid_devices;
|
||||
|
||||
QTreeWidgetItem* hid_top = new QTreeWidgetItem(ui->HardwareIdsList, {"HID devices"});
|
||||
strings.push_back("\n[ i2c devices ]");
|
||||
strings.push_back("HID devices");
|
||||
|
||||
while(current_hid_device)
|
||||
{
|
||||
@@ -64,12 +58,9 @@ int Ui::OpenRGBHardwareIDsDialog::show()
|
||||
|
||||
char line[550];
|
||||
|
||||
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);
|
||||
|
||||
strings.push_back(line);
|
||||
current_hid_device = current_hid_device->next;
|
||||
}
|
||||
|
||||
@@ -78,8 +69,7 @@ int Ui::OpenRGBHardwareIDsDialog::show()
|
||||
\*---------------------------------------------------------*/
|
||||
libusb_device** devices = nullptr;
|
||||
|
||||
QTreeWidgetItem* libusb_top = new QTreeWidgetItem(ui->HardwareIdsList, {"LibUSB devices"});
|
||||
strings.push_back("\n[ LibUSB devices ]");
|
||||
strings.push_back("LibUSB devices");
|
||||
|
||||
int ret;
|
||||
|
||||
@@ -112,8 +102,7 @@ int Ui::OpenRGBHardwareIDsDialog::show()
|
||||
}
|
||||
|
||||
char line[512];
|
||||
snprintf(line, 512, "%04X:%04X", descriptor.idVendor, descriptor.idProduct);
|
||||
new QTreeWidgetItem(libusb_top, {line});
|
||||
sprintf(line, "%04X:%04X", descriptor.idVendor, descriptor.idProduct);
|
||||
strings.push_back(line);
|
||||
}
|
||||
|
||||
@@ -122,6 +111,8 @@ int Ui::OpenRGBHardwareIDsDialog::show()
|
||||
libusb_free_device_list(devices, 1);
|
||||
}
|
||||
|
||||
ui->HardwareIdsList->addItems(strings);
|
||||
|
||||
return this->exec();
|
||||
}
|
||||
|
||||
@@ -11,9 +11,12 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Hardware IDs</string>
|
||||
<string>Form</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">
|
||||
@@ -21,25 +24,6 @@
|
||||
</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/>
|
||||
@@ -1,21 +1,13 @@
|
||||
#include "TabLabel.h"
|
||||
#include <QFontMetrics>
|
||||
#include "OpenRGBFont.h"
|
||||
|
||||
Ui::TabLabel::TabLabel(int icon, QString name, char* original, char* context) :
|
||||
Ui::TabLabel::TabLabel(QString icon, QString name, char* original, char* context) :
|
||||
QWidget(nullptr),
|
||||
ui(new Ui::TabLabelUi)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QFont font = OpenRGBFont::GetFont();
|
||||
font.setPointSize(18);
|
||||
|
||||
ui->icon->setFont(font);
|
||||
ui->icon->setText(OpenRGBFont::icon(icon));
|
||||
|
||||
ui->icon->setText("<img src=':/" + icon + "' height='16' width='16' />");
|
||||
ui->name->setText(name);
|
||||
|
||||
label = original;
|
||||
ctxt = context;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class Ui::TabLabel : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TabLabel(int icon, QString name, char* original, char* context);
|
||||
TabLabel(QString icon, QString name, char* original, char* context);
|
||||
~TabLabel();
|
||||
|
||||
private:
|
||||
|
||||
@@ -47,6 +47,18 @@
|
||||
</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>
|
||||
@@ -101,3 +113,4 @@
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 103 B |
|
After Width: | Height: | Size: 226 B |
|
After Width: | Height: | Size: 218 B |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 109 B |
|
After Width: | Height: | Size: 116 B |
|
After Width: | Height: | Size: 164 B |
|
After Width: | Height: | Size: 168 B |
|
After Width: | Height: | Size: 144 B |
|
After Width: | Height: | Size: 159 B |
|
After Width: | Height: | Size: 131 B |