Compare commits

...
Author SHA1 Message Date
Adam Honse 1177e9fa68 OpenRGB version 0.4 2020-09-09 01:05:11 -05:00
Adam Honse 91b139987f Undo Corsair mouse LED change as the zones differ between mice 2020-09-08 17:48:22 -05:00
Adam Honse 72233ffed6 Add Corsair Sabre RGB 2020-09-08 12:37:59 -05:00
Adam Honse bc31490085 Start labeling Corsair mouse LEDs 2020-09-08 12:22:01 -05:00
Adam Honse fa4d330933 Fix LED name on HyperX Pulsefire Surge 2020-09-08 11:55:10 -05:00
Adam Honse 346beed0eb Standardize common mouse zone/LED names 2020-09-08 11:51:26 -05:00
Adam Honse e74faeb6be Rename Static mode to Direct mode for RGB Fusion 2 SMBus 2020-09-08 11:38:35 -05:00
Adam Honse 70c51abff7 Change order of HyperX DRAM so that sticks are in order 2020-09-08 02:11:28 -05:00
Adam Honse d2ebd167b3 Don't update Polychrome LEDs when the active mode doesn't require an update 2020-09-08 01:42:46 -05:00
TheRogueZeta a605d5581a Update zones on mode update
Minor cleanup, logic tweak to only update per-zone modes for Polychrome V1 by Adam Honse <[email protected]>
2020-09-07 16:36:26 -05:00
TheRogueZeta 759e09b3a3 Rework Polychrome v1 to be separate from ASRLED/V2
Code cleanup and some register name changes by Adam Honse <[email protected]>
2020-09-07 16:27:52 -05:00
Adam Honse a8b3279c1d Add X470 Aorus Gaming 7 Wifi 2020-09-07 13:14:20 -05:00
TheRogueZeta 3f2b925dd0 Update remaining controlers 2020-09-07 03:09:49 -05:00
TheRogueZeta 0cab595ef6 Fix G PRO speed slider. 2020-09-07 03:05:29 -05:00
Adam Honse 1a946268ba Update detection list for RGB Fusion 2 SMBus 2020-09-06 15:24:20 -05:00
Adam Honse 1f1548929d Use working directory for all file accesses, some old file accesses always used the executable directory 2020-09-06 12:56:20 -05:00
Adam Honse 3e62c91ed3 Add location to Polychrome controller 2020-09-06 12:44:34 -05:00
Adam Honse 9be25d1ca4 Make zone LED count a char as it can only be up to 0xFF 2020-09-06 12:25:52 -05:00
k1-801 290fddaf55 Fix incorrect font color detection for DeviceView (threshold 50) 2020-09-06 02:36:53 -05:00
Adam Honse 8823e28fa0 Call update device list callback after detection is finished 2020-09-06 02:29:22 -05:00
k1-801 ec77c658f2 Rudimentary rescanning implemented but button for it not added due to SDK conflicts. Stop detection button.
Commit amended by Adam Honse <[email protected]>
2020-09-06 01:37:16 -05:00
Adam Honse be84a60af6 More Polychrome V1 changes, set LED selection register for ASRLED/Polychrome V1 2020-09-05 02:00:56 -05:00
Adam Honse e40617e417 Set LED select register for Polychrome V1 2020-09-05 01:33:18 -05:00
Adam Honse 7556a2872c Rework LED handling for Polychrome V1 2020-09-05 01:13:38 -05:00
TheRogueZeta 7ccb3cd9e6 Fix reversed G PRO modes 2020-09-04 11:49:23 -05:00
TheRogueZeta cbf867c0ee Change zone name and move Polychrome_V1 2020-09-04 11:33:03 -05:00
Adam Honse b7ee237fbf Add Razer Cynosa Chroma keymap and add ISO keys to other Razer layouts 2020-09-03 16:21:29 -05:00
Adam Honse 0345eb582b More warning fixes 2020-09-02 19:03:43 -05:00
Adam Honse f568253c51 Clean up more warnings 2020-09-02 18:25:58 -05:00
Adam Honse 2251feb701 Add AUMA0-E8K4-0101 Aura SMBus controller as a V2 register device 2020-09-02 09:45:50 -05:00
k1-801 8b8451017e Non-important warnings removed
Commit amended by Adam Honse <[email protected]> due to merging from a different branch.
2020-09-01 23:29:00 -05:00
Adam Honse 94c18fc9b4 Change less than or equal to less than. This shouldn't change anything, but it seems the Media Next key has issues as it was and this fixes that 2020-08-31 23:30:29 -05:00
TheRogueZeta f741cb7c6b Add Logitech Powerplay mat and add speed opt GPW 2020-08-31 23:06:51 -05:00
TheRogueZeta d19b5bc87d Update Logitech Lighspeed nameing and openrgb.rule 2020-08-31 22:41:10 -05:00
Carson Mathre 319f19e65d Update RGBController/RGBController_Tecknet.cpp 2020-08-31 17:30:21 -05:00
Adam Honse ad97bf8c08 Rename Key: Cal to Key: Calculator on Ducky keyboard controller 2020-08-31 14:16:33 -05:00
Adam Honse 835a007445 Draw color wheel with transparent background rather than by pulling background color from palette, as it didn't always get the background the right color 2020-08-31 11:17:59 -05:00
k1-801 66fd8ab394 Dark theme icons 2020-08-31 09:35:35 -05:00
Adam Honse 9407ef7f4d Add X470 AORUS GAMING 5 WIFI to RGB Fusion 2 SMBus supported motherboard list 2020-08-31 08:29:37 -05:00
Adam Honse fb420b3928 Add X470 AORUS ULTRA GAMING to RGB Fusion 2 SMBus detection list 2020-08-30 18:01:33 -05:00
Adam Honse bc3e351f26 Add X470 AORUS ULTRA GAMING-CF to RGB Fusion 2 SMBus detection list 2020-08-30 17:13:54 -05:00
Adam Honse edbccc345f Change LED configuration offset for AUDA0-E6K5-0101 Aura SMBus controller 2020-08-30 17:06:54 -05:00
Adam Honse db3c3e9fb1 Use DMI information to detect RGB Fusion 2 SMBus controller. Only one board added for now. 2020-08-30 16:30:47 -05:00
Adam Honse 6af7324840 Fix missing comma in Ducky key name list 2020-08-30 15:25:04 -05:00
Adam Honse 640f7c7cde Add keymap to Ducky keyboard controller 2020-08-30 15:13:16 -05:00
Adam Honse 37224a6c4d Add support for ASRock Polychrome addressable header as a single LED zone 2020-08-30 14:24:37 -05:00
Adam Honse 6235bcb2b4 Update README 2020-08-30 13:24:59 -05:00
122 changed files with 1851 additions and 604 deletions
+13 -4
View File
@@ -142,25 +142,34 @@ SUBSYSTEMS=="usb", ATTR{idVendor}=="0951", ATTR{idProduct}=="16be", TAG+="uacces
# #
# Mice: #
# Logitech G203 Prodigy #
# Logitech G203 Lightsync #
# Logitech G403 Prodigy #
# Logitech G403 Hero #
# Logitech G502 Proteus Spectrum #
# Logitech G502 Lightspeed with Powerplay Mousepad #
# Logitech G Lightspeed Wireless Gaming Mouse #
# Logitech G Pro Wireless Gaming Mouse (Wired) #
# Logitech G Powerplay Mousepad with Lightspeed #
# #
# Keyboards: #
# Logitech G512 #
# Logitech G512 RGB #
# Logitech G Pro Wireless Gaming Mouse Lightspeed #
# Logitech G Pro Wireless Gaming Mouse (Wired) #
# Logitech G810 #1 #
# Logitech G810 #2 #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c084", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c092", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c083", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c08f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c332", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c33c", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c539", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c088", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c53a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c342", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c33c", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c337", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c331", TAG+="uaccess"
#---------------------------------------------------------------#
# MSI Mysticlight #
#---------------------------------------------------------------#
@@ -24,7 +24,7 @@ ATC800Controller::~ATC800Controller()
void ATC800Controller::SendCoolerMode
(
unsigned char mode,
unsigned short speed,
unsigned short /*speed*/,
unsigned char channel,
unsigned char red,
unsigned char green,
@@ -43,7 +43,7 @@ void DetectAorusCPUCoolerControllers(std::vector<RGBController*>& rgb_controller
{
hid_init();
for(int device_idx = 0; device_idx < NUM_DEVICES; device_idx++)
for(unsigned int device_idx = 0; device_idx < NUM_DEVICES; device_idx++)
{
hid_device_info* info = hid_enumerate(device_list[device_idx].usb_vid, device_list[device_idx].usb_pid);
@@ -10,6 +10,21 @@
#include "AuraSMBusController.h"
#include <cstring>
static const char* aura_channels[] = /* Aura channel strings */
{
"Audio",
"Backplate",
"Back I/O",
"Center",
"Center",
"DRAM",
"PCIe",
"RGB Header",
"RGB Header 2",
"RGB Header",
"Unknown",
};
AuraSMBusController::AuraSMBusController(i2c_smbus_interface* bus, aura_dev_id dev)
{
this->bus = bus;
@@ -45,7 +60,7 @@ AuraSMBusController::AuraSMBusController(i2c_smbus_interface* bus, aura_dev_id d
{
direct_reg = AURA_REG_COLORS_DIRECT_V2;
effect_reg = AURA_REG_COLORS_EFFECT_V2;
channel_cfg = AURA_CONFIG_CHANNEL_V2;
channel_cfg = AURA_CONFIG_CHANNEL_V1;
}
// AUMA0-E6K5-0106 - Second generation motherboard controller
else if (strcmp(device_name, "AUMA0-E6K5-0106") == 0)
@@ -68,6 +83,13 @@ AuraSMBusController::AuraSMBusController(i2c_smbus_interface* bus, aura_dev_id d
effect_reg = AURA_REG_COLORS_EFFECT_V2;
channel_cfg = AURA_CONFIG_CHANNEL_V2;
}
// AUMA0-E8K4-0101 - Second generation motherboard controller
else if (strcmp(device_name, "AUMA0-E8K4-0101") == 0)
{
direct_reg = AURA_REG_COLORS_DIRECT_V2;
effect_reg = AURA_REG_COLORS_EFFECT_V2;
channel_cfg = AURA_CONFIG_CHANNEL_V2;
}
// Assume first generation controller if string does not match
else
{
@@ -66,21 +66,6 @@ enum
AURA_LED_CHANNEL_RGB_HEADER_3 = 0x91, /* RGB Header 3 LED channel */
};
static const char* aura_channels[] = /* Aura channel strings */
{
"Audio",
"Backplate",
"Back I/O",
"Center",
"Center",
"DRAM",
"PCIe",
"RGB Header",
"RGB Header 2",
"RGB Header",
"Unknown",
};
enum
{
AURA_CONFIG_LED_COUNT = 0x02, /* LED Count configuration offset */
@@ -40,7 +40,7 @@ void AuraAddressableController::SetChannelLEDs(unsigned char channel, RGBColor *
leds_to_send = num_colors - leds_sent;
}
for(int led_idx = 0; led_idx < leds_to_send; led_idx++)
for(unsigned int led_idx = 0; led_idx < leds_to_send; led_idx++)
{
led_data[(led_idx * 3) + 0] = RGBGetRValue(colors[led_idx + leds_sent]);
led_data[(led_idx * 3) + 1] = RGBGetGValue(colors[led_idx + leds_sent]);
@@ -44,7 +44,7 @@ void AuraMainboardController::SetChannelLEDs(unsigned char channel, RGBColor * c
leds_to_send = num_colors - leds_sent;
}
for(int led_idx = 0; led_idx < leds_to_send; led_idx++)
for(unsigned int led_idx = 0; led_idx < leds_to_send; led_idx++)
{
led_data[(led_idx * 3) + 0] = RGBGetRValue(colors[led_idx + leds_sent]);
led_data[(led_idx * 3) + 1] = RGBGetGValue(colors[led_idx + leds_sent]);
@@ -9,18 +9,38 @@
#include "CMMP750Controller.h"
static unsigned char colour_mode_data[][6] =
{
{ 0x01, 0x04, 0xFF, 0x00, 0xFF, 0x00 }, /* Static */
{ 0x02, 0x04, 0xFF, 0x00, 0xFF, 0x80 }, /* Blinking */
{ 0x03, 0x04, 0xFF, 0x00, 0xFF, 0x80 }, /* Breathing */
{ 0x04, 0x04, 0x80, 0x00, 0x00, 0x00 }, /* Colour Cycle */
{ 0x05, 0x04, 0x80, 0x00, 0x00, 0x00 } /* Colour Breath */
};
static unsigned char speed_mode_data[][9] =
{
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },/* Static */
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Blinking */
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Breathing */
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Colour Cycle */
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 } /* Colour Breath */
};
CMMP750Controller::CMMP750Controller(hid_device* dev_handle, wchar_t *_vendor, wchar_t *_device_name, char *_path)
{
int tmp_size = wcslen(_vendor);
dev = dev_handle;
location = _path;
std::size_t tmp_size = wcslen(_vendor);
dev = dev_handle;
location = _path;
for (int i=0; ( i<tmp_size && i<CM_DEVICE_NAME_SIZE); i++)
for(std::size_t i = 0; (i < tmp_size) && (i < CM_DEVICE_NAME_SIZE); i++)
{
device_name[i] = (char)_vendor[i];
}
for (int j=0; ( j<wcslen(_vendor) && tmp_size+j<CM_DEVICE_NAME_SIZE); j++)
device_name[tmp_size+j] = (char)_device_name[j];
for(std::size_t j = 0; (j < wcslen(_vendor)) && (tmp_size + j < CM_DEVICE_NAME_SIZE); j++)
{
device_name[tmp_size + j] = (char)_device_name[j];
}
GetStatus(); //When setting up device get current status
}
@@ -39,20 +59,22 @@ void CMMP750Controller::GetStatus()
hid_write(dev, buffer, buffer_size);
hid_read(dev, buffer, buffer_size);
if( buffer[0] == 0x80 && buffer[1] == 0x05 )
if((buffer[0] == 0x80) && (buffer[1] == 0x05))
{
current_mode = buffer[2] - 1;
current_red = buffer[3];
current_green = buffer[4];
current_blue = buffer[5];
for( int i = 0; speed_mode_data[current_mode][i] >= buffer[6]; i++)
for(int i = 0; speed_mode_data[current_mode][i] >= buffer[6]; i++)
{
current_speed = i;
}
}
else
{
//Code should never reach here however just in case there is a failure set something
current_mode = MP750_MODE_COLOR_CYCLE; //Unicorn Spew
current_mode = MP750_MODE_COLOR_CYCLE; //Unicorn Spew
current_red = 0xFF;
current_green = 0xFF;
current_blue = 0xFF;
@@ -122,7 +144,7 @@ void CMMP750Controller::SendUpdate()
unsigned char buffer[0x40] = { 0x00 };
int buffer_size = (sizeof(buffer) / sizeof(buffer[0]));
for(int i = 0; i < CM_COLOUR_MODE_DATA_SIZE; i++)
for(std::size_t i = 0; i < CM_COLOUR_MODE_DATA_SIZE; i++)
{
buffer[i] = colour_mode_data[current_mode][i];
}
@@ -130,16 +152,16 @@ void CMMP750Controller::SendUpdate()
if(current_mode > MP750_MODE_BREATHING)
{
//If the mode is random colours set SPEED at BYTE2
buffer[CM_RED_BYTE] = speed_mode_data[current_mode][current_speed];
buffer[CM_RED_BYTE] = speed_mode_data[current_mode][current_speed];
}
else
{
//Otherwise SPEED is BYTE5
buffer[CM_RED_BYTE] = current_red;
buffer[CM_GREEN_BYTE] = current_green;
buffer[CM_BLUE_BYTE] = current_blue;
buffer[CM_SPEED_BYTE] = speed_mode_data[current_mode][current_speed];
buffer[CM_RED_BYTE] = current_red;
buffer[CM_GREEN_BYTE] = current_green;
buffer[CM_BLUE_BYTE] = current_blue;
buffer[CM_SPEED_BYTE] = speed_mode_data[current_mode][current_speed];
}
hid_write(dev, buffer, buffer_size);
}
}
@@ -44,24 +44,6 @@ enum
MP750_MODE_BREATH_CYCLE = 0x04 //Breathing Cycle Mode
};
static unsigned char colour_mode_data[][6] =
{
{ 0x01, 0x04, 0xFF, 0x00, 0xFF, 0x00 }, /* Static */
{ 0x02, 0x04, 0xFF, 0x00, 0xFF, 0x80 }, /* Blinking */
{ 0x03, 0x04, 0xFF, 0x00, 0xFF, 0x80 }, /* Breathing */
{ 0x04, 0x04, 0x80, 0x00, 0x00, 0x00 }, /* Colour Cycle */
{ 0x05, 0x04, 0x80, 0x00, 0x00, 0x00 } /* Colour Breath */
};
static unsigned char speed_mode_data[][9] =
{
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },/* Static */
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Blinking */
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Breathing */
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Colour Cycle */
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 } /* Colour Breath */
};
enum
{
MP750_SPEED_SLOWEST = 0x00, /* Slowest speed */
@@ -44,7 +44,7 @@ void DetectCoolerMasterControllers(std::vector<RGBController*>& rgb_controllers)
hid_device* dev = NULL;
if(info->vendor_id == COOLERMASTER_VID)
{
for(int cm_pid_idx = 0; cm_pid_idx < COOLERMASTER_NUM_DEVICES; cm_pid_idx++)
for(unsigned int cm_pid_idx = 0; cm_pid_idx < COOLERMASTER_NUM_DEVICES; cm_pid_idx++)
{
if((info->product_id == cm_pids[cm_pid_idx][CM_PID])
&&(info->interface_number == cm_pids[cm_pid_idx][CM_INTERFACE]))
@@ -46,6 +46,7 @@
#define CORSAIR_M65_PRO_PID 0x1B2E
#define CORSAIR_M65_RGB_ELITE_PID 0x1B5A
#define CORSAIR_SCIMITAR_PRO_RGB_PID 0x1B3E
#define CORSAIR_SABRE_RGB_PID 0x1B2F
/*-----------------------------------------------------*\
| Mousepad product IDs |
@@ -98,6 +99,7 @@ static const corsair_node_device device_list[] =
{ CORSAIR_VID, CORSAIR_M65_PRO_PID, 1, "Corsair M65 PRO" },
{ CORSAIR_VID, CORSAIR_M65_RGB_ELITE_PID, 1, "Corsair M65 RGB Elite" },
{ CORSAIR_VID, CORSAIR_SCIMITAR_PRO_RGB_PID, 1, "Corsair Scimitar PRO RGB" },
{ CORSAIR_VID, CORSAIR_SABRE_RGB_PID, 1, "Corsair Sabre RGB" },
/*-----------------------------------------------------------------------------------------------------*\
| Mousemats |
\*-----------------------------------------------------------------------------------------------------*/
+43 -8
View File
@@ -9,25 +9,60 @@
#include "EKController.h"
static unsigned char colour_mode_data[][16] =
{
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x01, 0x00, 0xFF, 0x64}, // Static
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x02, 0x00, 0xFF, 0x64}, // Breathing
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x03, 0xFF, 0xFF, 0x64}, // Fading
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x04, 0x00, 0xFF, 0x64}, // Marquee
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x05, 0x00, 0xFF, 0x64}, // Covering Marquee
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x06, 0x00, 0xFF, 0x64}, // Pulse
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x07, 0x00, 0xFF, 0x64}, // Wave
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x08, 0x00, 0xFF, 0x64}, // Alternating
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x09, 0x00, 0xFF, 0x64}, // Candle
};
static unsigned char speed_mode_data[][9] =
{
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // Static
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Breathing
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Fading
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Marquee
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Covering Marquee
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Pulse
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Wave
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Alternating
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 } // Candle
};
EKController::EKController(hid_device* dev_handle, wchar_t *_vendor, wchar_t *_device_name, char *_path)
{
int tmp_size = wcslen(_vendor);
std::size_t tmp_size = wcslen(_vendor);
dev = dev_handle;
for(int i=0; (i < tmp_size) && (i < EK_DEVICE_NAME_SIZE); i++)
for(std::size_t i = 0; (i < tmp_size) && (i < EK_DEVICE_NAME_SIZE); i++)
{
device_name[i] = (char)_vendor[i];
}
for(int j=0; (j < wcslen(_vendor)) && ((tmp_size + j) < EK_DEVICE_NAME_SIZE); j++)
for(std::size_t j = 0; (j < wcslen(_vendor)) && ((tmp_size + j) < EK_DEVICE_NAME_SIZE); j++)
{
device_name[tmp_size+j] = (char)_device_name[j];
device_name[tmp_size + j] = (char)_device_name[j];
}
location = _path;
current_mode = EK_MODE_STATIC;
current_mode = EK_MODE_STATIC;
current_speed = EK_SPEED_NORMAL;
}
@@ -76,15 +111,15 @@ void EKController::SendUpdate()
unsigned char buffer[EK_PACKET_LENGTH] = { 0x00 };
int buffer_size = (sizeof(buffer) / sizeof(buffer[0]));
for(int i = 0; i < EK_COLOUR_MODE_DATA_SIZE; i++)
for(std::size_t i = 0; i < EK_COLOUR_MODE_DATA_SIZE; i++)
{
buffer[i] = colour_mode_data[current_mode][i];
}
//Set the relevant colour info
buffer[EK_RED_BYTE] = current_red;
buffer[EK_RED_BYTE] = current_red;
buffer[EK_GREEN_BYTE] = current_green;
buffer[EK_BLUE_BYTE] = current_blue;
buffer[EK_BLUE_BYTE] = current_blue;
buffer[EK_SPEED_BYTE] = speed_mode_data[current_mode][current_speed];
buffer[10] = 0x10;
-35
View File
@@ -39,41 +39,6 @@ enum
EK_MODE_CANDLE = 0x08 //Candle Mode
};
static unsigned char colour_mode_data[][16] =
{
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x01, 0x00, 0xFF, 0x64}, // Static
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x02, 0x00, 0xFF, 0x64}, // Breathing
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x03, 0xFF, 0xFF, 0x64}, // Fading
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x04, 0x00, 0xFF, 0x64}, // Marquee
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x05, 0x00, 0xFF, 0x64}, // Covering Marquee
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x06, 0x00, 0xFF, 0x64}, // Pulse
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x07, 0x00, 0xFF, 0x64}, // Wave
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x08, 0x00, 0xFF, 0x64}, // Alternating
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
0x00, 0x10, 0x20, 0x01, 0x09, 0x00, 0xFF, 0x64}, // Candle
};
static unsigned char speed_mode_data[][9] =
{
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // Static
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Breathing
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Fading
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Marquee
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Covering Marquee
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Pulse
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Wave
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Alternating
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 } // Candle
};
enum
{
EK_SPEED_SLOWEST = 0x00, // Slowest speed
@@ -42,7 +42,7 @@ void DetectEKControllers(std::vector<RGBController*>& rgb_controllers)
hid_device* dev = NULL;
if(info->vendor_id == EK_VID)
{
for(int ek_pid_idx = 0; ek_pid_idx < EK_NUM_DEVICES; ek_pid_idx++)
for(unsigned int ek_pid_idx = 0; ek_pid_idx < EK_NUM_DEVICES; ek_pid_idx++)
{
if((info->product_id == ek_pids[ek_pid_idx][EK_PID])
&&(info->interface_number == ek_pids[ek_pid_idx][EK_INTERFACE]))
@@ -37,7 +37,7 @@ void DetectHoltekControllers(std::vector<RGBController*>& rgb_controllers)
{
hid_init();
for(int device_idx = 0; device_idx < HOLTEK_NUM_DEVICES; device_idx++)
for(unsigned int device_idx = 0; device_idx < HOLTEK_NUM_DEVICES; device_idx++)
{
switch(device_list[device_idx].type)
{
@@ -188,8 +188,8 @@ enum
static const unsigned char slot_base[4] =
{
HYPERX_REG_SLOT0_LED0_RED, /* SPD 0x50 maps to slot 0 */
HYPERX_REG_SLOT1_LED0_RED, /* SPD 0x51 maps to slot 1 */
HYPERX_REG_SLOT2_LED0_RED, /* SPD 0x52 maps to slot 2 */
HYPERX_REG_SLOT2_LED0_RED, /* SPD 0x51 maps to slot 2 */
HYPERX_REG_SLOT1_LED0_RED, /* SPD 0x52 maps to slot 1 */
HYPERX_REG_SLOT3_LED0_RED /* SPD 0x53 maps to slot 3 */
};
@@ -116,7 +116,7 @@ void HyperXAlloyOriginsController::SendDirectColorPacket
/*-----------------------------------------------------*\
| Copy in color data |
\*-----------------------------------------------------*/
for(int color_idx = 0; color_idx < color_count; color_idx++)
for(unsigned int color_idx = 0; color_idx < color_count; color_idx++)
{
buf[(color_idx * 4) + 1] = 0x81;
buf[(color_idx * 4) + 2] = RGBGetRValue(color_data[color_idx]);
@@ -128,4 +128,4 @@ void HyperXAlloyOriginsController::SendDirectColorPacket
| Send packet |
\*-----------------------------------------------------*/
hid_send_feature_report(dev, buf, 65);
}
}
@@ -401,7 +401,7 @@ void HyperXKeyboardController::SendExtendedColor
/*-----------------------------------------------------*\
| Fill in color data |
\*-----------------------------------------------------*/
for(int i = 0x08; i <= 0x93; i++)
for(int i = 0x08; i < 0x94; i++)
{
buf[i] = color_data[i];
}
@@ -470,7 +470,7 @@ void HyperXKeyboardController::SendDirectExtended
/*-----------------------------------------------------*\
| Fill in color data |
\*-----------------------------------------------------*/
for(int i = 0x08; i <= 0x93; i++)
for(int i = 0x08; i < 0x94; i++)
{
buf[i] = color_data[i];
}
@@ -72,7 +72,7 @@ void HyperXPulsefireSurgeController::SetProfileBrightness
buf[0x03] = 0x01;
buf[0x04] = 0x01;
buf[0x05] = 0x01;
buf[0x06] = 0x64;
buf[0x06] = brightness;
/*-----------------------------------------------------*\
| Send packet |
@@ -30,24 +30,11 @@ void DetectLEDStripControllers(std::vector<RGBController*> &rgb_controllers)
LEDStripController* new_ledstrip;
RGBController_LEDStrip* new_controller;
//Get file path in executable directory
std::ifstream infile;
char filename[2048];
char arg1[64];
#ifdef WIN32
GetModuleFileName(NULL, filename, 2048);
strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str());
strcat(filename, "\\ledstrip.txt");
#else
snprintf(arg1, 64, "/proc/%d/exe", getpid());
readlink(arg1, filename, 1024);
strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str());
strcat(filename, "/ledstrip.txt");
#endif
//Open settings file
infile.open(filename);
infile.open("ledstrip.txt");
if (infile.good())
{
@@ -5,6 +5,7 @@
#include "LogitechG502PSController.h"
#include "LogitechG810Controller.h"
#include "LogitechGProWirelessController.h"
#include "LogitechGPowerPlayController.h"
#include "RGBController.h"
#include "RGBController_LogitechG203.h"
#include "RGBController_LogitechG203L.h"
@@ -12,6 +13,7 @@
#include "RGBController_LogitechG502PS.h"
#include "RGBController_LogitechG810.h"
#include "RGBController_LogitechGProWireless.h"
#include "RGBController_LogitechGPowerPlay.h"
#include <vector>
#include <hidapi/hidapi.h>
@@ -35,9 +37,9 @@
#define LOGITECH_G403H_PID 0xC08F
#define LOGITECH_G502_PS_PID 0xC332
#define LOGITECH_G502H_PID 0xC08B
#define LOGITECH_GPRO_WIRELESS_LIGHTSPEED_PID 0xC539
#define LOGITECH_G_LIGHTSPEED_WIRELESS_PID 0xC539
#define LOGITECH_GPRO_WIRELESS_PID 0xC088
#define LOGITECH_G502_LIGHTSPEED_POWERPLAY_PID 0xC53A
#define LOGITECH_G_LIGHTSPEED_POWERPLAY_PID 0xC53A
typedef struct
{
@@ -68,9 +70,9 @@ static const logitech_device device_list[] =
{ LOGITECH_VID, LOGITECH_G403H_PID, 1, DEVICE_TYPE_MOUSE, "Logitech G403 Hero" },
{ LOGITECH_VID, LOGITECH_G502_PS_PID, 1, DEVICE_TYPE_MOUSE, "Logitech G502 Proteus Spectrum" },
{ LOGITECH_VID, LOGITECH_G502H_PID, 1, DEVICE_TYPE_MOUSE, "Logitech G502 Hero" },
{ LOGITECH_VID, LOGITECH_GPRO_WIRELESS_LIGHTSPEED_PID, 2, DEVICE_TYPE_MOUSE, "Logitech G Pro Wireless Gaming Mouse" },
{ LOGITECH_VID, LOGITECH_G_LIGHTSPEED_WIRELESS_PID, 2, DEVICE_TYPE_MOUSE, "Logitech G Lightspeed Wireless Gaming Mouse" },
{ LOGITECH_VID, LOGITECH_GPRO_WIRELESS_PID, 2, DEVICE_TYPE_MOUSE, "Logitech G Pro Wireless Gaming Mouse (Wired)" },
{ LOGITECH_VID, LOGITECH_G502_LIGHTSPEED_POWERPLAY_PID, 2, DEVICE_TYPE_MOUSE, "Logitech G502 Lightspeed With Powerplay Mousepad" },
{ LOGITECH_VID, LOGITECH_G_LIGHTSPEED_POWERPLAY_PID, 2, DEVICE_TYPE_MOUSE, "Logitech G Powerplay Mousepad with Lightspeed" },
/*-------------------------------------------------------------------------------------------------------------------------------------------------*\
| Mousemats |
\*-------------------------------------------------------------------------------------------------------------------------------------------------*/
@@ -88,7 +90,7 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
{
hid_init();
for(int device_idx = 0; device_idx < LOGITECH_NUM_DEVICES; device_idx++)
for(unsigned int device_idx = 0; device_idx < LOGITECH_NUM_DEVICES; device_idx++)
{
switch(device_list[device_idx].type)
{
@@ -227,10 +229,9 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
rgb_controllers.push_back(rgb_controller);
}
break;
case LOGITECH_GPRO_WIRELESS_LIGHTSPEED_PID:
case LOGITECH_GPRO_WIRELESS_PID:
case LOGITECH_G502_LIGHTSPEED_POWERPLAY_PID:
case LOGITECH_G_LIGHTSPEED_WIRELESS_PID:
{
LogitechGProWirelessController* controller = new LogitechGProWirelessController(dev);
@@ -240,6 +241,25 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
rgb_controllers.push_back(rgb_controller);
}
break;
case LOGITECH_G_LIGHTSPEED_POWERPLAY_PID:
{
//Add mouse
LogitechGProWirelessController* mouse_controller = new LogitechGProWirelessController(dev);
RGBController_LogitechGProWireless* mouse_rgb_controller = new RGBController_LogitechGProWireless(mouse_controller);
mouse_rgb_controller->name = device_list[device_idx].name;
rgb_controllers.push_back(mouse_rgb_controller);
//Add Powerplay mousemat
LogitechGPowerPlayController* mousemat_controller = new LogitechGPowerPlayController(dev);
RGBController_LogitechGPowerPlay* mousemat_rgb_controller = new RGBController_LogitechGPowerPlay(mousemat_controller);
mousemat_rgb_controller->name = device_list[device_idx].name;
rgb_controllers.push_back(mousemat_rgb_controller);
}
break;
}
}
}
@@ -51,7 +51,7 @@ void LogitechG203Controller::SendMouseMode
usb_buf[0x07] = green;
usb_buf[0x08] = blue;
speed = 1000 + 4750 * (LOGITECH_G203_SPEED_FASTEST - speed);
speed = 100 * speed;
if(mode == LOGITECH_G203_MODE_CYCLE)
{
usb_buf[0x0B] = speed >> 8;
@@ -22,13 +22,15 @@ enum
LOGITECH_G203_MODE_BREATHING = 0x03,
};
/*---------------------------------------------------------------------------------------------*\
| Speed is 1000 for fast and 20000 for slow. |
| Values are mutipled by 100 later to give lots of GUI steps. |
\*---------------------------------------------------------------------------------------------*/
enum
{
LOGITECH_G203_SPEED_SLOWEST = 0x00, /* Slowest speed */
LOGITECH_G203_SPEED_SLOW = 0x01, /* Slow speed */
LOGITECH_G203_SPEED_NORMAL = 0x02, /* Normal speed */
LOGITECH_G203_SPEED_FAST = 0x03, /* Fast speed */
LOGITECH_G203_SPEED_FASTEST = 0x04, /* Fastest speed */
LOGITECH_G203_SPEED_SLOWEST = 0xC8, /* Slowest speed */
LOGITECH_G203_SPEED_NORMAL = 0x32, /* Normal speed */
LOGITECH_G203_SPEED_FASTEST = 0x0A, /* Fastest speed */
};
class LogitechG203Controller
@@ -53,7 +53,7 @@ void LogitechG403Controller::SendMouseMode
usb_buf[0x07] = green;
usb_buf[0x08] = blue;
speed = 1000 + 4750 * (LOGITECH_G403_SPEED_FASTEST - speed);
speed = 100 * speed;
if(mode == LOGITECH_G403_MODE_CYCLE)
{
usb_buf[0x0B] = speed >> 8;
@@ -22,13 +22,15 @@ enum
LOGITECH_G403_MODE_BREATHING = 0x03,
};
/*---------------------------------------------------------------------------------------------*\
| Speed is 1000 for fast and 20000 for slow. |
| Values are mutipled by 100 later to give lots of GUI steps. |
\*---------------------------------------------------------------------------------------------*/
enum
{
LOGITECH_G403_SPEED_SLOWEST = 0x00, /* Slowest speed */
LOGITECH_G403_SPEED_SLOW = 0x01, /* Slow speed */
LOGITECH_G403_SPEED_NORMAL = 0x02, /* Normal speed */
LOGITECH_G403_SPEED_FAST = 0x03, /* Fast speed */
LOGITECH_G403_SPEED_FASTEST = 0x04, /* Fastest speed */
LOGITECH_G403_SPEED_SLOWEST = 0xC8, /* Slowest speed */
LOGITECH_G403_SPEED_NORMAL = 0x32, /* Normal speed */
LOGITECH_G403_SPEED_FASTEST = 0x0A, /* Fastest speed */
};
class LogitechG403Controller
@@ -53,7 +53,7 @@ void LogitechG502PSController::SendMouseMode
usb_buf[0x07] = green;
usb_buf[0x08] = blue;
speed = 1000 + 4750 * (LOGITECH_G502_PS_SPEED_FASTEST - speed);
speed = 100 * speed;
if(mode == LOGITECH_G502_PS_MODE_CYCLE)
{
usb_buf[0x0B] = speed >> 8;
@@ -23,13 +23,15 @@ enum
LOGITECH_G502_PS_MODE_BREATHING = 0x02
};
/*---------------------------------------------------------------------------------------------*\
| Speed is 1000 for fast and 20000 for slow. |
| Values are mutipled by 100 later to give lots of GUI steps. |
\*---------------------------------------------------------------------------------------------*/
enum
{
LOGITECH_G502_PS_SPEED_SLOWEST = 0x00, /* Slowest speed */
LOGITECH_G502_PS_SPEED_SLOW = 0x01, /* Slow speed */
LOGITECH_G502_PS_SPEED_NORMAL = 0x02, /* Normal speed */
LOGITECH_G502_PS_SPEED_FAST = 0x03, /* Fast speed */
LOGITECH_G502_PS_SPEED_FASTEST = 0x04, /* Fastest speed */
LOGITECH_G502_PS_SPEED_SLOWEST = 0xC8, /* Slowest speed */
LOGITECH_G502_PS_SPEED_NORMAL = 0x32, /* Normal speed */
LOGITECH_G502_PS_SPEED_FASTEST = 0x0A, /* Fastest speed */
};
class LogitechG502PSController
@@ -0,0 +1,82 @@
/*-----------------------------------------*\
| LogitechGPowerPlayController.cpp |
| |
| Driver for Logitech G PowerPlay Wireless |
| Charging System |
| |
| TheRogueZeta 8/31/2020 |
\*-----------------------------------------*/
#include "LogitechGPowerPlayController.h"
#include <cstring>
LogitechGPowerPlayController::LogitechGPowerPlayController(hid_device* dev_handle)
{
dev = dev_handle;
}
LogitechGPowerPlayController::~LogitechGPowerPlayController()
{
hid_close(dev);
}
void LogitechGPowerPlayController::SendMouseMatMode
(
unsigned char mode,
std::uint16_t speed,
unsigned char zone,
unsigned char red,
unsigned char green,
unsigned char blue
// unsigned char brightness
)
{
unsigned char usb_buf[20];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, sizeof(usb_buf));
/*-----------------------------------------------------*\
| Set up Lighting Control packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x11;
usb_buf[0x01] = 0x07;
usb_buf[0x02] = 0x0B;
usb_buf[0x03] = 0x3E;
usb_buf[0x04] = zone;
usb_buf[0x05] = mode;
usb_buf[0x06] = red;
usb_buf[0x07] = green;
usb_buf[0x08] = blue;
speed = 100 * speed;
if(mode == LOGITECH_G_POWERPLAY_MODE_STATIC)
{
usb_buf[0x09] = 0x02;
}
if(mode == LOGITECH_G_POWERPLAY_MODE_CYCLE)
{
usb_buf[0x0B] = speed >> 8;
usb_buf[0x0C] = speed & 0xFF;
//usb_buf[0x0D] = brightness;
usb_buf[0x0D] = 0x64;
}
else if(mode == LOGITECH_G_POWERPLAY_MODE_BREATHING)
{
usb_buf[0x09] = speed >> 8;
usb_buf[0x0A] = speed & 0xFF;
//usb_buf[0x0C] = brightness;
usb_buf[0x0C] = 0x64;
}
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, usb_buf, 20);
hid_read(dev, usb_buf, 20);
}
@@ -0,0 +1,55 @@
/*-----------------------------------------*\
| LogitechGPowerPlayController.h |
| |
| Definitions and types for Logitech G |
| PowerPlay Wireless lighting controller |
| |
| TheRogueZeta 8/31/2020 |
\*-----------------------------------------*/
#include "RGBController.h"
#include <string>
#include <hidapi/hidapi.h>
#pragma once
enum
{
LOGITECH_G_POWERPLAY_MODE_OFF = 0x00,
LOGITECH_G_POWERPLAY_MODE_STATIC = 0x01,
LOGITECH_G_POWERPLAY_MODE_CYCLE = 0x02,
LOGITECH_G_POWERPLAY_MODE_BREATHING = 0x03,
};
/*---------------------------------------------------------------------------------------------*\
| Speed is 1000 for fast and 20000 for slow. |
| Values are mutipled by 100 later to give lots of GUI steps. |
\*---------------------------------------------------------------------------------------------*/
enum
{
LOGITECH_G_POWERPLAY_SPEED_SLOWEST = 0xC8, /* Slowest speed */
LOGITECH_G_POWERPLAY_SPEED_NORMAL = 0x32, /* Normal speed */
LOGITECH_G_POWERPLAY_SPEED_FASTEST = 0x0A, /* Fastest speed */
};
class LogitechGPowerPlayController
{
public:
LogitechGPowerPlayController(hid_device* dev_handle);
~LogitechGPowerPlayController();
void SendMouseMatMode
(
unsigned char mode,
unsigned short speed,
unsigned char zone,
unsigned char red,
unsigned char green,
unsigned char blue
// unsigned char brightness
);
private:
hid_device* dev;
};
@@ -54,7 +54,7 @@ void LogitechGProWirelessController::SendMouseMode
usb_buf[0x07] = green;
usb_buf[0x08] = blue;
speed = 1000 + 4750 * (LOGITECH_G_PRO_WIRELESS_SPEED_FASTEST - speed);
speed = 100 * speed;
if(mode == LOGITECH_G_PRO_WIRELESS_MODE_STATIC)
{
usb_buf[0x09] = 0x02;
@@ -22,13 +22,15 @@ enum
LOGITECH_G_PRO_WIRELESS_MODE_BREATHING = 0x03,
};
/*---------------------------------------------------------------------------------------------*\
| Speed is 1000 for fast and 20000 for slow. |
| Values are mutipled by 100 later to give lots of GUI steps. |
\*---------------------------------------------------------------------------------------------*/
enum
{
LOGITECH_G_PRO_WIRELESS_SPEED_SLOWEST = 0x00, /* Slowest speed */
LOGITECH_G_PRO_WIRELESS_SPEED_SLOW = 0x01, /* Slow speed */
LOGITECH_G_PRO_WIRELESS_SPEED_NORMAL = 0x02, /* Normal speed */
LOGITECH_G_PRO_WIRELESS_SPEED_FAST = 0x03, /* Fast speed */
LOGITECH_G_PRO_WIRELESS_SPEED_FASTEST = 0x04, /* Fastest speed */
{
LOGITECH_G_PRO_WIRELESS_SPEED_SLOWEST = 0xC8, /* Slowest speed */
LOGITECH_G_PRO_WIRELESS_SPEED_NORMAL = 0x32, /* Normal speed */
LOGITECH_G_PRO_WIRELESS_SPEED_FASTEST = 0x0A, /* Fastest speed */
};
class LogitechGProWirelessController
@@ -65,7 +65,7 @@ std::string NZXTHue2Controller::GetFirmwareVersion()
void NZXTHue2Controller::SendFan
(
unsigned char port,
unsigned char mode,
unsigned char /*mode*/,
unsigned char speed
)
{
@@ -120,7 +120,7 @@ void NZXTHue2Controller::UpdateDeviceList()
ret_val = hid_read(dev, usb_buf, sizeof(usb_buf));
} while( (ret_val != 64) || (usb_buf[0] != 0x21) || (usb_buf[1] != 0x03) );
for(int chan = 0; chan < num_rgb_channels; chan++)
for(unsigned int chan = 0; chan < num_rgb_channels; chan++)
{
unsigned int start = 0x0F + (6 * chan);
unsigned int num_leds_on_channel = 0;
@@ -179,7 +179,7 @@ void NZXTHue2Controller::UpdateStatus()
/*-----------------------------------------------------*\
| Extract fan information |
\*-----------------------------------------------------*/
for(int fan_idx = 0; fan_idx < num_fan_channels; fan_idx++)
for(unsigned int fan_idx = 0; fan_idx < num_fan_channels; fan_idx++)
{
unsigned char cmd;
unsigned short rpm;
@@ -19,7 +19,6 @@ PolychromeController::PolychromeController(i2c_smbus_interface* bus, polychrome_
unsigned short fw_version = ReadFirmwareVersion();
unsigned char major_version = fw_version >> 8;
unsigned char minor_version = fw_version & 0xFF;
/*-----------------------------------------------------*\
| Determine whether the device uses ASR LED or |
@@ -63,6 +62,16 @@ unsigned int PolychromeController::GetASRockType()
return(asrock_type);
}
std::string PolychromeController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
return_string.append(addr);
return(return_string);
}
std::string PolychromeController::GetDeviceName()
{
return(device_name);
@@ -81,7 +90,7 @@ unsigned short PolychromeController::ReadFirmwareVersion()
{
// The firmware register holds two bytes, so the first read should return 2
// If not, report invalid firmware revision FFFF
if (bus->i2c_smbus_read_byte_data(dev, POLYCHROME_REG_FIRMWARE_VER) == 0x02)
if (bus->i2c_smbus_read_byte_data(dev, ASROCK_REG_FIRMWARE_VER) == 0x02)
{
std::this_thread::sleep_for(1ms);
unsigned char major = bus->i2c_smbus_read_byte(dev);
@@ -98,20 +107,22 @@ unsigned short PolychromeController::ReadFirmwareVersion()
void PolychromeController::ReadLEDConfiguration()
{
// The LED configuration register holds 6 bytes, so the first read should return 6
// If not, set all zone sizes to zero
/*---------------------------------------------------------------------------------*\
| The LED configuration register holds 6 bytes, so the first read should return 6 |
| If not, set all zone sizes to zero |
\*---------------------------------------------------------------------------------*/
if (bus->i2c_smbus_read_byte_data(dev, POLYCHROME_REG_LED_CONFIG) == 0x06)
{
std::this_thread::sleep_for(1ms);
zone_led_count[POLYCHROME_ZONE_RGB_FAN_HDR] = bus->i2c_smbus_read_byte(dev);
zone_led_count[POLYCHROME_ZONE_1] = bus->i2c_smbus_read_byte(dev);
std::this_thread::sleep_for(1ms);
zone_led_count[POLYCHROME_ZONE_RGB_LED_HDR] = bus->i2c_smbus_read_byte(dev);
zone_led_count[POLYCHROME_ZONE_2] = bus->i2c_smbus_read_byte(dev);
std::this_thread::sleep_for(1ms);
zone_led_count[POLYCHROME_ZONE_AUDIO] = bus->i2c_smbus_read_byte(dev);
zone_led_count[POLYCHROME_ZONE_3] = bus->i2c_smbus_read_byte(dev);
std::this_thread::sleep_for(1ms);
zone_led_count[POLYCHROME_ZONE_PCH] = bus->i2c_smbus_read_byte(dev);
zone_led_count[POLYCHROME_ZONE_4] = bus->i2c_smbus_read_byte(dev);
std::this_thread::sleep_for(1ms);
zone_led_count[POLYCHROME_ZONE_IO_COVER] = bus->i2c_smbus_read_byte(dev);
zone_led_count[POLYCHROME_ZONE_5] = bus->i2c_smbus_read_byte(dev);
std::this_thread::sleep_for(1ms);
zone_led_count[POLYCHROME_ZONE_ADDRESSABLE] = bus->i2c_smbus_read_byte(dev);
}
@@ -134,13 +145,22 @@ void PolychromeController::SetColorsAndSpeed(unsigned char led, unsigned char re
switch(asrock_type)
{
case ASROCK_TYPE_ASRLED:
/*-----------------------------------------------------*\
| Select LED |
\*-----------------------------------------------------*/
if(active_mode != ASRLED_MODE_OFF)
{
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_LED_SELECT, 1, select_led_pkt);
std::this_thread::sleep_for(1ms);
}
switch(active_mode)
{
/*-----------------------------------------------------*\
| These modes take 4 bytes in R/G/B/S order |
\*-----------------------------------------------------*/
case ASRLED_MODE_BREATHING:
case ASRLED_MODE_FLASHING:
case ASRLED_MODE_STROBE:
case ASRLED_MODE_SPECTRUM_CYCLE:
bus->i2c_smbus_write_block_data(dev, active_mode, 4, color_speed_pkt);
break;
@@ -172,44 +192,129 @@ void PolychromeController::SetColorsAndSpeed(unsigned char led, unsigned char re
break;
case ASROCK_TYPE_POLYCHROME_V1:
/*-----------------------------------------------------*\
| Select LED |
\*-----------------------------------------------------*/
if(active_mode != ASRLED_MODE_OFF)
{
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_LED_SELECT, 1, select_led_pkt);
std::this_thread::sleep_for(1ms);
}
switch(active_mode)
{
/*-----------------------------------------------------*\
| These modes take 4 bytes in R/G/B/S order |
\*-----------------------------------------------------*/
case POLYCHROME_V1_MODE_BREATHING:
case POLYCHROME_V1_MODE_STROBE:
case POLYCHROME_V1_MODE_SPECTRUM_CYCLE:
case POLYCHROME_V1_MODE_SPRING:
case POLYCHROME_V1_MODE_METEOR:
case POLYCHROME_V1_MODE_STACK:
case POLYCHROME_V1_MODE_CRAM:
case POLYCHROME_V1_MODE_SCAN:
case POLYCHROME_V1_MODE_NEON:
case POLYCHROME_V1_MODE_WATER:
bus->i2c_smbus_write_block_data(dev, active_mode, 4, color_speed_pkt);
break;
/*-----------------------------------------------------*\
| These modes take 3 bytes in R/G/B order |
\*-----------------------------------------------------*/
default:
case POLYCHROME_V1_MODE_STATIC:
case POLYCHROME_V1_MODE_MUSIC:
bus->i2c_smbus_write_block_data(dev, active_mode, 3, color_speed_pkt);
break;
/*-----------------------------------------------------*\
| These modes take 1 byte - speed |
\*-----------------------------------------------------*/
case POLYCHROME_V1_MODE_RANDOM:
case POLYCHROME_V1_MODE_WAVE:
case POLYCHROME_V1_MODE_RAINBOW:
bus->i2c_smbus_write_block_data(dev, active_mode, 1, &active_speed);
break;
/*-----------------------------------------------------*\
| These modes take no bytes |
\*-----------------------------------------------------*/
case POLYCHROME_V1_MODE_OFF:
break;
}
std::this_thread::sleep_for(1ms);
break;
case ASROCK_TYPE_POLYCHROME_V2:
/*-----------------------------------------------------*\
| Select LED |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, POLYCHROME_REG_LED_SELECT, 1, select_led_pkt);
std::this_thread::sleep_for(1ms);
switch(active_mode)
{
case POLYCHROME_V2_MODE_OFF:
case POLYCHROME_V2_MODE_RAINBOW:
case POLYCHROME_V2_MODE_SPECTRUM_CYCLE:
break;
/*-----------------------------------------------------*\
| Polychrome firmware always writes color to fixed reg |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, POLYCHROME_REG_COLOR, 3, color_speed_pkt);
std::this_thread::sleep_for(1ms);
default:
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_LED_SELECT, 1, select_led_pkt);
std::this_thread::sleep_for(1ms);
/*-----------------------------------------------------*\
| Polychrome firmware always writes color to fixed reg |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V2_REG_COLOR, 3, color_speed_pkt);
std::this_thread::sleep_for(1ms);
break;
}
break;
}
}
void PolychromeController::SetMode(unsigned char mode, unsigned char speed)
void PolychromeController::SetMode(unsigned char zone,unsigned char mode, unsigned char speed)
{
unsigned char led_count_pkt[1] = { 0x00 };
active_zone = zone;
active_mode = mode;
active_speed = speed;
switch(asrock_type)
{
case ASROCK_TYPE_ASRLED:
bus->i2c_smbus_write_block_data(dev, ASRLED_REG_MODE, 1, &active_mode);
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_MODE, 1, &active_mode);
std::this_thread::sleep_for(1ms);
break;
case ASROCK_TYPE_POLYCHROME_V1:
/*-----------------------------------------------------*\
| Make sure set all register is set to 0 |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V1_REG_SET_ALL, 1, led_count_pkt);
std::this_thread::sleep_for(1ms);
/*-----------------------------------------------------*\
| Set the zone we are working on |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_LED_SELECT, 1, &active_zone);
std::this_thread::sleep_for(1ms);
/*-----------------------------------------------------*\
| Write the mode |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_MODE, 1, &active_mode);
std::this_thread::sleep_for(1ms);
break;
case ASROCK_TYPE_POLYCHROME_V2:
bus->i2c_smbus_write_block_data(dev, POLYCHROME_REG_MODE, 1, &active_mode);
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_MODE, 1, &active_mode);
std::this_thread::sleep_for(1ms);
/*-----------------------------------------------------*\
| Select a single LED |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, POLYCHROME_REG_LED_COUNT, 0, led_count_pkt);
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V2_REG_LED_COUNT, 0, led_count_pkt);
std::this_thread::sleep_for(1ms);
switch(active_mode)
@@ -217,8 +322,8 @@ void PolychromeController::SetMode(unsigned char mode, unsigned char speed)
/*-----------------------------------------------------*\
| These modes don't take a speed |
\*-----------------------------------------------------*/
case POLYCHROME_MODE_OFF:
case POLYCHROME_MODE_STATIC:
case POLYCHROME_V2_MODE_OFF:
case POLYCHROME_V2_MODE_STATIC:
break;
/*-----------------------------------------------------*\
@@ -17,85 +17,178 @@ typedef unsigned char polychrome_dev_id;
enum
{
ASROCK_TYPE_UNKNOWN = 0x00, /* Unknown Type or Not ASRock Device */
ASROCK_TYPE_ASRLED = 0x01, /* ASRock Firmware 1.x - ASR LED */
ASROCK_TYPE_POLYCHROME_V1 = 0x02, /* ASRock Firmware 2.x - Polychrome V1 */
ASROCK_TYPE_POLYCHROME_V2 = 0x03, /* ASRock Firmware 3.x - Polychrome V2 */
ASROCK_TYPE_UNKNOWN = 0x00, /* Unknown Type or Not ASRock Device */
ASROCK_TYPE_ASRLED = 0x01, /* ASRock Firmware 1.x - ASR LED */
ASROCK_TYPE_POLYCHROME_V1 = 0x02, /* ASRock Firmware 2.x - Polychrome V1 */
ASROCK_TYPE_POLYCHROME_V2 = 0x03, /* ASRock Firmware 3.x - Polychrome V2 */
};
enum
{
ASRLED_REG_FIRMWARE_VER = 0x00, /* Firmware version Major.Minor */
ASRLED_REG_MODE = 0x30, /* Mode selection register */
};
#define ASRLED_NUM_MODES 8 /* Number of ASR LED modes */
enum
{
ASRLED_MODE_OFF = 0x10, /* OFF mode */
ASRLED_MODE_STATIC = 0x11, /* Static color mode */
ASRLED_MODE_BREATHING = 0x12, /* Breathing effect mode */
ASRLED_MODE_FLASHING = 0x13, /* Flashing effect mode */
ASRLED_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
ASRLED_MODE_RANDOM = 0x15, /* Random effect mode */
ASRLED_MODE_MUSIC = 0x17, /* Music effect mode */
ASRLED_MODE_WAVE = 0x18, /* Wave effect mode */
/*------------------------------------------------------------------------------------------*\
| ASRock Common Registers |
\*------------------------------------------------------------------------------------------*/
ASROCK_REG_FIRMWARE_VER = 0x00, /* Firmware version Major.Minor */
ASROCK_REG_MODE = 0x30, /* Mode selection register */
ASROCK_REG_LED_SELECT = 0x31, /* LED selection register */
/*------------------------------------------------------------------------------------------*\
| ASRock Polychrome V1/V2 Common Registers |
\*------------------------------------------------------------------------------------------*/
POLYCHROME_REG_LED_CONFIG = 0x33, /* LED configuration register */
/*------------------------------------------------------------------------------------------*\
| ASRock Polychrome V1 (Firmware 2.x) Registers |
\*------------------------------------------------------------------------------------------*/
POLYCHROME_V1_REG_SET_ALL = 0x32, /* Set All register 0x1 = set all */
POLYCHROME_V1_REG_ARGB_GRB = 0x35, /* ARGB bistream reversing register */
/*------------------------------------------------------------------------------------------*\
| ASRock Polychrome V2 (Firmware 3.x) Registers |
\*------------------------------------------------------------------------------------------*/
POLYCHROME_V2_REG_LED_COUNT = 0x32, /* Additional LED count register */
POLYCHROME_V2_REG_COLOR = 0x34, /* Color register: Red, Green, Blue */
POLYCHROME_V2_REG_ARGB_GRB = 0x35, /* ARGB bistream reversing register */
};
enum
{
ASRLED_SPEED_MIN = 0x05, /* Slowest speed */
ASRLED_SPEED_DEFAULT = 0x03, /* Default speed */
ASRLED_SPEED_MAX = 0x00, /* Fastest speed */
POLYCHROME_ZONE_1 = 0x00, /* RGB LED 1 Header */
POLYCHROME_ZONE_2 = 0x01, /* RGB LED 2 Header */
POLYCHROME_ZONE_3 = 0x02, /* Audio/PCH Zone LEDs */
POLYCHROME_ZONE_4 = 0x03, /* Audio/PCH Zone LEDs */
POLYCHROME_ZONE_5 = 0x04, /* IO Cover Zone LEDs */
POLYCHROME_ZONE_ADDRESSABLE = 0x05, /* Addressable LED header */
POLYCHROME_ZONE_COUNT = 0x06, /* Total number of zones */
POLYCHROME_ZONE_ADDRESSABLE_MAX = 0x64, /* Maxinum number of ARGB LEDs */
};
/*----------------------------------------------------------------------------------------------*\
| Definitions for ASR LED |
\*----------------------------------------------------------------------------------------------*/
#define ASRLED_NUM_MODES 8 /* Number of ASR LED modes */
enum
{
ASRLED_MODE_OFF = 0x10, /* OFF mode */
ASRLED_MODE_STATIC = 0x11, /* Static color mode */
ASRLED_MODE_BREATHING = 0x12, /* Breathing effect mode */
ASRLED_MODE_STROBE = 0x13, /* Strobe effect mode */
ASRLED_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
ASRLED_MODE_RANDOM = 0x15, /* Random effect mode */
ASRLED_MODE_MUSIC = 0x17, /* Music effect mode */
ASRLED_MODE_WAVE = 0x18, /* Wave effect mode */
};
enum
{
POLYCHROME_REG_FIRMWARE_VER = 0x00, /* Firmware version Major.Minor */
POLYCHROME_REG_MODE = 0x30, /* Mode selection register */
POLYCHROME_REG_LED_SELECT = 0x31, /* LED selection register */
POLYCHROME_REG_LED_COUNT = 0x32, /* Additional LED count register */
POLYCHROME_REG_LED_CONFIG = 0x33, /* LED configuration register */
POLYCHROME_REG_COLOR = 0x34, /* Color register: Red, Green, Blue */
ASRLED_SPEED_MIN = 0x05, /* Slowest speed */
ASRLED_SPEED_DEFAULT = 0x03, /* Default speed */
ASRLED_SPEED_MAX = 0x00, /* Fastest speed */
};
#define POLYCHROME_NUM_MODES 14 /* Number of Polychrome modes */
/*----------------------------------------------------------------------------------------------*\
| Definitions for Polychrome V1 |
\*----------------------------------------------------------------------------------------------*/
#define POLYCHROME_V1_NUM_MODES 16 /* Number of Polychrome V1 modes */
enum
{
POLYCHROME_MODE_OFF = 0x10, /* OFF mode */
POLYCHROME_MODE_STATIC = 0x11, /* Static color mode */
POLYCHROME_MODE_BREATHING = 0x12, /* Breating effect mode */
POLYCHROME_MODE_FLASHING = 0x13, /* Flashing effect mode */
POLYCHROME_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
POLYCHROME_MODE_RANDOM = 0x15, /* Random effect mode */
POLYCHROME_MODE_WAVE = 0x17, /* Wave effect mode */
POLYCHROME_MODE_SPRING = 0x18, /* Spring effect mode */
POLYCHROME_MODE_STACK = 0x19, /* Stack effect mode */
POLYCHROME_MODE_CRAM = 0x1A, /* Cram effect mode */
POLYCHROME_MODE_SCAN = 0x1B, /* Scan effect mode */
POLYCHROME_MODE_NEON = 0x1C, /* Neon effect mode */
POLYCHROME_MODE_WATER = 0x1D, /* Water effect mode */
POLYCHROME_MODE_RAINBOW = 0x1E, /* Rainbow effect mode */
POLYCHROME_V1_MODE_OFF = 0x10, /* OFF mode */
POLYCHROME_V1_MODE_STATIC = 0x11, /* Static color mode */
POLYCHROME_V1_MODE_BREATHING = 0x12, /* Breating effect mode */
POLYCHROME_V1_MODE_STROBE = 0x13, /* Strobe effect mode */
POLYCHROME_V1_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
POLYCHROME_V1_MODE_RANDOM = 0x15, /* Random effect mode */
POLYCHROME_V1_MODE_MUSIC = 0x17, /* Music effect mode */
POLYCHROME_V1_MODE_WAVE = 0x18, /* Wave effect mode */
/*------------------------------------------------------------------------------------------*\
| Modes only available on ARGB headers |
\*------------------------------------------------------------------------------------------*/
POLYCHROME_V1_MODE_SPRING = 0x19, /* Spring effect mode */
POLYCHROME_V1_MODE_METEOR = 0x1A, /* Meteor effect mode */
POLYCHROME_V1_MODE_STACK = 0x1B, /* Stack effect mode */
POLYCHROME_V1_MODE_CRAM = 0x1C, /* Cram effect mode */
POLYCHROME_V1_MODE_SCAN = 0x1D, /* Scan effect mode */
POLYCHROME_V1_MODE_NEON = 0x1E, /* Neon effect mode */
POLYCHROME_V1_MODE_WATER = 0x1F, /* Water effect mode */
POLYCHROME_V1_MODE_RAINBOW = 0x20, /* Rainbow chase effect mode */
};
enum
{
POLYCHROME_SPEED_MIN = 0x05, /* Slowest speed */
POLYCHROME_SPEED_DEFAULT = 0x03, /* Default speed */
POLYCHROME_SPEED_MAX = 0x00, /* Fastest speed */
/*------------------------------------------------------------------------------------------*\
| POLYCHROME_V1_MODE_BREATHING |
\*------------------------------------------------------------------------------------------*/
POLYCHROME_V1_SPEED_MIN_BREATHING = 0x0A, /* Slowest speed */
POLYCHROME_V1_SPEED_DEFAULT_BREATHING = 0x02, /* Default speed */
POLYCHROME_V1_SPEED_MAX_BREATHING = 0x02, /* Fastest speed */
/*------------------------------------------------------------------------------------------*\
| POLYCHROME_V1_MODE_STROBE |
\*------------------------------------------------------------------------------------------*/
POLYCHROME_V1_SPEED_MIN_STROBE = 0xA0, /* Slowest speed */
POLYCHROME_V1_SPEED_DEFAULT_STROBE = 0x14, /* Default speed */
POLYCHROME_V1_SPEED_MAX_STROBE = 0x05, /* Fastest speed */
/*------------------------------------------------------------------------------------------*\
| POLYCHROME_V1_MODE_SPECTRUM_CYCLE |
\*------------------------------------------------------------------------------------------*/
POLYCHROME_V1_SPEED_MIN_CYCLE = 0xA0, /* Slowest speed */
POLYCHROME_V1_SPEED_DEFAULT_CYCLE = 0x14, /* Default speed */
POLYCHROME_V1_SPEED_MAX_CYCLE = 0x0A, /* Fastest speed */
/*------------------------------------------------------------------------------------------*\
| POLYCHROME_V1_MODE_RANDOM |
\*------------------------------------------------------------------------------------------*/
POLYCHROME_V1_SPEED_MIN_RANDOM = 0xA0, /* Slowest speed */
POLYCHROME_V1_SPEED_DEFAULT_RANDOM = 0x28, /* Default speed */
POLYCHROME_V1_SPEED_MAX_RANDOM = 0x05, /* Fastest speed */
/*------------------------------------------------------------------------------------------*\
| POLYCHROME_V1_MODE_WAVE |
\*------------------------------------------------------------------------------------------*/
POLYCHROME_V1_SPEED_MIN_WAVE = 0x06, /* Slowest speed */
POLYCHROME_V1_SPEED_DEFAULT_WAVE = 0x02, /* Default speed */
POLYCHROME_V1_SPEED_MAX_WAVE = 0x01, /* Fastest speed */
POLYCHROME_V1_SPEED_DEFAULT_SPRING = 0x04, /* Default speed */
POLYCHROME_V1_SPEED_DEFAULT_METEOR = 0x0A, /* Default speed */
POLYCHROME_V1_SPEED_DEFAULT_STACK = 0x04, /* Default speed */
POLYCHROME_V1_SPEED_DEFAULT_CRAM = 0x04, /* Default speed */
POLYCHROME_V1_SPEED_DEFAULT_SCAN = 0x0A, /* Default speed */
POLYCHROME_V1_SPEED_DEFAULT_NEON = 0x20, /* Default speed */
POLYCHROME_V1_SPEED_DEFAULT_WATER = 0x0A, /* Default speed */
/*------------------------------------------------------------------------------------------*\
| POLYCHROME_V1_MODE_RAINBOW |
\*------------------------------------------------------------------------------------------*/
POLYCHROME_V1_SPEED_MIN_RAINBOW = 0x12, /* Slowest speed */
POLYCHROME_V1_SPEED_DEFAULT_RAINBOW = 0x0A, /* Default speed */
POLYCHROME_V1_SPEED_MAX_RAINBOW = 0x01, /* Fastest speed */
POLYCHROME_V1_SPEED_MIN_ARGB = 0x20, /* Slowest speed */
POLYCHROME_V1_SPEED_MAX_ARGB = 0x02, /* Fastest speed */
};
/*----------------------------------------------------------------------------------------------*\
| Definitions for Polychrome V2 |
\*----------------------------------------------------------------------------------------------*/
#define POLYCHROME_V2_NUM_MODES 14 /* Number of Polychrome V2 modes */
enum
{
POLYCHROME_V2_MODE_OFF = 0x10, /* OFF mode */
POLYCHROME_V2_MODE_STATIC = 0x11, /* Static color mode */
POLYCHROME_V2_MODE_BREATHING = 0x12, /* Breating effect mode */
POLYCHROME_V2_MODE_STROBE = 0x13, /* Strobe effect mode */
POLYCHROME_V2_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
POLYCHROME_V2_MODE_RANDOM = 0x15, /* Random effect mode */
POLYCHROME_V2_MODE_WAVE = 0x17, /* Wave effect mode */
POLYCHROME_V2_MODE_SPRING = 0x18, /* Spring effect mode */
POLYCHROME_V2_MODE_STACK = 0x19, /* Stack effect mode */
POLYCHROME_V2_MODE_CRAM = 0x1A, /* Cram effect mode */
POLYCHROME_V2_MODE_SCAN = 0x1B, /* Scan effect mode */
POLYCHROME_V2_MODE_NEON = 0x1C, /* Neon effect mode */
POLYCHROME_V2_MODE_WATER = 0x1D, /* Water effect mode */
POLYCHROME_V2_MODE_RAINBOW = 0x1E, /* Rainbow effect mode */
};
enum
{
POLYCHROME_ZONE_RGB_FAN_HDR = 0x00, /* RGB Fan Header */
POLYCHROME_ZONE_RGB_LED_HDR = 0x01, /* RGB LED Header */
POLYCHROME_ZONE_AUDIO = 0x02, /* Audio Zone LEDs */
POLYCHROME_ZONE_PCH = 0x03, /* PCH Zone LEDs */
POLYCHROME_ZONE_IO_COVER = 0x04, /* IO Cover Zone LEDs */
POLYCHROME_ZONE_ADDRESSABLE = 0x05, /* Addressable LED header */
POLYCHROME_ZONE_COUNT = 0x06, /* Total number of zones */
POLYCHROME_V2_SPEED_MIN = 0x05, /* Slowest speed */
POLYCHROME_V2_SPEED_DEFAULT = 0x03, /* Default speed */
POLYCHROME_V2_SPEED_MAX = 0x00, /* Fastest speed */
};
class PolychromeController
@@ -104,18 +197,20 @@ public:
PolychromeController(i2c_smbus_interface* bus, polychrome_dev_id dev);
~PolychromeController();
std::string GetDeviceLocation();
std::string GetDeviceName();
std::string GetFirmwareVersion();
unsigned int GetMode();
unsigned int GetASRockType();
void SetColorsAndSpeed(unsigned char led, unsigned char red, unsigned char green, unsigned char blue);
void SetMode(unsigned char mode, unsigned char speed);
void SetMode(unsigned char zone, unsigned char mode, unsigned char speed);
unsigned int zone_led_count[6];
unsigned char zone_led_count[6];
private:
unsigned int asrock_type;
std::string device_name;
unsigned char active_zone;
unsigned char active_mode;
unsigned char active_speed;
i2c_smbus_interface* bus;
@@ -61,9 +61,9 @@ void RGBFusion2DRAMController::Apply()
void RGBFusion2DRAMController::SetLEDEffect
(
unsigned int led,
unsigned int /*led*/,
int mode,
unsigned int speed,
unsigned int /*speed*/,
unsigned char red,
unsigned char green,
unsigned char blue
@@ -75,4 +75,4 @@ void RGBFusion2DRAMController::SetLEDEffect
led_data[RGB_FUSION_2_DRAM_IDX_BLUE] = blue;
bus->i2c_smbus_write_block_data(dev, RGB_FUSION_2_DRAM_LED_START_ADDR, 32, led_data);
}
}
@@ -7,6 +7,29 @@
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include "dependencies/dmiinfo.h"
typedef struct
{
const std::string manufacturer;
const std::string motherboard;
} motherboard_info;
#define RGB_FUSION_2_SMBUS_NUM_DEVICES (sizeof(rgb_fusion_2_smbus_motherboards) / sizeof(rgb_fusion_2_smbus_motherboards[ 0 ]))
const motherboard_info rgb_fusion_2_smbus_motherboards[] =
{
{ "Gigabyte Technology Co., Ltd.", "B450 AORUS ELITE" },
{ "Gigabyte Technology Co., Ltd.", "X470 AORUS ULTRA GAMING-CF" },
{ "Gigabyte Technology Co., Ltd.", "X470 AORUS ULTRA GAMING" },
{ "Gigabyte Technology Co., Ltd.", "X470 AORUS GAMING 5 WIFI" },
{ "Gigabyte Technology Co., Ltd.", "B450 AORUS M" },
{ "Gigabyte Technology Co., Ltd.", "X399 AORUS XTREME-CF" },
{ "Gigabyte Technology Co., Ltd.", "X399 DESIGNARE EX-CF" },
{ "Gigabyte Technology Co., Ltd.", "B450 I AORUS PRO WIFI-CF" },
{ "Gigabyte Technology Co., Ltd.", "B450 AORUS PRO-CF4" },
{ "Gigabyte Technology Co., Ltd.", "X470 AORUS GAMING 7 WIFI-CF" },
};
/******************************************************************************************\
* *
@@ -22,18 +45,12 @@ bool TestForRGBFusion2SMBusController(i2c_smbus_interface* bus, unsigned char ad
bool pass = false;
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
if (res >= 0)
{
pass = true;
// res = bus->i2c_smbus_read_byte_data(address, 0xF2);
// if (res != 0xC4)
// {
// pass = false;
// }
}
return(pass);
} /* TestForRGBFusion2SMBusController() */
@@ -54,24 +71,38 @@ void DetectRGBFusion2SMBusControllers(std::vector<i2c_smbus_interface*>& busses,
RGBFusion2SMBusController* new_rgb_fusion;
RGBController_RGBFusion2SMBus* new_controller;
for (unsigned int bus = 0; bus < busses.size(); bus++)
DMIInfo dmi;
bool found = false;
for(unsigned int mb_idx = 0; mb_idx < RGB_FUSION_2_SMBUS_NUM_DEVICES; mb_idx++)
{
// TODO - Is this necessary? Or an artifact of my own system?
// Skip dmcd devices
std::string device_name = std::string(busses[bus]->device_name);
if (device_name.find("dmdc") == std::string::npos)
if( ( dmi.getManufacturer() == rgb_fusion_2_smbus_motherboards[mb_idx].manufacturer )
&& ( dmi.getMainboard() == rgb_fusion_2_smbus_motherboards[mb_idx].motherboard ) )
{
// Check for RGB Fusion 2 controller at 0x68
if (TestForRGBFusion2SMBusController(busses[bus], 0x68))
found = true;
}
}
if(found)
{
for (unsigned int bus = 0; bus < busses.size(); bus++)
{
// TODO - Is this necessary? Or an artifact of my own system?
// Skip dmcd devices
std::string device_name = std::string(busses[bus]->device_name);
if (device_name.find("dmdc") == std::string::npos)
{
new_rgb_fusion = new RGBFusion2SMBusController(busses[bus], 0x68);
new_controller = new RGBController_RGBFusion2SMBus(new_rgb_fusion);
rgb_controllers.push_back(new_controller);
// Check for RGB Fusion 2 controller at 0x68
if (TestForRGBFusion2SMBusController(busses[bus], 0x68))
{
new_rgb_fusion = new RGBFusion2SMBusController(busses[bus], 0x68);
new_controller = new RGBController_RGBFusion2SMBus(new_rgb_fusion);
rgb_controllers.push_back(new_controller);
}
}
}
}
} /* DetectRGBFusion2SMBusControllers() */
// This detector is disabled as proper detection is not implemented
//REGISTER_DETECTOR("Gigabyte RGB Fusion 2 SMBus", DetectRGBFusion2SMBusControllers);
REGISTER_I2C_DETECTOR("Gigabyte RGB Fusion 2 SMBus", DetectRGBFusion2SMBusControllers);
@@ -35,7 +35,7 @@ void DetectRGBFusion2USBControllers(std::vector<RGBController*> &rgb_controllers
return;
}
for(int dev_idx = 0; dev_idx < COUNT_RGBFUSION2_PIDS; dev_idx++)
for(unsigned int dev_idx = 0; dev_idx < COUNT_RGBFUSION2_PIDS; dev_idx++)
{
dev = NULL;
@@ -54,7 +54,8 @@ void DetectRGBFusion2USBControllers(std::vector<RGBController*> &rgb_controllers
&&(info->product_id == tmpPID))
#endif
{
hid_device * dev = hid_open_path(info->path);
dev = hid_open_path(info->path);
if (dev)
{
RGBFusion2USBController * controller = new RGBFusion2USBController(dev, info->path, MB_info.getMainboard());
@@ -73,7 +73,7 @@ void DetectRedragonControllers(std::vector<RGBController*>& rgb_controllers)
hid_init();
for(int device_idx = 0; device_idx < REDRAGON_NUM_DEVICES; device_idx++)
for(unsigned int device_idx = 0; device_idx < REDRAGON_NUM_DEVICES; device_idx++)
{
dev = NULL;
@@ -52,7 +52,7 @@ void SapphireGPUController::SetColor(unsigned char red, unsigned char green, uns
bus->i2c_smbus_write_byte_data(dev, SAPPHIRE_GPU_REG_BLUE, blue);
}
void SapphireGPUController::SetMode(unsigned char mode, unsigned char speed)
void SapphireGPUController::SetMode(unsigned char mode, unsigned char /*speed*/)
{
bus->i2c_smbus_write_byte_data(dev, SAPPHIRE_GPU_REG_MODE, mode);
}
@@ -18,12 +18,12 @@
bool TestForSapphireGPUController(i2c_smbus_interface* bus, unsigned char address)
{
bool pass = false;
int res;
//bool pass = false;
//int res;
if(bus->i2c_smbus_read_byte_data(address, 0x06) == 0xCC)
{
pass = true;
//pass = true;
}
return(false); //TODO - better detection, leaving disabled for now
@@ -45,7 +45,7 @@ SteelSeriesApexController::~SteelSeriesApexController()
void SteelSeriesApexController::SetMode
(
unsigned char mode,
std::vector<RGBColor> colors
std::vector<RGBColor> /*colors*/
)
{
unsigned char mode_colors[9];
@@ -98,7 +98,7 @@ void DetectSteelSeriesControllers(std::vector<RGBController*>& rgb_controllers)
hid_init();
for(int device_idx = 0; device_idx < STEELSERIES_NUM_DEVICES; device_idx++)
for(unsigned int device_idx = 0; device_idx < STEELSERIES_NUM_DEVICES; device_idx++)
{
dev = NULL;
@@ -70,15 +70,20 @@ void SteelSeriesRivalController::SetLightEffect
{
char usb_buf[9];
memset(usb_buf, 0x00, sizeof(usb_buf));
switch (proto) {
switch (proto)
{
case RIVAL_100:
usb_buf[0x00] = 0x07;
usb_buf[0x01] = 0x00;
break;
case RIVAL_300:
usb_buf[0x00] = 0x07;
usb_buf[0x01] = zone_id + 1;
break;
default:
break;
}
usb_buf[0x02] = effect;
send_usb_msg(dev, usb_buf, 9);
@@ -100,8 +105,10 @@ void SteelSeriesRivalController::SetLightEffectAll
SetLightEffect(0, effect);
SetLightEffect(1, effect);
break;
default:
break;
}
}
@@ -126,7 +133,11 @@ void SteelSeriesRivalController::SetColor
usb_buf[0x00] = 0x08;
usb_buf[0x01] = zone_id + 1;
break;
default:
break;
}
usb_buf[0x02] = red;
usb_buf[0x03] = green;
usb_buf[0x04] = blue;
@@ -151,6 +162,9 @@ void SteelSeriesRivalController::SetColorAll
SetColor(0, red, green, blue);
SetColor(1, red, green, blue);
break;
default:
break;
}
}
@@ -13,7 +13,7 @@
static void send_usb_msg(hid_device* dev, char * data_pkt, unsigned int size)
{
char* usb_pkt = new char[16];
unsigned char usb_pkt[16];
memset(usb_pkt, 0x00, sizeof(usb_pkt));
// Report number
@@ -30,9 +30,7 @@ static void send_usb_msg(hid_device* dev, char * data_pkt, unsigned int size)
usb_pkt[4 + i] = data_pkt[1 + i];
}
hid_write(dev, (unsigned char *)usb_pkt, 16);
delete[] usb_pkt;
hid_write(dev, usb_pkt, 16);
}
SteelSeriesSiberiaController::SteelSeriesSiberiaController
@@ -9,6 +9,18 @@
#include "TecknetController.h"
static unsigned char tecknet_colour_mode_data[][16] =
{
{ 0x02, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00 }, // Static
{ 0x02, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00 }, // Breathing
};
static unsigned char tecknet_speed_mode_data[][9] =
{
{ 0x00, 0x00, 0x00, 0x00 }, // Static
{ 0x00, 0x06, 0x03, 0x01 }, // Breathing
};
TecknetController::TecknetController(hid_device* dev_handle, char *_path)
{
const int szTemp = 256;
@@ -79,17 +91,17 @@ void TecknetController::SendUpdate()
unsigned char buffer[TECKNET_PACKET_LENGTH] = { 0x00 };
int buffer_size = (sizeof(buffer) / sizeof(buffer[0]));
for(int i = 0; i < TECKNET_COLOUR_MODE_DATA_SIZE; i++)
for(std::size_t i = 0; i < TECKNET_COLOUR_MODE_DATA_SIZE; i++)
{
buffer[i] = tecknet_colour_mode_data[current_mode][i];
}
//Set the relevant colour info
buffer[TECKNET_RED_BYTE] = current_red;
buffer[TECKNET_GREEN_BYTE] = current_green;
buffer[TECKNET_BLUE_BYTE] = current_blue;
buffer[TECKNET_RED_BYTE] = current_red;
buffer[TECKNET_GREEN_BYTE] = current_green;
buffer[TECKNET_BLUE_BYTE] = current_blue;
buffer[TECKNET_BRIGHTNESS_BYTE] = current_brightness;
buffer[TECKNET_SPEED_BYTE] = tecknet_speed_mode_data[current_mode][current_speed];
buffer[TECKNET_SPEED_BYTE] = tecknet_speed_mode_data[current_mode][current_speed];
hid_send_feature_report(dev, buffer, buffer_size);
}
@@ -41,18 +41,6 @@ enum
TECKNET_BRIGHTNESS_HIGH = 0x03
};
static unsigned char tecknet_colour_mode_data[][16] =
{
{ 0x02, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00 }, // Static
{ 0x02, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00 }, // Breathing
};
static unsigned char tecknet_speed_mode_data[][9] =
{
{ 0x00, 0x00, 0x00, 0x00 }, // Static
{ 0x00, 0x06, 0x03, 0x01 }, // Breathing
};
enum
{
TECKNET_SPEED_OFF = 0x00, // Breathe Off
@@ -29,7 +29,7 @@ enum
TECKNET_USAGE_PAGE = 3
};
static const unsigned int tecknet_pids[][4] =
static const int tecknet_pids[][4] =
{ // PID, Interface, Usage, Usage_Page
{ TECKNET_M0008_PID, 0, TECKNET_M0008_U, TECKNET_M0008_UPG } //Tecknet M008 Mouse
};
@@ -55,7 +55,7 @@ void DetectTecknetControllers(std::vector<RGBController*>& rgb_controllers)
hid_device* dev = NULL;
if(info->vendor_id == TECKNET_VID)
{
for(int pid_idx = 0; pid_idx < TECKNET_NUM_DEVICES; pid_idx++)
for(unsigned int pid_idx = 0; pid_idx < TECKNET_NUM_DEVICES; pid_idx++)
{
if((info->vendor_id == TECKNET_VID)
#ifdef USE_HID_USAGE
+5 -5
View File
@@ -373,7 +373,7 @@ void NetworkClient::ListenThreadFunction()
{
int tmp_bytes_read = 0;
tmp_bytes_read = recv_select(client_sock, &data[bytes_read], header.pkt_size - bytes_read, 0);
tmp_bytes_read = recv_select(client_sock, &data[(unsigned int)bytes_read], header.pkt_size - bytes_read, 0);
if(tmp_bytes_read <= 0)
{
@@ -381,7 +381,7 @@ void NetworkClient::ListenThreadFunction()
}
bytes_read += tmp_bytes_read;
} while (bytes_read < header.pkt_size);
} while ((unsigned int)bytes_read < header.pkt_size);
}
//Entire request received, select functionality based on request ID
@@ -404,9 +404,9 @@ listen_done:
server_initialized = false;
server_connected = false;
for(int server_controller_idx = 0; server_controller_idx < server_controllers.size(); server_controller_idx++)
for(size_t server_controller_idx = 0; server_controller_idx < server_controllers.size(); server_controller_idx++)
{
for(int controller_idx = 0; controller_idx < controllers.size(); controller_idx++)
for(size_t controller_idx = 0; controller_idx < controllers.size(); controller_idx++)
{
if(controllers[controller_idx] == server_controllers[server_controller_idx])
{
@@ -448,7 +448,7 @@ void NetworkClient::ProcessReply_ControllerCount(unsigned int data_size, char *
}
}
void NetworkClient::ProcessReply_ControllerData(unsigned int data_size, char * data, unsigned int dev_idx)
void NetworkClient::ProcessReply_ControllerData(unsigned int /*data_size*/, char * data, unsigned int dev_idx)
{
RGBController_Network * new_controller = new RGBController_Network(this, dev_idx);
+1 -1
View File
@@ -20,7 +20,7 @@ typedef struct NetPacketHeader
unsigned int pkt_dev_idx; /* Device index */
unsigned int pkt_id; /* Packet ID */
unsigned int pkt_size; /* Packet size */
};
} NetPacketHeader;
enum
{
+3 -3
View File
@@ -438,7 +438,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
{
int tmp_bytes_read = 0;
tmp_bytes_read = recv_select(client_sock, &data[bytes_read], header.pkt_size - bytes_read, 0);
tmp_bytes_read = recv_select(client_sock, &data[(unsigned int)bytes_read], header.pkt_size - bytes_read, 0);
if(tmp_bytes_read <= 0)
{
@@ -446,7 +446,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
}
bytes_read += tmp_bytes_read;
} while (bytes_read < header.pkt_size);
} while ((unsigned int)bytes_read < header.pkt_size);
}
//Entire request received, select functionality based on request ID
@@ -584,7 +584,7 @@ listen_done:
ClientInfoChanged();
}
void NetworkServer::ProcessRequest_ClientString(SOCKET client_sock, unsigned int data_size, char * data)
void NetworkServer::ProcessRequest_ClientString(SOCKET client_sock, unsigned int /*data_size*/, char * data)
{
ServerClientsMutex.lock();
for(unsigned int this_idx = 0; this_idx < ServerClients.size(); this_idx++)
+6 -1
View File
@@ -16,7 +16,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
#-----------------------------------------------------------------------#
# Application Configuration #
#-----------------------------------------------------------------------#
VERSION = 0.31
VERSION = 0.4
TARGET = OpenRGB
TEMPLATE = app
@@ -149,6 +149,7 @@ HEADERS += \
Controllers/LogitechController/LogitechG403Controller.h \
Controllers/LogitechController/LogitechG502PSController.h \
Controllers/LogitechController/LogitechG810Controller.h \
Controllers/LogitechController/LogitechGPowerPlayController.h \
Controllers/LogitechController/LogitechGProWirelessController.h \
Controllers/MSI3ZoneController/MSI3ZoneController.h \
Controllers/MSIGPUController/MSIGPUController.h \
@@ -204,6 +205,7 @@ HEADERS += \
RGBController/RGBController_LogitechG403.h \
RGBController/RGBController_LogitechG502PS.h \
RGBController/RGBController_LogitechG810.h \
RGBController/RGBController_LogitechGPowerPlay.h \
RGBController/RGBController_LogitechGProWireless.h \
RGBController/RGBController_MSI3Zone.h \
RGBController/RGBController_MSIGPU.h \
@@ -229,6 +231,7 @@ HEADERS += \
RGBController/RGBController_SteelSeriesApex.h \
RGBController/RGBController_Tecknet.h \
RGBController/RGBController_ThermaltakeRiing.h \
RGBController/OpenRazerDevices.h \
SOURCES += \
dependencies/dmiinfo.cpp \
@@ -312,6 +315,7 @@ SOURCES += \
Controllers/LogitechController/LogitechG403Controller.cpp \
Controllers/LogitechController/LogitechG502PSController.cpp \
Controllers/LogitechController/LogitechG810Controller.cpp \
Controllers/LogitechController/LogitechGPowerPlayController.cpp \
Controllers/LogitechController/LogitechGProWirelessController.cpp \
Controllers/MSI3ZoneController/MSI3ZoneController.cpp \
Controllers/MSI3ZoneController/MSI3ZoneControllerDetect.cpp \
@@ -388,6 +392,7 @@ SOURCES += \
RGBController/RGBController_LogitechG403.cpp \
RGBController/RGBController_LogitechG502PS.cpp \
RGBController/RGBController_LogitechG810.cpp \
RGBController/RGBController_LogitechGPowerPlay.cpp \
RGBController/RGBController_LogitechGProWireless.cpp \
RGBController/RGBController_MSI3Zone.cpp \
RGBController/RGBController_MSIGPU.cpp \
+1 -1
View File
@@ -47,7 +47,7 @@ There have been two instances of hardware damage in OpenRGB's development and we
## Linux
* Pre-built binaries are not currently available for Linux
* Pre-built binaries in AppImage format are available under the Releases section on GitLab.
* You can build the project using Qt Creator or on the command line.
1. Install build dependencies
- Debian: sudo apt install build-essential qtcreator qt5-default libusb-1.0-0-dev libhidapi-dev pkgconf
+1 -14
View File
@@ -35,22 +35,9 @@ void DetectE131Controllers(std::vector<RGBController*> &rgb_controllers)
{
RGBController_E131* new_controller;
//Get file path in executable directory
std::ifstream infile;
char filename[2048];
char arg1[64];
#ifdef WIN32
GetModuleFileName(NULL, filename, 2048);
strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str());
strcat(filename, "\\e131.txt");
#else
snprintf(arg1, 64, "/proc/%d/exe", getpid());
readlink(arg1, filename, 1024);
strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str());
strcat(filename, "/e131.txt");
#endif
E131Device dev;
std::vector<E131Device> devices;
@@ -66,7 +53,7 @@ void DetectE131Controllers(std::vector<RGBController*> &rgb_controllers)
dev.matrix_height = 0;
//Open settings file
infile.open(filename);
infile.open("e131.txt");
if (infile.good())
{
+129 -2
View File
@@ -1,5 +1,8 @@
#define RAZER_MAX_ZONES 6
#include <string>
#include "RGBController.h"
typedef struct
{
std::string name;
@@ -112,12 +115,14 @@ static const razer_key blackwidow_chroma_keymap[] =
{ 0, 3, 10, "Key: L" },
{ 0, 3, 11, "Key: ;" },
{ 0, 3, 12, "Key: '" },
{ 0, 3, 13, "Key: #" },
{ 0, 3, 14, "Key: Enter" },
{ 0, 3, 18, "Key: Number Pad 4" },
{ 0, 3, 19, "Key: Number Pad 5" },
{ 0, 3, 20, "Key: Number Pad 6" },
{ 0, 4, 0, "Key: M4" },
{ 0, 4, 1, "Key: Left Shift" },
{ 0, 4, 2, "Key: \\ (ISO)" },
{ 0, 4, 3, "Key: Z" },
{ 0, 4, 4, "Key: X" },
{ 0, 4, 5, "Key: C" },
@@ -218,8 +223,10 @@ static const razer_key blackwidow_chroma_te_keymap[] =
{ 0, 3, 10, "Key: L" },
{ 0, 3, 11, "Key: ;" },
{ 0, 3, 12, "Key: '" },
{ 0, 3, 13, "Key: #" },
{ 0, 3, 14, "Key: Enter" },
{ 0, 4, 1, "Key: Left Shift" },
{ 0, 4, 2, "Key: \\ (ISO)" },
{ 0, 4, 3, "Key: Z" },
{ 0, 4, 4, "Key: X" },
{ 0, 4, 5, "Key: C" },
@@ -433,6 +440,122 @@ static const razer_key blade_stealth_keymap[] =
{ 0, 5, 15, "Key: Down Arrow" },
};
#define CYNOSA_CHROMA_KEYMAP_SIZE (sizeof(cynosa_chroma_keymap) / sizeof(cynosa_chroma_keymap[0]))
static const razer_key cynosa_chroma_keymap[] =
{
/*---------------------------------------------------------------------*\
| Zone, Row, Column, Key |
\*---------------------------------------------------------------------*/
{ 0, 0, 1, "Key: Escape" },
{ 0, 0, 3, "Key: F1" },
{ 0, 0, 4, "Key: F2" },
{ 0, 0, 5, "Key: F3" },
{ 0, 0, 6, "Key: F4" },
{ 0, 0, 7, "Key: F5" },
{ 0, 0, 8, "Key: F6" },
{ 0, 0, 9, "Key: F7" },
{ 0, 0, 10, "Key: F8" },
{ 0, 0, 11, "Key: F9" },
{ 0, 0, 12, "Key: F10" },
{ 0, 0, 13, "Key: F11" },
{ 0, 0, 14, "Key: F12" },
{ 0, 0, 15, "Key: Print Screen" },
{ 0, 0, 16, "Key: Scroll Lock" },
{ 0, 0, 17, "Key: Pause/Break" },
{ 0, 0, 20, "Logo" },
{ 0, 1, 1, "Key: `" },
{ 0, 1, 2, "Key: 1" },
{ 0, 1, 3, "Key: 2" },
{ 0, 1, 4, "Key: 3" },
{ 0, 1, 5, "Key: 4" },
{ 0, 1, 6, "Key: 5" },
{ 0, 1, 7, "Key: 6" },
{ 0, 1, 8, "Key: 7" },
{ 0, 1, 9, "Key: 8" },
{ 0, 1, 10, "Key: 9" },
{ 0, 1, 11, "Key: 0" },
{ 0, 1, 12, "Key: -" },
{ 0, 1, 13, "Key: =" },
{ 0, 1, 14, "Key: Backspace" },
{ 0, 1, 15, "Key: Insert" },
{ 0, 1, 16, "Key: Home" },
{ 0, 1, 17, "Key: Page Up" },
{ 0, 1, 18, "Key: Num Lock" },
{ 0, 1, 19, "Key: Number Pad /" },
{ 0, 1, 20, "Key: Number Pad *" },
{ 0, 1, 21, "Key: Number Pad -" },
{ 0, 2, 1, "Key: Tab" },
{ 0, 2, 2, "Key: Q" },
{ 0, 2, 3, "Key: W" },
{ 0, 2, 4, "Key: E" },
{ 0, 2, 5, "Key: R" },
{ 0, 2, 6, "Key: T" },
{ 0, 2, 7, "Key: Y" },
{ 0, 2, 8, "Key: U" },
{ 0, 2, 9, "Key: I" },
{ 0, 2, 10, "Key: O" },
{ 0, 2, 11, "Key: P" },
{ 0, 2, 12, "Key: [" },
{ 0, 2, 13, "Key: ]" },
{ 0, 2, 14, "Key: \\ (ANSI)" },
{ 0, 2, 15, "Key: Delete" },
{ 0, 2, 16, "Key: End" },
{ 0, 2, 17, "Key: Page Down" },
{ 0, 2, 18, "Key: Number Pad 7" },
{ 0, 2, 19, "Key: Number Pad 8" },
{ 0, 2, 20, "Key: Number Pad 9" },
{ 0, 2, 21, "Key: Number Pad +" },
{ 0, 3, 1, "Key: Caps Lock" },
{ 0, 3, 2, "Key: A" },
{ 0, 3, 3, "Key: S" },
{ 0, 3, 4, "Key: D" },
{ 0, 3, 5, "Key: F" },
{ 0, 3, 6, "Key: G" },
{ 0, 3, 7, "Key: H" },
{ 0, 3, 8, "Key: J" },
{ 0, 3, 9, "Key: K" },
{ 0, 3, 10, "Key: L" },
{ 0, 3, 11, "Key: ;" },
{ 0, 3, 12, "Key: '" },
{ 0, 3, 13, "Key: #" },
{ 0, 3, 14, "Key: Enter" },
{ 0, 3, 18, "Key: Number Pad 4" },
{ 0, 3, 19, "Key: Number Pad 5" },
{ 0, 3, 20, "Key: Number Pad 6" },
{ 0, 4, 1, "Key: Left Shift" },
{ 0, 4, 2, "Key: \\ (ISO)" },
{ 0, 4, 3, "Key: Z" },
{ 0, 4, 4, "Key: X" },
{ 0, 4, 5, "Key: C" },
{ 0, 4, 6, "Key: V" },
{ 0, 4, 7, "Key: B" },
{ 0, 4, 8, "Key: N" },
{ 0, 4, 9, "Key: M" },
{ 0, 4, 10, "Key: ," },
{ 0, 4, 11, "Key: ." },
{ 0, 4, 12, "Key: /" },
{ 0, 4, 14, "Key: Right Shift" },
{ 0, 4, 16, "Key: Up Arrow" },
{ 0, 4, 18, "Key: Number Pad 1" },
{ 0, 4, 19, "Key: Number Pad 2" },
{ 0, 4, 20, "Key: Number Pad 3" },
{ 0, 4, 21, "Key: Number Pad Enter" },
{ 0, 5, 1, "Key: Left Control" },
{ 0, 5, 2, "Key: Left Windows" },
{ 0, 5, 3, "Key: Left Alt" },
{ 0, 5, 7, "Key: Space" },
{ 0, 5, 11, "Key: Right Alt" },
{ 0, 5, 12, "Key: Right Fn" },
{ 0, 5, 13, "Key: Menu" },
{ 0, 5, 14, "Key: Right Control" },
{ 0, 5, 15, "Key: Left Arrow" },
{ 0, 5, 16, "Key: Down Arrow" },
{ 0, 5, 17, "Key: Right Arrow" },
{ 0, 5, 19, "Key: Number Pad 0" },
{ 0, 5, 20, "Key: Number Pad ." },
};
#define HUNTSMAN_ELITE_KEYMAP_SIZE (sizeof(huntsman_elite_keymap) / sizeof(huntsman_elite_keymap[0]))
static const razer_key huntsman_elite_keymap[] =
@@ -514,11 +637,13 @@ static const razer_key huntsman_elite_keymap[] =
{ 0, 3, 10, "Key: L" },
{ 0, 3, 11, "Key: ;" },
{ 0, 3, 12, "Key: '" },
{ 0, 3, 13, "Key: #" },
{ 0, 3, 14, "Key: Enter" },
{ 0, 3, 18, "Key: Number Pad 4" },
{ 0, 3, 19, "Key: Number Pad 5" },
{ 0, 3, 20, "Key: Number Pad 6" },
{ 0, 4, 1, "Key: Left Shift" },
{ 0, 4, 2, "Key: \\ (ISO)" },
{ 0, 4, 3, "Key: Z" },
{ 0, 4, 4, "Key: X" },
{ 0, 4, 5, "Key: C" },
@@ -631,11 +756,13 @@ static const razer_key blackwidow_elite_keymap[] =
{ 0, 3, 10, "Key: L" },
{ 0, 3, 11, "Key: ;" },
{ 0, 3, 12, "Key: '" },
{ 0, 3, 13, "Key: #" },
{ 0, 3, 14, "Key: Enter" },
{ 0, 3, 18, "Key: Number Pad 4" },
{ 0, 3, 19, "Key: Number Pad 5" },
{ 0, 3, 20, "Key: Number Pad 6" },
{ 0, 4, 1, "Key: Left Shift" },
{ 0, 4, 2, "Key: \\ (ISO)" },
{ 0, 4, 3, "Key: Z" },
{ 0, 4, 4, "Key: X" },
{ 0, 4, 5, "Key: C" },
@@ -1090,8 +1217,8 @@ static const razer_device cynosa_chroma_device =
NULL,
NULL
},
NULL,
0
cynosa_chroma_keymap,
CYNOSA_CHROMA_KEYMAP_SIZE
};
/*-------------------------------------------------------------*\
+3 -3
View File
@@ -18,7 +18,7 @@ RGBController::~RGBController()
/*---------------------------------------------------------*\
| Delete the matrix map |
\*---------------------------------------------------------*/
for(int zone_index = 0; zone_index < zones.size(); zone_index++)
for(unsigned int zone_index = 0; zone_index < zones.size(); zone_index++)
{
if(zones[zone_index].matrix_map != NULL)
{
@@ -357,7 +357,7 @@ unsigned char * RGBController::GetDeviceDescription()
/*---------------------------------------------------------*\
| Copy in matrix map |
\*---------------------------------------------------------*/
for(int matrix_idx = 0; matrix_idx < (zones[zone_index].matrix_map->height * zones[zone_index].matrix_map->width); matrix_idx++)
for(unsigned int matrix_idx = 0; matrix_idx < (zones[zone_index].matrix_map->height * zones[zone_index].matrix_map->width); matrix_idx++)
{
memcpy(&data_buf[data_ptr], &zones[zone_index].matrix_map->map[matrix_idx], sizeof(zones[zone_index].matrix_map->map[matrix_idx]));
data_ptr += sizeof(zones[zone_index].matrix_map->map[matrix_idx]);
@@ -677,7 +677,7 @@ void RGBController::ReadDeviceDescription(unsigned char* data_buf)
\*---------------------------------------------------------*/
new_map->map = new unsigned int[new_map->height * new_map->width];
for(int matrix_idx = 0; matrix_idx < (new_map->height * new_map->width); matrix_idx++)
for(unsigned int matrix_idx = 0; matrix_idx < (new_map->height * new_map->width); matrix_idx++)
{
memcpy(&new_map->map[matrix_idx], &data_buf[data_ptr], sizeof(new_map->map[matrix_idx]));
data_ptr += sizeof(new_map->map[matrix_idx]);
+2 -2
View File
@@ -51,7 +51,7 @@ void RGBController_AuraCore::SetupZones()
Keyboard.matrix_map = NULL;
zones.push_back(Keyboard);
for(int led_idx = 0; led_idx < Keyboard.leds_count; led_idx++)
for(unsigned int led_idx = 0; led_idx < Keyboard.leds_count; led_idx++)
{
led KeyLED;
KeyLED.name = "Keyboard LED ";
@@ -76,7 +76,7 @@ void RGBController_AuraCore::DeviceUpdateLEDs()
void RGBController_AuraCore::UpdateZoneLEDs(int /*zone*/)
{
for(int led_idx = 0; led_idx < leds.size(); led_idx++)
for(unsigned int led_idx = 0; led_idx < leds.size(); led_idx++)
{
UpdateSingleLED(led_idx);
}
+3 -3
View File
@@ -98,12 +98,12 @@ void RGBController_CorsairHydro::DeviceUpdateLEDs()
DeviceUpdateMode();
}
void RGBController_CorsairHydro::UpdateZoneLEDs(int zone)
void RGBController_CorsairHydro::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_CorsairHydro::UpdateSingleLED(int led)
void RGBController_CorsairHydro::UpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}
@@ -133,4 +133,4 @@ void RGBController_CorsairHydro::DeviceUpdateMode()
corsair->SetPulse(modes[active_mode].colors, modes[active_mode].speed);
break;
}
}
}
@@ -494,6 +494,63 @@ static const char* led_names_k95[] =
"Key: M3",
};
static const char* corsair_mouse_leds[] =
{
"Mouse LED 1",
"Mouse LED 2",
"Mouse LED 3",
"Mouse LED 4",
"Mouse LED 5",
"Mouse LED 6",
"Mouse LED 7",
"Mouse LED 8",
"Mouse LED 9",
"Mouse LED 10",
"Mouse LED 11",
"Mouse LED 12",
"Mouse LED 13",
"Mouse LED 14",
"Mouse LED 15",
};
static const char* corsair_sabre_rgb_leds[] =
{
"",
"Underglow",
"Logo",
"DPI",
"Scroll Wheel",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
};
static const char* corsair_harpoon_pro_leds[] =
{
"",
"",
"",
"Logo",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
};
RGBController_CorsairPeripheral::RGBController_CorsairPeripheral(CorsairPeripheralController* corsair_ptr)
{
corsair = corsair_ptr;
@@ -624,7 +681,7 @@ void RGBController_CorsairPeripheral::SetupZones()
case DEVICE_TYPE_MOUSE:
new_zone.name = "Mousemat Zone";
new_zone.name = "Mouse Zone";
new_zone.type = ZONE_TYPE_SINGLE;
new_zone.leds_min = 15;
new_zone.leds_max = 15;
@@ -690,6 +747,9 @@ void RGBController_CorsairPeripheral::SetupZones()
break;
case DEVICE_TYPE_MOUSE:
new_led.name = corsair_mouse_leds[led_idx];
break;
case DEVICE_TYPE_MOUSEMAT:
case DEVICE_TYPE_HEADSET_STAND:
new_led.name = "Mousemat LED ";
+180 -23
View File
@@ -20,6 +20,157 @@ static unsigned int matrix_map[6][23] =
{ 4, NA, 16, 22, 28, 34, NA, 40, NA, 46, 52, 58, 64, 70, 82, NA, NA, 100, NA, 112, 118, 124, 131 },
{ 5, 11, 17, NA, NA, NA, NA, 41, NA, NA, NA, NA, 65, 77, 83, 89, 95, 101, 107, 113, NA, 125, NA } };
static const char* zone_names[] =
{
"Keyboard"
};
static zone_type zone_types[] =
{
ZONE_TYPE_MATRIX,
};
static const unsigned int zone_sizes[] =
{
132
};
static const char *led_names[] =
{
"Key: Escape",
"Key: `",
"Key: Tab",
"Key: Caps Lock",
"Key: Left Shift",
"Key: Left Control",
"Unused",
"Key: 1",
"Key: Q",
"Key: A",
"Unused",
"Key: Left Windows",
"Key: F1",
"Key: 2",
"Key: W",
"Key: S",
"Key: Z",
"Key: Left Alt",
"Key: F2",
"Key: 3",
"Key: E",
"Key: D",
"Key: X",
"Unused",
"Key: F3",
"Key: 4",
"Key: R",
"Key: F",
"Key: C",
"Unused",
"Key: F4",
"Key: 5",
"Key: T",
"Key: G",
"Key: V",
"Unused",
"Unused",
"Key: 6",
"Key: Y",
"Key: H",
"Key: B",
"Key: Space",
"Key: F5",
"Key: 7",
"Key: U",
"Key: J",
"Key: N",
"Unused",
"Key: F6",
"Key: 8",
"Key: I",
"Key: K",
"Key: M",
"Unused",
"Key: F7",
"Key: 9",
"Key: O",
"Key: L",
"Key: ,",
"Unused",
"Key: F8",
"Key: 0",
"Key: P",
"Key: ;",
"Key: .",
"Key: Right Alt",
"Key: F9",
"Key: -",
"Key: [",
"Key: '",
"Key: /",
"Unused",
"Key: F10",
"Key: =",
"Key: ]",
"Unused",
"Unused",
"Key: Right Windows",
"Key: F11",
"Unused",
"Unused",
"Unused",
"Key: Right Shift",
"Key: Right Fn",
"Key: F12",
"Key: Backspace",
"Key: \\ (ANSI)",
"Key: Enter",
"Unused",
"Key: Right Control",
"Key: Print Screen",
"Key: Insert",
"Key: Delete",
"Unused",
"Unused",
"Key: Left Arrow",
"Key: Scroll Lock",
"Key: Home",
"Key: End",
"Unused",
"Key: Up Arrow",
"Key: Down Arrow",
"Key: Pause/Break",
"Key: Page Up",
"Key: Page Down",
"Unused",
"Unused",
"Key: Right Arrow",
"Key: Calculator",
"Key: Num Lock",
"Key: Number Pad 7",
"Key: Number Pad 4",
"Key: Number Pad 1",
"Key: Number Pad 0",
"Key: Media Mute",
"Key: Number Pad /",
"Key: Number Pad 8",
"Key: Number Pad 5",
"Key: Number Pad 2",
"Unused",
"Key: Media Volume Down",
"Key: Number Pad *",
"Key: Number Pad 9",
"Key: Number Pad 6",
"Key: Number Pad 3",
"Key: Number Pad .",
"Key: Media Volume Up",
"Key: Number Pad -",
"Key: Number Pad +",
"Unused",
"Unused",
"Key: Number Pad Enter",
};
RGBController_DuckyKeyboard::RGBController_DuckyKeyboard(DuckyKeyboardController* ducky_ptr)
{
ducky = ducky_ptr;
@@ -45,43 +196,49 @@ RGBController_DuckyKeyboard::~RGBController_DuckyKeyboard()
void RGBController_DuckyKeyboard::SetupZones()
{
zone new_zone;
/*---------------------------------------------------------*\
| Set up zones |
\*---------------------------------------------------------*/
unsigned int total_led_count = 0;
for(unsigned int zone_idx = 0; zone_idx < 1; zone_idx++)
{
zone new_zone;
new_zone.name = zone_names[zone_idx];
new_zone.type = zone_types[zone_idx];
new_zone.leds_min = zone_sizes[zone_idx];
new_zone.leds_max = zone_sizes[zone_idx];
new_zone.leds_count = zone_sizes[zone_idx];
new_zone.matrix_map = new matrix_map_type;
new_zone.matrix_map->height = 6;
new_zone.matrix_map->width = 23;
new_zone.matrix_map->map = (unsigned int *)&matrix_map;
zones.push_back(new_zone);
new_zone.name = "Keyboard";
new_zone.type = ZONE_TYPE_MATRIX;
new_zone.leds_min = 155;
new_zone.leds_max = 155;
new_zone.leds_count = 155;
new_zone.matrix_map = new matrix_map_type;
new_zone.matrix_map->height = 6;
new_zone.matrix_map->width = 23;
new_zone.matrix_map->map = (unsigned int *)&matrix_map;
zones.push_back(new_zone);
total_led_count += zone_sizes[zone_idx];
}
for(int led_idx = 0; led_idx < 155; led_idx++)
for(unsigned int led_idx = 0; led_idx < total_led_count; led_idx++)
{
led new_led;
new_led.name = "Keyboard LED ";
new_led.name.append(std::to_string(led_idx));
new_led.name = led_names[led_idx];
leds.push_back(new_led);
}
SetupColors();
}
void RGBController_DuckyKeyboard::ResizeZone(int zone, int new_size)
void RGBController_DuckyKeyboard::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_DuckyKeyboard::DeviceUpdateLEDs()
{
unsigned char colordata[155*3];
for(int color_idx = 0; color_idx < colors.size(); color_idx++)
for(std::size_t color_idx = 0; color_idx < colors.size(); color_idx++)
{
colordata[(color_idx*3)+0] = RGBGetRValue(colors[color_idx]);
colordata[(color_idx*3)+1] = RGBGetGValue(colors[color_idx]);
@@ -91,12 +248,12 @@ void RGBController_DuckyKeyboard::DeviceUpdateLEDs()
ducky->SendColors(colordata, sizeof(colordata));
}
void RGBController_DuckyKeyboard::UpdateZoneLEDs(int zone)
void RGBController_DuckyKeyboard::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_DuckyKeyboard::UpdateSingleLED(int led)
void RGBController_DuckyKeyboard::UpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}
@@ -109,4 +266,4 @@ void RGBController_DuckyKeyboard::SetCustomMode()
void RGBController_DuckyKeyboard::DeviceUpdateMode()
{
}
}
+8 -8
View File
@@ -106,7 +106,7 @@ RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
case E131_MATRIX_ORDER_HORIZONTAL_TOP_RIGHT:
for(unsigned int y = 0; y < new_map->height; y++)
{
for(unsigned int x = new_map->width - 1; x >= 0; x--)
for(int x = new_map->width - 1; x >= 0; x--)
{
new_map->map[(y * new_map->width) + x] = led_idx;
led_idx++;
@@ -114,7 +114,7 @@ RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
}
break;
case E131_MATRIX_ORDER_HORIZONTAL_BOTTOM_LEFT:
for(unsigned int y = new_map->height; y >= 0; y--)
for(int y = new_map->height; y >= 0; y--)
{
for(unsigned int x = 0; x < new_map->width; x++)
{
@@ -124,9 +124,9 @@ RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
}
break;
case E131_MATRIX_ORDER_HORIZONTAL_BOTTOM_RIGHT:
for(unsigned int y = new_map->height; y >= 0; y--)
for(int y = new_map->height; y >= 0; y--)
{
for(unsigned int x = new_map->width - 1; x >= 0; x--)
for(int x = new_map->width - 1; x >= 0; x--)
{
new_map->map[(y * new_map->width) + x] = led_idx;
led_idx++;
@@ -144,7 +144,7 @@ RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
}
break;
case E131_MATRIX_ORDER_VERTICAL_TOP_RIGHT:
for(unsigned int x = new_map->width - 1; x >= 0; x--)
for(int x = new_map->width - 1; x >= 0; x--)
{
for(unsigned int y = 0; y < new_map->height; y++)
{
@@ -156,7 +156,7 @@ RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
case E131_MATRIX_ORDER_VERTICAL_BOTTOM_LEFT:
for(unsigned int x = 0; x < new_map->width; x++)
{
for(unsigned int y = new_map->height - 1; y >= 0; y++)
for(int y = new_map->height - 1; y >= 0; y--)
{
new_map->map[(y * new_map->width) + x] = led_idx;
led_idx++;
@@ -164,9 +164,9 @@ RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
}
break;
case E131_MATRIX_ORDER_VERTICAL_BOTTOM_RIGHT:
for(unsigned int x = new_map->width - 1; x >= 0; x--)
for(int x = new_map->width - 1; x >= 0; x--)
{
for(unsigned int y = new_map->height - 1; y >= 0; y--)
for(int y = new_map->height - 1; y >= 0; y--)
{
new_map->map[(y * new_map->width) + x] = led_idx;
led_idx++;
-3
View File
@@ -12,7 +12,6 @@ int RGBController_GalaxGPU::GetDeviceMode()
{
int modereg1 = galax_gpu->GalaxGPURegisterRead(GALAX_MODE_REGISTER_1);
int modereg2 = galax_gpu->GalaxGPURegisterRead(GALAX_MODE_REGISTER_2);
int color_mode = MODE_COLORS_PER_LED;
if (modereg1 == GALAX_MODE_STATIC_VALUE_1 && modereg2 == GALAX_MODE_STATIC_VALUE_2)
{
@@ -38,7 +37,6 @@ int RGBController_GalaxGPU::GetDeviceMode()
modes[active_mode].color_mode = MODE_COLORS_NONE;
}
return(active_mode);
}
@@ -46,7 +44,6 @@ RGBController_GalaxGPU::RGBController_GalaxGPU(GalaxGPUController * galax_gpu_pt
{
galax_gpu = galax_gpu_ptr;
name = galax_gpu->GetDeviceName();
type = DEVICE_TYPE_GPU;
description = "GALAX / KFA2 RTX GPU";
+2 -2
View File
@@ -38,7 +38,7 @@ RGBController_HoltekA070::RGBController_HoltekA070(HoltekA070Controller* holtek_
void RGBController_HoltekA070::SetupZones()
{
zone mouse_zone;
mouse_zone.name = "Mouse Zone";
mouse_zone.name = "Mouse";
mouse_zone.type = ZONE_TYPE_SINGLE;
mouse_zone.leds_min = 1;
mouse_zone.leds_max = 1;
@@ -47,7 +47,7 @@ void RGBController_HoltekA070::SetupZones()
zones.push_back(mouse_zone);
led mouse_led;
mouse_led.name = "All LEDs";
mouse_led.name = "Mouse";
leds.push_back(mouse_led);
SetupColors();
@@ -269,9 +269,11 @@ void RGBController_HyperXAlloyOrigins::SetupZones()
SetupColors();
}
void RGBController_HyperXAlloyOrigins::ResizeZone(int zone, int new_size)
void RGBController_HyperXAlloyOrigins::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_HyperXAlloyOrigins::DeviceUpdateLEDs()
@@ -279,12 +281,12 @@ void RGBController_HyperXAlloyOrigins::DeviceUpdateLEDs()
hyperx->SetLEDsDirect(colors);
}
void RGBController_HyperXAlloyOrigins::UpdateZoneLEDs(int zone)
void RGBController_HyperXAlloyOrigins::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_HyperXAlloyOrigins::UpdateSingleLED(int led)
void RGBController_HyperXAlloyOrigins::UpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}
@@ -96,7 +96,15 @@ void RGBController_HyperXPulsefireSurge::SetupZones()
for(unsigned int led_idx = 0; led_idx < zones[zone_idx].leds_count; led_idx++)
{
led new_led;
new_led.name = zones[zone_idx].name + " LED";
new_led.name = zones[zone_idx].name;
if(zones[zone_idx].leds_count > 1)
{
new_led.name.append(" LED ");
new_led.name.append(std::to_string(led_idx + 1));
}
leds.push_back(new_led);
}
}
+2 -2
View File
@@ -57,7 +57,7 @@ RGBController_LogitechG203::RGBController_LogitechG203(LogitechG203Controller* l
void RGBController_LogitechG203::SetupZones()
{
zone g203_zone;
g203_zone.name = "Mouse Zone";
g203_zone.name = "Mouse";
g203_zone.type = ZONE_TYPE_SINGLE;
g203_zone.leds_min = 1;
g203_zone.leds_max = 1;
@@ -66,7 +66,7 @@ void RGBController_LogitechG203::SetupZones()
zones.push_back(g203_zone);
led g203_led;
g203_led.name = "Mouse LED";
g203_led.name = "Mouse";
leds.push_back(g203_led);
SetupColors();
+4 -4
View File
@@ -57,7 +57,7 @@ RGBController_LogitechG403::RGBController_LogitechG403(LogitechG403Controller* l
void RGBController_LogitechG403::SetupZones()
{
zone G403_wheel_zone;
G403_wheel_zone.name = "Mouse Wheel Zone";
G403_wheel_zone.name = "Scroll Wheel";
G403_wheel_zone.type = ZONE_TYPE_SINGLE;
G403_wheel_zone.leds_min = 1;
G403_wheel_zone.leds_max = 1;
@@ -66,11 +66,11 @@ void RGBController_LogitechG403::SetupZones()
zones.push_back(G403_wheel_zone);
led G403_wheel_led;
G403_wheel_led.name = "Mouse Wheel LED";
G403_wheel_led.name = "Scroll Wheel";
leds.push_back(G403_wheel_led);
zone G403_logo_zone;
G403_logo_zone.name = "Logo Zone";
G403_logo_zone.name = "Logo";
G403_logo_zone.type = ZONE_TYPE_SINGLE;
G403_logo_zone.leds_min = 1;
G403_logo_zone.leds_max = 1;
@@ -79,7 +79,7 @@ void RGBController_LogitechG403::SetupZones()
zones.push_back(G403_logo_zone);
led G403_logo_led;
G403_logo_led.name = "Logo LED";
G403_logo_led.name = "Logo";
leds.push_back(G403_logo_led);
SetupColors();
@@ -57,7 +57,7 @@ RGBController_LogitechG502PS::RGBController_LogitechG502PS(LogitechG502PSControl
void RGBController_LogitechG502PS::SetupZones()
{
zone G502_PS_side_zone;
G502_PS_side_zone.name = "Mouse Side Zone";
G502_PS_side_zone.name = "DPI";
G502_PS_side_zone.type = ZONE_TYPE_SINGLE;
G502_PS_side_zone.leds_min = 1;
G502_PS_side_zone.leds_max = 1;
@@ -66,11 +66,11 @@ void RGBController_LogitechG502PS::SetupZones()
zones.push_back(G502_PS_side_zone);
led G502_PS_side_led;
G502_PS_side_led.name = "Mouse Wheel LED";
G502_PS_side_led.name = "DPI";
leds.push_back(G502_PS_side_led);
zone G502_logo_zone;
G502_logo_zone.name = "Logo Zone";
G502_logo_zone.name = "Logo";
G502_logo_zone.type = ZONE_TYPE_SINGLE;
G502_logo_zone.leds_min = 1;
G502_logo_zone.leds_max = 1;
@@ -79,7 +79,7 @@ void RGBController_LogitechG502PS::SetupZones()
zones.push_back(G502_logo_zone);
led G502_logo_led;
G502_logo_led.name = "Logo LED";
G502_logo_led.name = "Logo";
leds.push_back(G502_logo_led);
SetupColors();
+1 -1
View File
@@ -286,7 +286,7 @@ void RGBController_LogitechG810::DeviceUpdateLEDs()
/*---------------------------------------------------------*\
| TODO: Send packets with multiple LED frames |
\*---------------------------------------------------------*/
for(int led_idx = 0; led_idx < leds.size(); led_idx++)
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
{
zone = ( leds[led_idx].value >> 8 );
idx = ( leds[led_idx].value & 0xFF );
@@ -0,0 +1,109 @@
/*-----------------------------------------*\
| RGBController_LogitechGPowerPlay.cpp |
| |
| Generic RGB Interface for |
| Logitech G PowerPlay Wireless Mousemat |
| |
| TheRogueZeta 8/31/2020 |
\*-----------------------------------------*/
#include "RGBController_LogitechGPowerPlay.h"
RGBController_LogitechGPowerPlay::RGBController_LogitechGPowerPlay(LogitechGPowerPlayController* logitech_ptr)
{
logitech = logitech_ptr;
name = "Logitech G PowerPlay Wireless Charging System";
type = DEVICE_TYPE_MOUSEMAT;
description = "Logitech G PowerPlay Wireless Charging System";
mode Off;
Off.name = "Off";
Off.value = LOGITECH_G_POWERPLAY_MODE_OFF;
Off.flags = 0;
Off.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Off);
mode Static;
Static.name = "Static";
Static.value = LOGITECH_G_POWERPLAY_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Cycle;
Cycle.name = "Cycle";
Cycle.value = LOGITECH_G_POWERPLAY_MODE_CYCLE;
Cycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS;
Cycle.color_mode = MODE_COLORS_PER_LED;
Cycle.speed_min = LOGITECH_G_POWERPLAY_SPEED_SLOWEST;
Cycle.speed_max = LOGITECH_G_POWERPLAY_SPEED_FASTEST;
Cycle.speed = LOGITECH_G_POWERPLAY_SPEED_NORMAL;
modes.push_back(Cycle);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = LOGITECH_G_POWERPLAY_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS;
Breathing.color_mode = MODE_COLORS_PER_LED;
Breathing.speed_min = LOGITECH_G_POWERPLAY_SPEED_SLOWEST;
Breathing.speed_max = LOGITECH_G_POWERPLAY_SPEED_FASTEST;
Breathing.speed = LOGITECH_G_POWERPLAY_SPEED_NORMAL;
modes.push_back(Breathing);
SetupZones();
}
void RGBController_LogitechGPowerPlay::SetupZones()
{
zone GPowerPlay_logo_zone;
GPowerPlay_logo_zone.name = "Logo";
GPowerPlay_logo_zone.type = ZONE_TYPE_SINGLE;
GPowerPlay_logo_zone.leds_min = 1;
GPowerPlay_logo_zone.leds_max = 1;
GPowerPlay_logo_zone.leds_count = 1;
GPowerPlay_logo_zone.matrix_map = NULL;
zones.push_back(GPowerPlay_logo_zone);
led GPowerPlay_logo_led;
GPowerPlay_logo_led.name = "Logo";
leds.push_back(GPowerPlay_logo_led);
SetupColors();
}
void RGBController_LogitechGPowerPlay::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_LogitechGPowerPlay::DeviceUpdateLEDs()
{
UpdateZoneLEDs(0);
}
void RGBController_LogitechGPowerPlay::UpdateZoneLEDs(int zone)
{
unsigned char red = RGBGetRValue(colors[zone]);
unsigned char grn = RGBGetGValue(colors[zone]);
unsigned char blu = RGBGetBValue(colors[zone]);
logitech->SendMouseMatMode(modes[active_mode].value, modes[active_mode].speed, zone, red, grn, blu);
}
void RGBController_LogitechGPowerPlay::UpdateSingleLED(int led)
{
UpdateZoneLEDs(led);
}
void RGBController_LogitechGPowerPlay::SetCustomMode()
{
}
void RGBController_LogitechGPowerPlay::DeviceUpdateMode()
{
DeviceUpdateLEDs();
}
@@ -0,0 +1,32 @@
/*-----------------------------------------*\
| RGBController_LogitechGPowerPlay.h |
| |
| Generic RGB Interface for |
| Logitech G PowerPlay Wireless Mousemat |
| |
| TheRogueZeta 8/31/2020 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "LogitechGPowerPlayController.h"
class RGBController_LogitechGPowerPlay : public RGBController
{
public:
RGBController_LogitechGPowerPlay(LogitechGPowerPlayController* logitech_ptr);
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
LogitechGPowerPlayController* logitech;
};
@@ -56,21 +56,8 @@ RGBController_LogitechGProWireless::RGBController_LogitechGProWireless(LogitechG
void RGBController_LogitechGProWireless::SetupZones()
{
zone GProWireless_logo_zone;
GProWireless_logo_zone.name = "Logo Zone";
GProWireless_logo_zone.type = ZONE_TYPE_SINGLE;
GProWireless_logo_zone.leds_min = 1;
GProWireless_logo_zone.leds_max = 1;
GProWireless_logo_zone.leds_count = 1;
GProWireless_logo_zone.matrix_map = NULL;
zones.push_back(GProWireless_logo_zone);
led GProWireless_logo_led;
GProWireless_logo_led.name = "Logo LED";
leds.push_back(GProWireless_logo_led);
zone GProWireless_primary_zone;
GProWireless_primary_zone.name = "DPI Zone";
GProWireless_primary_zone.name = "DPI";
GProWireless_primary_zone.type = ZONE_TYPE_SINGLE;
GProWireless_primary_zone.leds_min = 1;
GProWireless_primary_zone.leds_max = 1;
@@ -79,9 +66,22 @@ void RGBController_LogitechGProWireless::SetupZones()
zones.push_back(GProWireless_primary_zone);
led GProWireless_primary_led;
GProWireless_primary_led.name = "DPI LED";
GProWireless_primary_led.name = "DPI";
leds.push_back(GProWireless_primary_led);
zone GProWireless_logo_zone;
GProWireless_logo_zone.name = "Logo";
GProWireless_logo_zone.type = ZONE_TYPE_SINGLE;
GProWireless_logo_zone.leds_min = 1;
GProWireless_logo_zone.leds_max = 1;
GProWireless_logo_zone.leds_count = 1;
GProWireless_logo_zone.matrix_map = NULL;
zones.push_back(GProWireless_logo_zone);
led GProWireless_logo_led;
GProWireless_logo_led.name = "Logo";
leds.push_back(GProWireless_logo_led);
SetupColors();
}
+12 -6
View File
@@ -8,6 +8,7 @@
\*-----------------------------------------*/
#include "RGBController_OpenRazer.h"
#include "OpenRazerDevices.h"
#include <fstream>
#include <unistd.h>
@@ -398,9 +399,9 @@ void RGBController_OpenRazer::SetupZones()
new_map->map = new unsigned int[new_map->height * new_map->width];
for(int y = 0; y < new_map->height; y++)
for(unsigned int y = 0; y < new_map->height; y++)
{
for(int x = 0; x < new_map->width; x++)
for(unsigned int x = 0; x < new_map->width; x++)
{
new_map->map[(y * new_map->width) + x] = (y * new_map->width) + x;
}
@@ -423,12 +424,17 @@ void RGBController_OpenRazer::SetupZones()
{
led* new_led = new led();
new_led->name = device_list[device_index]->zones[zone_id]->name + " LED ";
new_led->name.append(std::to_string(col_id + 1));
new_led->name = device_list[device_index]->zones[zone_id]->name;
if(zones[zone_id].leds_count > 1)
{
new_led->name.append(" LED ");
new_led->name.append(std::to_string(col_id + 1));
}
if(device_list[device_index]->keymap != NULL)
{
for(int i = 0; i < device_list[device_index]->keymap_size; i++)
for(unsigned int i = 0; i < device_list[device_index]->keymap_size; i++)
{
if(zone_id == device_list[device_index]->keymap[i].zone &&
row_id == device_list[device_index]->keymap[i].row &&
@@ -468,7 +474,7 @@ void RGBController_OpenRazer::SetCustomMode()
\*---------------------------------------------------------*/
else
{
for(int i = 0; i < modes.size(); i++)
for(unsigned int i = 0; i < modes.size(); i++)
{
if(modes[i].value == RAZER_MODE_STATIC)
{
-1
View File
@@ -10,7 +10,6 @@
#pragma once
#include "RGBController.h"
#include "OpenRazerDevices.h"
#include <fstream>
@@ -346,9 +346,9 @@ void RGBController_OpenRazer::SetupZones()
new_map->map = new unsigned int[new_map->height * new_map->width];
for(int y = 0; y < new_map->height; y++)
for(unsigned int y = 0; y < new_map->height; y++)
{
for(int x = 0; x < new_map->width; x++)
for(unsigned int x = 0; x < new_map->width; x++)
{
new_map->map[(y * new_map->width) + x] = (y * new_map->width) + x;
}
@@ -371,12 +371,17 @@ void RGBController_OpenRazer::SetupZones()
{
led* new_led = new led();
new_led->name = device_list[device_index]->zones[zone_id]->name + " LED ";
new_led->name.append(std::to_string(col_id + 1));
new_led->name = device_list[device_index]->zones[zone_id]->name;
if(zones[zone_id].leds_count > 1)
{
new_led->name.append(" LED ");
new_led->name.append(std::to_string(col_id + 1));
}
if(device_list[device_index]->keymap != NULL)
{
for(int i = 0; i < device_list[device_index]->keymap_size; i++)
for(unsigned int i = 0; i < device_list[device_index]->keymap_size; i++)
{
if(zone_id == device_list[device_index]->keymap[i].zone &&
row_id == device_list[device_index]->keymap[i].row &&
@@ -416,7 +421,7 @@ void RGBController_OpenRazer::SetCustomMode()
\*---------------------------------------------------------*/
else
{
for(int i = 0; i < modes.size(); i++)
for(unsigned int i = 0; i < modes.size(); i++)
{
if(modes[i].value == RAZER_MODE_STATIC)
{
+283 -66
View File
@@ -12,10 +12,20 @@
#define ASROCK_MAX_ZONES 4
#define ASROCK_MAX_LEDS 22
static const char* polychrome_v1_zone_names[] =
{
"RGB LED 1 Header",
"RGB LED 2 Header",
"PCH",
"IO Cover",
"Audio",
"Addressable Header"
};
static const char* polychrome_v2_zone_names[] =
{
"RGB Fan Header",
"RGB LED Header",
"RGB LED 1 Header",
"RGB LED 2 Header",
"Audio",
"PCH",
"IO Cover",
@@ -30,6 +40,7 @@ RGBController_Polychrome::RGBController_Polychrome(PolychromeController* polychr
version = polychrome->GetFirmwareVersion();
type = DEVICE_TYPE_MOTHERBOARD;
description = "ASRock ASR LED/Polychrome Device";
location = polychrome->GetDeviceLocation();
switch(polychrome->GetASRockType())
{
@@ -61,7 +72,7 @@ RGBController_Polychrome::RGBController_Polychrome(PolychromeController* polychr
mode Strobe;
Strobe.name = "Strobe";
Strobe.value = ASRLED_MODE_FLASHING;
Strobe.value = ASRLED_MODE_STROBE;
Strobe.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
Strobe.speed_min = ASRLED_SPEED_MIN;
Strobe.speed_max = ASRLED_SPEED_MAX;
@@ -109,136 +120,283 @@ RGBController_Polychrome::RGBController_Polychrome(PolychromeController* polychr
break;
case ASROCK_TYPE_POLYCHROME_V1:
{
mode Off;
Off.name = "Off";
Off.value = POLYCHROME_V1_MODE_OFF;
Off.flags = 0;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
mode Static;
Static.name = "Static";
Static.value = POLYCHROME_V1_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = POLYCHROME_V1_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
Breathing.speed_min = POLYCHROME_V1_SPEED_MIN_BREATHING;
Breathing.speed_max = POLYCHROME_V1_SPEED_MAX_BREATHING;
Breathing.speed = POLYCHROME_V1_SPEED_DEFAULT_BREATHING;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
mode Strobe;
Strobe.name = "Strobe";
Strobe.value = POLYCHROME_V1_MODE_STROBE;
Strobe.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
Strobe.speed_min = POLYCHROME_V1_SPEED_MIN_STROBE;
Strobe.speed_max = POLYCHROME_V1_SPEED_MAX_STROBE;
Strobe.speed = POLYCHROME_V1_SPEED_DEFAULT_STROBE;
Strobe.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Strobe);
mode SpectrumCycle;
SpectrumCycle.name = "Spectrum Cycle";
SpectrumCycle.value = POLYCHROME_V1_MODE_SPECTRUM_CYCLE;
SpectrumCycle.flags = MODE_FLAG_HAS_SPEED;
SpectrumCycle.speed_min = POLYCHROME_V1_SPEED_MIN_CYCLE;
SpectrumCycle.speed_max = POLYCHROME_V1_SPEED_MAX_CYCLE;
SpectrumCycle.speed = POLYCHROME_V1_SPEED_DEFAULT_CYCLE;
SpectrumCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(SpectrumCycle);
mode Random;
Random.name = "Random";
Random.value = POLYCHROME_V1_MODE_RANDOM;
Random.flags = MODE_FLAG_HAS_SPEED;
Random.speed_min = POLYCHROME_V1_SPEED_MIN_RANDOM;
Random.speed_max = POLYCHROME_V1_SPEED_MAX_RANDOM;
Random.speed = POLYCHROME_V1_SPEED_DEFAULT_RANDOM;
Random.color_mode = MODE_COLORS_NONE;
modes.push_back(Random);
mode Music;
Music.name = "Music";
Music.value = POLYCHROME_V1_MODE_MUSIC;
Music.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Music.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Music);
mode Wave;
Wave.name = "Wave";
Wave.value = POLYCHROME_V1_MODE_WAVE;
Wave.flags = MODE_FLAG_HAS_SPEED;
Wave.speed_min = POLYCHROME_V1_SPEED_MIN_WAVE;
Wave.speed_max = POLYCHROME_V1_SPEED_MAX_WAVE;
Wave.speed = POLYCHROME_V1_SPEED_DEFAULT_WAVE;
Wave.color_mode = MODE_COLORS_NONE;
modes.push_back(Wave);
/*---------------------------------------------------------------------*\
| Comment out until per zone modes are working. These are only for ARGB |
\*---------------------------------------------------------------------*/
// mode Spring;
// Spring.name = "Spring";
// Spring.value = POLYCHROME_V1_MODE_SPRING;
// Spring.flags = MODE_FLAG_HAS_SPEED;
// Spring.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
// Spring.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
// Spring.speed = POLYCHROME_V1_SPEED_DEFAULT_SPRING;
// Spring.color_mode = MODE_COLORS_PER_LED;
// modes.push_back(Spring);
// mode Stack;
// Stack.name = "Stack";
// Stack.value = POLYCHROME_V1_MODE_STACK;
// Stack.flags = MODE_FLAG_HAS_SPEED;
// Stack.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
// Stack.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
// Stack.speed = POLYCHROME_V1_SPEED_DEFAULT_STACK;
// Stack.color_mode = MODE_COLORS_PER_LED;
// modes.push_back(Stack);
// mode Cram;
// Cram.name = "Cram";
// Cram.value = POLYCHROME_V1_MODE_CRAM;
// Cram.flags = MODE_FLAG_HAS_SPEED;
// Cram.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
// Cram.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
// Cram.speed = POLYCHROME_V1_SPEED_DEFAULT_CRAM;
// Cram.color_mode = MODE_COLORS_PER_LED;
// modes.push_back(Cram);
// mode Scan;
// Scan.name = "Scan";
// Scan.value = POLYCHROME_V1_MODE_SCAN;
// Scan.flags = MODE_FLAG_HAS_SPEED;
// Scan.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
// Scan.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
// Scan.speed = POLYCHROME_V1_SPEED_DEFAULT_SCAN;
// Scan.color_mode = MODE_COLORS_PER_LED;
// modes.push_back(Scan);
// mode Neon;
// Neon.name = "Neon";
// Neon.value = POLYCHROME_V1_MODE_NEON;
// Neon.flags = MODE_FLAG_HAS_SPEED;
// Neon.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
// Neon.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
// Neon.speed = POLYCHROME_V1_SPEED_DEFAULT_NEON;
// Neon.color_mode = MODE_COLORS_PER_LED;
// modes.push_back(Neon);
// mode Water;
// Water.name = "Water";
// Water.value = POLYCHROME_V1_MODE_WATER;
// Water.flags = MODE_FLAG_HAS_SPEED;
// Water.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
// Water.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
// Water.speed = POLYCHROME_V1_SPEED_DEFAULT_WATER;
// Water.color_mode = MODE_COLORS_PER_LED;
// modes.push_back(Water);
// mode Rainbow;
// Rainbow.name = "Rainbow";
// Rainbow.value = POLYCHROME_V1_MODE_RAINBOW;
// Rainbow.flags = MODE_FLAG_HAS_SPEED;
// Rainbow.speed_min = POLYCHROME_V1_SPEED_MIN_RAINBOW;
// Rainbow.speed_max = POLYCHROME_V1_SPEED_MAX_RAINBOW;
// Rainbow.speed = POLYCHROME_V1_SPEED_DEFAULT_RAINBOW;
// Rainbow.color_mode = MODE_COLORS_NONE;
// modes.push_back(Rainbow);
}
break;
case ASROCK_TYPE_POLYCHROME_V2:
{
mode Off;
Off.name = "Off";
Off.value = POLYCHROME_MODE_OFF;
Off.value = POLYCHROME_V2_MODE_OFF;
Off.flags = 0;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
mode Static;
Static.name = "Static";
Static.value = POLYCHROME_MODE_STATIC;
Static.value = POLYCHROME_V2_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = POLYCHROME_MODE_BREATHING;
Breathing.value = POLYCHROME_V2_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
Breathing.speed_min = POLYCHROME_SPEED_MIN;
Breathing.speed_max = POLYCHROME_SPEED_MAX;
Breathing.speed = POLYCHROME_SPEED_DEFAULT;
Breathing.speed_min = POLYCHROME_V2_SPEED_MIN;
Breathing.speed_max = POLYCHROME_V2_SPEED_MAX;
Breathing.speed = POLYCHROME_V2_SPEED_DEFAULT;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
mode Strobe;
Strobe.name = "Strobe";
Strobe.value = POLYCHROME_MODE_FLASHING;
Strobe.value = POLYCHROME_V2_MODE_STROBE;
Strobe.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
Strobe.speed_min = POLYCHROME_SPEED_MIN;
Strobe.speed_max = POLYCHROME_SPEED_MAX;
Strobe.speed = POLYCHROME_SPEED_DEFAULT;
Strobe.speed_min = POLYCHROME_V2_SPEED_MIN;
Strobe.speed_max = POLYCHROME_V2_SPEED_MAX;
Strobe.speed = POLYCHROME_V2_SPEED_DEFAULT;
Strobe.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Strobe);
mode SpectrumCycle;
SpectrumCycle.name = "Spectrum Cycle";
SpectrumCycle.value = POLYCHROME_MODE_SPECTRUM_CYCLE;
SpectrumCycle.value = POLYCHROME_V2_MODE_SPECTRUM_CYCLE;
SpectrumCycle.flags = MODE_FLAG_HAS_SPEED;
SpectrumCycle.speed_min = POLYCHROME_SPEED_MIN;
SpectrumCycle.speed_max = POLYCHROME_SPEED_MAX;
SpectrumCycle.speed = POLYCHROME_SPEED_DEFAULT;
SpectrumCycle.speed_min = POLYCHROME_V2_SPEED_MIN;
SpectrumCycle.speed_max = POLYCHROME_V2_SPEED_MAX;
SpectrumCycle.speed = POLYCHROME_V2_SPEED_DEFAULT;
SpectrumCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(SpectrumCycle);
mode Random;
Random.name = "Random";
Random.value = POLYCHROME_MODE_RANDOM;
Random.value = POLYCHROME_V2_MODE_RANDOM;
Random.flags = MODE_FLAG_HAS_SPEED;
Random.speed_min = POLYCHROME_SPEED_MIN;
Random.speed_max = POLYCHROME_SPEED_MAX;
Random.speed = POLYCHROME_SPEED_DEFAULT;
Random.speed_min = POLYCHROME_V2_SPEED_MIN;
Random.speed_max = POLYCHROME_V2_SPEED_MAX;
Random.speed = POLYCHROME_V2_SPEED_DEFAULT;
Random.color_mode = MODE_COLORS_NONE;
modes.push_back(Random);
mode Wave;
Wave.name = "Wave";
Wave.value = POLYCHROME_MODE_WAVE;
Wave.value = POLYCHROME_V2_MODE_WAVE;
Wave.flags = MODE_FLAG_HAS_SPEED;
Wave.speed_min = POLYCHROME_SPEED_MIN;
Wave.speed_max = POLYCHROME_SPEED_MAX;
Wave.speed = POLYCHROME_SPEED_DEFAULT;
Wave.speed_min = POLYCHROME_V2_SPEED_MIN;
Wave.speed_max = POLYCHROME_V2_SPEED_MAX;
Wave.speed = POLYCHROME_V2_SPEED_DEFAULT;
Wave.color_mode = MODE_COLORS_NONE;
modes.push_back(Wave);
mode Spring;
Spring.name = "Spring";
Spring.value = POLYCHROME_MODE_SPRING;
Spring.value = POLYCHROME_V2_MODE_SPRING;
Spring.flags = MODE_FLAG_HAS_SPEED;
Spring.speed_min = POLYCHROME_SPEED_MIN;
Spring.speed_max = POLYCHROME_SPEED_MAX;
Spring.speed = POLYCHROME_SPEED_DEFAULT;
Spring.speed_min = POLYCHROME_V2_SPEED_MIN;
Spring.speed_max = POLYCHROME_V2_SPEED_MAX;
Spring.speed = POLYCHROME_V2_SPEED_DEFAULT;
Spring.color_mode = MODE_COLORS_NONE;
modes.push_back(Spring);
mode Stack;
Stack.name = "Stack";
Stack.value = POLYCHROME_MODE_STACK;
Stack.value = POLYCHROME_V2_MODE_STACK;
Stack.flags = MODE_FLAG_HAS_SPEED;
Stack.speed_min = POLYCHROME_SPEED_MIN;
Stack.speed_max = POLYCHROME_SPEED_MAX;
Stack.speed = POLYCHROME_SPEED_DEFAULT;
Stack.speed_min = POLYCHROME_V2_SPEED_MIN;
Stack.speed_max = POLYCHROME_V2_SPEED_MAX;
Stack.speed = POLYCHROME_V2_SPEED_DEFAULT;
Stack.color_mode = MODE_COLORS_NONE;
modes.push_back(Stack);
mode Cram;
Cram.name = "Cram";
Cram.value = POLYCHROME_MODE_CRAM;
Cram.value = POLYCHROME_V2_MODE_CRAM;
Cram.flags = MODE_FLAG_HAS_SPEED;
Cram.speed_min = POLYCHROME_SPEED_MIN;
Cram.speed_max = POLYCHROME_SPEED_MAX;
Cram.speed = POLYCHROME_SPEED_DEFAULT;
Cram.speed_min = POLYCHROME_V2_SPEED_MIN;
Cram.speed_max = POLYCHROME_V2_SPEED_MAX;
Cram.speed = POLYCHROME_V2_SPEED_DEFAULT;
Cram.color_mode = MODE_COLORS_NONE;
modes.push_back(Cram);
mode Scan;
Scan.name = "Scan";
Scan.value = POLYCHROME_MODE_SCAN;
Scan.value = POLYCHROME_V2_MODE_SCAN;
Scan.flags = MODE_FLAG_HAS_SPEED;
Scan.speed_min = POLYCHROME_SPEED_MIN;
Scan.speed_max = POLYCHROME_SPEED_MAX;
Scan.speed = POLYCHROME_SPEED_DEFAULT;
Scan.speed_min = POLYCHROME_V2_SPEED_MIN;
Scan.speed_max = POLYCHROME_V2_SPEED_MAX;
Scan.speed = POLYCHROME_V2_SPEED_DEFAULT;
Scan.color_mode = MODE_COLORS_NONE;
modes.push_back(Scan);
mode Neon;
Neon.name = "Neon";
Neon.value = POLYCHROME_MODE_NEON;
Neon.value = POLYCHROME_V2_MODE_NEON;
Neon.flags = 0;
Neon.color_mode = MODE_COLORS_NONE;
modes.push_back(Neon);
mode Water;
Water.name = "Water";
Water.value = POLYCHROME_MODE_WATER;
Water.value = POLYCHROME_V2_MODE_WATER;
Water.flags = MODE_FLAG_HAS_SPEED;
Water.speed_min = POLYCHROME_SPEED_MIN;
Water.speed_max = POLYCHROME_SPEED_MAX;
Water.speed = POLYCHROME_SPEED_DEFAULT;
Water.speed_min = POLYCHROME_V2_SPEED_MIN;
Water.speed_max = POLYCHROME_V2_SPEED_MAX;
Water.speed = POLYCHROME_V2_SPEED_DEFAULT;
Water.color_mode = MODE_COLORS_NONE;
modes.push_back(Water);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.value = POLYCHROME_MODE_RAINBOW;
Rainbow.value = POLYCHROME_V2_MODE_RAINBOW;
Rainbow.flags = MODE_FLAG_HAS_SPEED;
Rainbow.speed_min = POLYCHROME_SPEED_MIN;
Rainbow.speed_max = POLYCHROME_SPEED_MAX;
Rainbow.speed = POLYCHROME_SPEED_DEFAULT;
Rainbow.speed_min = POLYCHROME_V2_SPEED_MIN;
Rainbow.speed_max = POLYCHROME_V2_SPEED_MAX;
Rainbow.speed = POLYCHROME_V2_SPEED_DEFAULT;
Rainbow.color_mode = MODE_COLORS_NONE;
modes.push_back(Rainbow);
}
@@ -302,9 +460,9 @@ void RGBController_Polychrome::SetupZones()
case ASROCK_TYPE_POLYCHROME_V2:
{
/*---------------------------------------------------------*\
| Set up zones (ignore addressable zone for now) |
| Set up zones |
\*---------------------------------------------------------*/
for(unsigned int zone_idx = 0; zone_idx < POLYCHROME_ZONE_ADDRESSABLE; zone_idx++)
for(unsigned int zone_idx = 0; zone_idx < POLYCHROME_ZONE_COUNT; zone_idx++)
{
if(polychrome->zone_led_count[zone_idx] > 0)
{
@@ -313,21 +471,38 @@ void RGBController_Polychrome::SetupZones()
/*---------------------------------------------------------*\
| Set zone name to channel name |
\*---------------------------------------------------------*/
new_zone->name = polychrome_v2_zone_names[zone_idx];
if(polychrome->zone_led_count[zone_idx] > 1)
if(polychrome->GetASRockType() == ASROCK_TYPE_POLYCHROME_V1)
{
new_zone->type = ZONE_TYPE_LINEAR;
new_zone->name = polychrome_v1_zone_names[zone_idx];
}
else
{
new_zone->type = ZONE_TYPE_SINGLE;
new_zone->name = polychrome_v2_zone_names[zone_idx];
}
new_zone->leds_min = polychrome->zone_led_count[zone_idx];
new_zone->leds_max = polychrome->zone_led_count[zone_idx];
new_zone->leds_count = polychrome->zone_led_count[zone_idx];
new_zone->matrix_map = NULL;
if(zone_idx == POLYCHROME_ZONE_ADDRESSABLE)
{
new_zone->leds_min = 1;
new_zone->leds_max = 1;
new_zone->leds_count = 1;
}
else
{
new_zone->leds_min = polychrome->zone_led_count[zone_idx];
new_zone->leds_max = polychrome->zone_led_count[zone_idx];
new_zone->leds_count = polychrome->zone_led_count[zone_idx];
}
if(new_zone->leds_count > 1)
{
new_zone->type = ZONE_TYPE_LINEAR;
}
else
{
new_zone->type = ZONE_TYPE_SINGLE;
}
new_zone->matrix_map = NULL;
/*---------------------------------------------------------*\
| Push new zone to zones vector |
@@ -338,21 +513,39 @@ void RGBController_Polychrome::SetupZones()
unsigned int led_count = 0;
/*---------------------------------------------------------*\
| Set up LEDs (ignore addressable zone for now) |
| Set up LEDs |
\*---------------------------------------------------------*/
for(unsigned int zone_idx = 0; zone_idx < POLYCHROME_ZONE_ADDRESSABLE; zone_idx++)
for(unsigned int zone_idx = 0; zone_idx < POLYCHROME_ZONE_COUNT; zone_idx++)
{
if(polychrome->zone_led_count[zone_idx] > 0)
{
for(unsigned int led_idx = 0; led_idx < zones[zone_idx].leds_count; led_idx++)
for(unsigned int led_idx = 0; led_idx < polychrome->zone_led_count[zone_idx]; led_idx++)
{
/*---------------------------------------------------------*\
| Each zone only has one LED |
\*---------------------------------------------------------*/
led* new_led = new led();
new_led->name = polychrome_v2_zone_names[zone_idx];
if(polychrome->GetASRockType() == ASROCK_TYPE_POLYCHROME_V1)
{
new_led->name = polychrome_v1_zone_names[zone_idx];
}
else
{
new_led->name = polychrome_v2_zone_names[zone_idx];
}
new_led->name.append(" " + std::to_string(led_idx + 1));
new_led->value = 0;
if(polychrome->GetASRockType() == ASROCK_TYPE_POLYCHROME_V1)
{
new_led->value = zone_idx;
}
else if(zone_idx == POLYCHROME_ZONE_ADDRESSABLE)
{
new_led->value = 0x19;
}
/*---------------------------------------------------------*\
| Push new LED to LEDs vector |
@@ -360,6 +553,11 @@ void RGBController_Polychrome::SetupZones()
leds.push_back(*new_led);
led_count++;
if(zone_idx == POLYCHROME_ZONE_ADDRESSABLE)
{
break;
}
}
}
}
@@ -396,6 +594,15 @@ void RGBController_Polychrome::UpdateSingleLED(int led)
unsigned char grn = RGBGetGValue(colors[led]);
unsigned char blu = RGBGetBValue(colors[led]);
/*---------------------------------------------------------*\
| If the LED value is non-zero, this LED overrides the LED |
| index |
\*---------------------------------------------------------*/
if(leds[led].value != 0)
{
led = leds[led].value;
}
polychrome->SetColorsAndSpeed(led, red, grn, blu);
}
@@ -406,7 +613,17 @@ void RGBController_Polychrome::SetCustomMode()
void RGBController_Polychrome::DeviceUpdateMode()
{
polychrome->SetMode(modes[active_mode].value, modes[active_mode].speed);
if(polychrome->GetASRockType() == ASROCK_TYPE_POLYCHROME_V1)
{
for(unsigned int led_idx = 0; led_idx <= leds.size(); led_idx++)
{
polychrome->SetMode(led_idx, modes[active_mode].value, modes[active_mode].speed);
}
}
else
{
polychrome->SetMode(0, modes[active_mode].value, modes[active_mode].speed);
}
DeviceUpdateLEDs();
}
@@ -47,12 +47,12 @@ RGBController_RGBFusion2SMBus::RGBController_RGBFusion2SMBus(RGBFusion2SMBusCont
type = DEVICE_TYPE_MOTHERBOARD;
mode Static;
Static.name = "Static";
Static.value = RGB_FUSION_2_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Direct;
Direct.name = "Direct";
Direct.value = RGB_FUSION_2_MODE_STATIC;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Pulse;
Pulse.name = "Pulse";
@@ -203,7 +203,7 @@ void RGBController_RGBFusion2USB::Init_Controller()
std::vector<LedPort> lp = zl->second;
int LED_count = 0; //We're going to count the leds in the zone
bool boolSingleLED = true; //If all the Ledport.count == 1 then the zone is ZONE_TYPE_SINGLE
for(int lp_idx = 0; lp_idx < lp.size(); lp_idx++)
for(std::size_t lp_idx = 0; lp_idx < lp.size(); lp_idx++)
{
int lp_count = lp[lp_idx].count;
boolSingleLED = boolSingleLED && (lp_count == 1); //Is this a single LED zone??
@@ -241,7 +241,7 @@ void RGBController_RGBFusion2USB::SetupZones()
controller->DisableBuiltinEffect(0, 0x3);
}
for(int lp_idx = 0; lp_idx < zones[zone_idx].leds_count; lp_idx++)
for(unsigned int lp_idx = 0; lp_idx < zones[zone_idx].leds_count; lp_idx++)
{
led new_led;
@@ -310,7 +310,7 @@ void RGBController_RGBFusion2USB::UpdateZoneLEDs(int zone)
unsigned char grn = 0;
unsigned char blu = 0;
for(size_t led_idx = 0; led_idx < zones[zone].leds_count; led_idx++)
for(std::size_t led_idx = 0; led_idx < zones[zone].leds_count; led_idx++)
{
/*---------------------------------------------------------*\
| Initialize mode value |
@@ -455,11 +455,12 @@ void RGBController_RGBFusion2USB::DeviceUpdateMode()
int RGBController_RGBFusion2USB::GetLED_Zone(int led_idx)
{
//This may be more useful in the abstract RGBController.cpp
for(int zone_idx = 0; zone_idx < zones.size(); zone_idx++)
for(size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
int zone_start = zones[zone_idx].start_idx;
int zone_end = zone_start + zones[zone_idx].leds_count - 1;
if( zone_start <= led_idx && zone_end >= led_idx)
return(zone_idx);
}
return -1; // NotFound error?
}
+2 -2
View File
@@ -58,7 +58,7 @@ RGBController_RedragonM711::RGBController_RedragonM711(RedragonM711Controller* r
void RGBController_RedragonM711::SetupZones()
{
zone m711_zone;
m711_zone.name = "Mouse Zone";
m711_zone.name = "Mouse";
m711_zone.type = ZONE_TYPE_SINGLE;
m711_zone.leds_min = 1;
m711_zone.leds_max = 1;
@@ -67,7 +67,7 @@ void RGBController_RedragonM711::SetupZones()
zones.push_back(m711_zone);
led m711_led;
m711_led.name = "Mouse LED";
m711_led.name = "Mouse";
leds.push_back(m711_led);
SetupColors();
@@ -50,13 +50,13 @@ void RGBController_SteelSeriesRival::SetupZones()
zones.push_back(logo_zone);
led logo_led;
logo_led.name = "Logo LED";
logo_led.name = "Logo";
leds.push_back(logo_led);
/* Rival 300 extends this by adding another LED + Zone */
if (rival->GetMouseType() == RIVAL_300) {
zone wheel_zone;
wheel_zone.name = "Wheel";
wheel_zone.name = "Scroll Wheel";
wheel_zone.type = ZONE_TYPE_SINGLE;
wheel_zone.leds_min = 1;
wheel_zone.leds_max = 1;
@@ -65,7 +65,7 @@ void RGBController_SteelSeriesRival::SetupZones()
zones.push_back(wheel_zone);
led wheel_led;
wheel_led.name = "Wheel LED";
wheel_led.name = "Scroll Wheel";
leds.push_back(wheel_led);
}
SetupColors();
@@ -105,6 +105,9 @@ void RGBController_SteelSeriesRival::UpdateZoneLEDs(int zone)
case RIVAL_300:
rival->SetColor(zone, red, grn, blu);
break;
default:
break;
}
}
}
@@ -125,7 +128,7 @@ void RGBController_SteelSeriesRival::DeviceUpdateMode()
{
/* Strictly, the device actually does support different modes for the
* different zones, but we don't support that. */
steelseries_type mouse_type = rival->GetMouseType();
//steelseries_type mouse_type = rival->GetMouseType();
switch (modes[active_mode].value)
{
case STEELSERIES_RIVAL_STATIC:
+11 -11
View File
@@ -20,15 +20,6 @@ RGBController_Tecknet::RGBController_Tecknet(TecknetController *_dev)
serial = Tecknet_dev->GetSerial();
location = Tecknet_dev->GetLocation();
mode Off;
Off.name = "Off";
Off.value = TECKNET_MODE_OFF;
Off.color_mode = MODE_COLORS_NONE;
Off.speed_min = TECKNET_SPEED_OFF;
Off.speed_max = TECKNET_SPEED_OFF;
Off.speed = TECKNET_SPEED_OFF;
modes.push_back(Off);
mode Static;
Static.name = "Static";
Static.value = TECKNET_MODE_STATIC;
@@ -39,6 +30,15 @@ RGBController_Tecknet::RGBController_Tecknet(TecknetController *_dev)
Static.speed = TECKNET_SPEED_OFF;
modes.push_back(Static);
mode Off;
Off.name = "Off";
Off.value = TECKNET_MODE_OFF;
Off.color_mode = MODE_COLORS_NONE;
Off.speed_min = TECKNET_SPEED_OFF;
Off.speed_max = TECKNET_SPEED_OFF;
Off.speed = TECKNET_SPEED_OFF;
modes.push_back(Off);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = TECKNET_MODE_BREATHING;
@@ -60,7 +60,7 @@ RGBController_Tecknet::~RGBController_Tecknet()
void RGBController_Tecknet::SetupZones()
{
zone Tecknet_zone;
Tecknet_zone.name = "Tecknet Logo";
Tecknet_zone.name = "Logo";
Tecknet_zone.type = ZONE_TYPE_SINGLE;
Tecknet_zone.leds_min = 1;
Tecknet_zone.leds_max = 1;
@@ -69,7 +69,7 @@ void RGBController_Tecknet::SetupZones()
zones.push_back(Tecknet_zone);
led Tecknet_led;
Tecknet_led.name = "Logo LED";
Tecknet_led.name = "Logo";
leds.push_back(Tecknet_led);
SetupColors();
+69 -22
View File
@@ -23,24 +23,13 @@ ResourceManager::ResourceManager()
{
detection_percent = 100;
detection_string = "";
detection_is_required = false;
DetectDevicesThread = nullptr;
}
ResourceManager::~ResourceManager()
{
ResourceManager::get()->WaitForDeviceDetection();
for(RGBController* rgb_controller : rgb_controllers)
{
delete rgb_controller;
}
for(i2c_smbus_interface* bus : busses)
{
delete bus;
}
DetectDevicesThread->join();
delete DetectDevicesThread;
Cleanup();
}
void ResourceManager::RegisterI2CBus(i2c_smbus_interface *bus)
@@ -104,19 +93,59 @@ void ResourceManager::DeviceListChanged()
unsigned int ResourceManager::GetDetectionPercent()
{
return(detection_percent);
return (detection_percent.load());
}
std::string ResourceManager::GetDetectionString()
const char *ResourceManager::GetDetectionString()
{
return(detection_string);
return (detection_string);
}
void ResourceManager::Cleanup()
{
ResourceManager::get()->WaitForDeviceDetection();
for(RGBController* rgb_controller : rgb_controllers)
{
delete rgb_controller;
}
rgb_controllers.clear();
for(i2c_smbus_interface* bus : busses)
{
delete bus;
}
busses.clear();
if(DetectDevicesThread)
{
DetectDevicesThread->join();
delete DetectDevicesThread;
DetectDevicesThread = nullptr;
}
}
void ResourceManager::DetectDevices()
{
/*-------------------------------------------------*\
| Do nothing is it is already detecting devices |
\*-------------------------------------------------*/
if(detection_is_required.load())
{
return;
}
/*-------------------------------------------------*\
| If there's anything left from the last time, |
| we shall remove it first |
\*-------------------------------------------------*/
detection_percent = 0;
Cleanup();
/*-------------------------------------------------*\
| Start the device detection thread |
\*-------------------------------------------------*/
detection_is_required = true;
DetectDevicesThread = new std::thread(&ResourceManager::DetectDevicesThreadFunction, this);
/*-------------------------------------------------*\
@@ -161,7 +190,7 @@ void ResourceManager::DetectDevicesThreadFunction()
/*-------------------------------------------------*\
| Detect i2c busses |
\*-------------------------------------------------*/
for(int i2c_bus_detector_idx = 0; i2c_bus_detector_idx < i2c_bus_detectors.size(); i2c_bus_detector_idx++)
for(unsigned int i2c_bus_detector_idx = 0; i2c_bus_detector_idx < i2c_bus_detectors.size() && detection_is_required.load(); i2c_bus_detector_idx++)
{
i2c_bus_detectors[i2c_bus_detector_idx](busses);
}
@@ -169,9 +198,9 @@ void ResourceManager::DetectDevicesThreadFunction()
/*-------------------------------------------------*\
| Detect i2c devices |
\*-------------------------------------------------*/
for(int i2c_detector_idx = 0; i2c_detector_idx < i2c_device_detectors.size(); i2c_detector_idx++)
for(unsigned int i2c_detector_idx = 0; i2c_detector_idx < i2c_device_detectors.size() && detection_is_required.load(); i2c_detector_idx++)
{
detection_string = i2c_device_detector_strings[i2c_detector_idx];
detection_string = i2c_device_detector_strings[i2c_detector_idx].c_str();
DeviceListChanged();
bool this_device_disabled = false;
@@ -207,9 +236,9 @@ void ResourceManager::DetectDevicesThreadFunction()
/*-------------------------------------------------*\
| Detect other devices |
\*-------------------------------------------------*/
for(int detector_idx = 0; detector_idx < device_detectors.size(); detector_idx++)
for(unsigned int detector_idx = 0; detector_idx < device_detectors.size() && detection_is_required.load(); detector_idx++)
{
detection_string = device_detector_strings[detector_idx];
detection_string = device_detector_strings[detector_idx].c_str();
DeviceListChanged();
bool this_device_disabled = false;
@@ -243,10 +272,28 @@ void ResourceManager::DetectDevicesThreadFunction()
}
profile_manager.LoadSizeFromProfile("sizes.ors");
/*-------------------------------------------------*\
| Make sure that when the detection is done, |
| progress bar is set to 100% |
\*-------------------------------------------------*/
detection_is_required = false;
detection_percent = 100;
detection_string = "";
DeviceListChanged();
DetectDeviceMutex.unlock();
}
void ResourceManager::StopDeviceDetection()
{
detection_is_required = false;
detection_percent = 100;
detection_string = "Stopping";
}
void ResourceManager::WaitForDeviceDetection()
{
DetectDeviceMutex.lock();
+8 -3
View File
@@ -36,21 +36,26 @@ public:
void RegisterDeviceListChangeCallback(ResourceManagerCallback new_callback, void * new_callback_arg);
unsigned int GetDetectionPercent();
std::string GetDetectionString();
const char* GetDetectionString();
void DeviceListChanged();
void Cleanup();
void DetectDevices();
void DetectDevicesThreadFunction();
void StopDeviceDetection();
void WaitForDeviceDetection();
private:
static std::unique_ptr<ResourceManager> instance;
unsigned int detection_percent;
std::string detection_string;
std::atomic<bool> detection_is_required;
std::atomic<unsigned int> detection_percent;
const char* detection_string;
std::vector<i2c_smbus_interface*> busses;
std::vector<RGBController*> rgb_controllers;
+19 -11
View File
@@ -532,7 +532,7 @@ bool OptionDevice(int *current_device, std::string argument, Options *options, s
}
}
bool OptionZone(int *current_device, int *current_zone, std::string argument, Options *options, std::vector<RGBController *> &rgb_controllers)
bool OptionZone(int *current_device, int *current_zone, std::string argument, Options */*options*/, std::vector<RGBController *> &rgb_controllers)
{
ResourceManager::get()->WaitForDeviceDetection();
@@ -557,7 +557,7 @@ bool OptionZone(int *current_device, int *current_zone, std::string argument, Op
}
}
bool OptionColor(int *currentDev, int *current_zone, std::string argument, Options *options)
bool OptionColor(int *currentDev, int */*current_zone*/, std::string argument, Options *options)
{
DeviceOptions* currentDevOpts = GetDeviceOptionsForDevID(options, *currentDev);
@@ -587,7 +587,7 @@ bool OptionMode(int *currentDev, std::string argument, Options *options)
return true;
}
bool OptionSize(int *current_device, int *current_zone, std::string argument, Options *options, std::vector<RGBController *> &rgb_controllers)
bool OptionSize(int *current_device, int *current_zone, std::string argument, Options */*options*/, std::vector<RGBController *> &rgb_controllers)
{
const unsigned int new_size = std::stoi(argument);
@@ -700,7 +700,7 @@ int ProcessOptions(int argc, char *argv[], Options *options, std::vector<Network
std::string ip = argument.substr(0, pos);
unsigned short port_val;
if(pos == -1)
if(pos == argument.npos)
{
port_val = OPENRGB_SDK_PORT;
}
@@ -748,14 +748,22 @@ int ProcessOptions(int argc, char *argv[], Options *options, std::vector<Network
{
if (argument != "")
{
unsigned short port = std::stoi(argument);
if (port >= 1024 && port <= 65535)
try
{
options->servOpts.port = port;
}
else
int port = std::stoi(argument);
if (port >= 1024 && port <= 65535)
{
options->servOpts.port = port;
}
else
{
std::cout << "Error: Port out of range: " << port << " (1024-65535)" << std::endl;
return RET_FLAG_PRINT_HELP;
}
}
catch(std::invalid_argument& e)
{
std::cout << "Error: port out of range: " << port << " (1024-65535)" << std::endl;
std::cout << "Error: Invalid data in --server-port argument (expected a number in range 1024-65535)" << std::endl;
return RET_FLAG_PRINT_HELP;
}
}
@@ -1016,7 +1024,7 @@ void ApplyOptions(DeviceOptions& options, std::vector<RGBController *> &rgb_cont
void WaitWhileServerOnline(NetworkServer* srv)
{
while (network_server->GetOnline())
while (srv->GetOnline())
{
std::this_thread::sleep_for(1s);
};
+1 -1
View File
@@ -1,4 +1,4 @@
openrgb (0.31.1) UNRELEASED; urgency=medium
openrgb (0.4.0) UNRELEASED; urgency=medium
* Builds from git master. See git history for more information.
+1 -1
View File
@@ -1 +1 @@
openrgb_0.31.1_source.buildinfo misc optional
openrgb_0.4.0_source.buildinfo misc optional
+9 -13
View File
@@ -14,6 +14,7 @@
#include <QStyleOption>
#include <QtCore/qmath.h>
#include <QDebug>
#include <QPainterPath>
ColorWheel::ColorWheel(QWidget *parent) :
QWidget(parent),
@@ -283,11 +284,6 @@ void ColorWheel::paintEvent(QPaintEvent *)
void ColorWheel::drawWheelImage(const QSize &newSize)
{
QStyleOption option;
option.initFrom(this);
QBrush background = option.palette.base();
/*-----------------------------------------------------*\
| Create image canvas |
\*-----------------------------------------------------*/
@@ -296,7 +292,7 @@ void ColorWheel::drawWheelImage(const QSize &newSize)
/*-----------------------------------------------------*\
| Paint the background |
\*-----------------------------------------------------*/
wheelImage.fill(background.color());
wheelImage.fill(Qt::transparent);
/*-----------------------------------------------------*\
| Create rainbow gradient for wheel |
@@ -317,24 +313,24 @@ void ColorWheel::drawWheelImage(const QSize &newSize)
painter.setRenderHint(QPainter::Antialiasing);
/*-----------------------------------------------------*\
| Paint the outer circle |
| Paint the wheel |
\*-----------------------------------------------------*/
int size = qMin(newSize.width(), newSize.height());
x_offset = (newSize.width() - size) / 2;
y_offset = (newSize.height() - size) / 2;
int r = size;
QPainterPath painterpath;
painterpath.addEllipse(QPoint(0,0),r/2-margin,r/2-margin);
painterpath.addEllipse(QPoint(0,0),r/2-margin-wheelWidth,r/2-margin-wheelWidth);
painter.translate(x_offset + (size / 2), y_offset + (size / 2));
QBrush brush(conicalGradient);
painter.setPen(Qt::NoPen);
painter.setBrush(brush);
painter.drawEllipse(QPoint(0,0),r/2-margin,r/2-margin);
/*-----------------------------------------------------*\
| Paint the inner circle |
\*-----------------------------------------------------*/
painter.setBrush(background);
painter.drawEllipse(QPoint(0,0),r/2-margin-wheelWidth,r/2-margin-wheelWidth);
painter.drawPath(painterpath);
/*-----------------------------------------------------*\
| Calculate wheel region and subtract out the inner |
-4
View File
@@ -159,8 +159,6 @@ s32 i2c_smbus_interface::i2c_smbus_write_i2c_block_data(u8 addr, u8 command, u8
s32 i2c_smbus_interface::i2c_smbus_xfer_call(u8 addr, char read_write, u8 command, int size, i2c_smbus_data* data)
{
s32 ret_val = 0;
i2c_smbus_xfer_mutex.lock();
i2c_addr = addr;
@@ -179,8 +177,6 @@ s32 i2c_smbus_interface::i2c_smbus_xfer_call(u8 addr, char read_write, u8 comman
i2c_smbus_done_cv.wait(done_lock, [this]{ return i2c_smbus_done.load(); });
i2c_smbus_done = false;
ret_val = i2c_ret;
i2c_smbus_xfer_mutex.unlock();
return(i2c_ret);
-1
View File
@@ -54,7 +54,6 @@ void i2c_smbus_linux_detect(std::vector<i2c_smbus_interface*> &busses)
if(dir == NULL)
{
closedir(dir);
return;
}
+1 -1
View File
@@ -190,7 +190,7 @@ int main(int argc, char* argv[])
dlg.AddClientTab();
for(int client_idx = 0; client_idx < clients.size(); client_idx++)
for(std::size_t client_idx = 0; client_idx < clients.size(); client_idx++)
{
dlg.AddClient(clients[client_idx]);
}
+8 -6
View File
@@ -216,9 +216,9 @@ void DeviceView::setController(RGBController * controller_ptr)
{
matrix_map_type * map = controller->zones[zone_idx].matrix_map;
for(int led_x = 0; led_x < map->width; led_x++)
for(unsigned int led_x = 0; led_x < map->width; led_x++)
{
for(int led_y = 0; led_y < map->height; led_y++)
for(unsigned int led_y = 0; led_y < map->height; led_y++)
{
unsigned int map_idx = led_y * map->width + led_x;
unsigned int color_idx = map->map[map_idx] + controller->zones[zone_idx].start_idx;
@@ -276,12 +276,12 @@ void DeviceView::setController(RGBController * controller_ptr)
}
else if(controller->leds[color_idx].name == "Key: Space")
{
for(int map_idx2 = map_idx - 1; map_idx2 > led_y * map->width && map->map[map_idx2] == 0xFFFFFFFF; --map_idx2)
for(unsigned int map_idx2 = map_idx - 1; map_idx2 > led_y * map->width && map->map[map_idx2] == 0xFFFFFFFF; --map_idx2)
{
led_pos[color_idx].matrix_x -= atom;
led_pos[color_idx].matrix_w += atom;
}
for(int map_idx2 = map_idx + 1; map_idx2 < (led_y + 1) * map->width && map->map[map_idx2] == 0xFFFFFFFF; ++map_idx2)
for(unsigned int map_idx2 = map_idx + 1; map_idx2 < (led_y + 1) * map->width && map->map[map_idx2] == 0xFFFFFFFF; ++map_idx2)
{
led_pos[color_idx].matrix_w += atom;
}
@@ -294,7 +294,7 @@ void DeviceView::setController(RGBController * controller_ptr)
}
else
{
for(int i = 0; i < controller->zones[zone_idx].leds_count; i++)
for(unsigned int i = 0; i < controller->zones[zone_idx].leds_count; i++)
{
led_pos[i + controller->zones[zone_idx].start_idx].matrix_x = zone_pos[zone_idx].matrix_x + (i % maxCols + ledPadding) * atom;
led_pos[i + controller->zones[zone_idx].start_idx].matrix_y = current_y + (i / maxCols + ledPadding) * atom;
@@ -503,7 +503,9 @@ void DeviceView::paintEvent(QPaintEvent* /* event */)
font.setPixelSize(posh / 2);
painter.setFont(font);
if(currentColor.value() > 127)
unsigned int luma = (unsigned int)(0.2126f * currentColor.red() + 0.7152f * currentColor.green() + 0.0722f * currentColor.blue());
if(luma > 127)
{
painter.setPen(Qt::black);
}
+5 -5
View File
@@ -18,8 +18,8 @@ public:
OpenRGBClientInfoPage::OpenRGBClientInfoPage(std::vector<RGBController *>& control, QWidget *parent) :
QFrame(parent),
controllers(control),
ui(new Ui::OpenRGBClientInfoPageUi)
ui(new Ui::OpenRGBClientInfoPageUi),
controllers(control)
{
/*-----------------------------------------------------*\
| Set initial values for GUI fields |
@@ -80,7 +80,7 @@ void OpenRGBClientInfoPage::UpdateInfo()
/*-----------------------------------------------------*\
| Loop through all clients in list and display them |
\*-----------------------------------------------------*/
for(int client_idx = 0; client_idx < rgb_clients.size(); client_idx++)
for(std::size_t client_idx = 0; client_idx < rgb_clients.size(); client_idx++)
{
/*-----------------------------------------------------*\
| Create the top level tree widget items and display the|
@@ -106,7 +106,7 @@ void OpenRGBClientInfoPage::UpdateInfo()
/*-----------------------------------------------------*\
| Add child items for each device in the client |
\*-----------------------------------------------------*/
for(int dev_idx = 0; dev_idx < rgb_clients[client_idx]->server_controllers.size(); dev_idx++)
for(std::size_t dev_idx = 0; dev_idx < rgb_clients[client_idx]->server_controllers.size(); dev_idx++)
{
/*-----------------------------------------------------*\
| Create child tree widget items and display the device |
@@ -118,7 +118,7 @@ void OpenRGBClientInfoPage::UpdateInfo()
/*-----------------------------------------------------*\
| Add child items for each zone in the device |
\*-----------------------------------------------------*/
for(int zone_idx = 0; zone_idx < rgb_clients[client_idx]->server_controllers[dev_idx]->zones.size(); zone_idx++)
for(std::size_t zone_idx = 0; zone_idx < rgb_clients[client_idx]->server_controllers[dev_idx]->zones.size(); zone_idx++)
{
/*-----------------------------------------------------*\
| Create child tree widget items and display the zone |
+10 -5
View File
@@ -205,6 +205,11 @@ void Ui::OpenRGBDevicePage::on_ZoneBox_currentIndexChanged(int /*index*/)
void Ui::OpenRGBDevicePage::on_LEDBox_currentIndexChanged(int index)
{
if(index < 0)
{
return;
}
/*-----------------------------------------------------*\
| Read selected mode |
\*-----------------------------------------------------*/
@@ -214,11 +219,11 @@ void Ui::OpenRGBDevicePage::on_LEDBox_currentIndexChanged(int index)
{
case MODE_COLORS_PER_LED:
{
int selected_zone = ui->ZoneBox->currentIndex();
bool multiple = index == device->leds.size() + 1;
int selected_zone = ui->ZoneBox->currentIndex();
bool multiple = (std::size_t(index) == (device->leds.size() + 1));
RGBColor color = 0x00000000;
bool updateColor = 0;
RGBColor color = 0x00000000;
bool updateColor = 0;
if(device->zones.size() > 1)
{
@@ -635,7 +640,7 @@ void Ui::OpenRGBDevicePage::UpdateModeUi()
for (std::size_t i = 0; i < device->modes[selected_mode].colors.size(); i++)
{
char id_buf[32];
snprintf(id_buf, 16, "Mode Color %lu", i);
snprintf(id_buf, 16, "Mode Color %u", i);
ui->LEDBox->addItem(id_buf);
}
+57 -21
View File
@@ -11,48 +11,55 @@
using namespace Ui;
static QString GetIconString(device_type type)
static QString GetIconString(device_type type, bool dark)
{
/*-----------------------------------------------------*\
| Return the icon filename string for the given device |
| type value |
\*-----------------------------------------------------*/
QString filename;
switch(type)
{
case DEVICE_TYPE_MOTHERBOARD:
return("motherboard.png");
filename = "motherboard";
break;
case DEVICE_TYPE_DRAM:
return("dram.png");
filename = "dram";
break;
case DEVICE_TYPE_GPU:
return("gpu.png");
filename = "gpu";
break;
case DEVICE_TYPE_COOLER:
return("fan.png");
filename = "fan";
break;
case DEVICE_TYPE_LEDSTRIP:
return("ledstrip.png");
filename = "ledstrip";
break;
case DEVICE_TYPE_KEYBOARD:
return("keyboard.png");
filename = "keyboard";
break;
case DEVICE_TYPE_MOUSE:
return("mouse.png");
filename = "mouse";
break;
case DEVICE_TYPE_MOUSEMAT:
return("mousemat.png");
filename = "mousemat";
break;
case DEVICE_TYPE_HEADSET:
return("headset.png");
filename = "headset";
break;
case DEVICE_TYPE_HEADSET_STAND:
return("headsetstand.png");
filename = "headsetstand";
break;
case DEVICE_TYPE_UNKNOWN:
return("unknown.png");
default:
filename = "unknown";
break;
}
if(dark)
{
filename += "_dark";
}
filename += ".png";
return filename;
}
static void UpdateInfoCallback(void * this_ptr)
@@ -152,6 +159,7 @@ OpenRGBDialog2::OpenRGBDialog2(std::vector<i2c_smbus_interface *>& bus, std::vec
trayIcon->setToolTip("OpenRGB");
trayIcon->setContextMenu(trayIconMenu);
trayIcon->show();
darkTheme = palette().window().color().value() < 127; // Adjust
/*-----------------------------------------------------*\
| Update the profile list |
@@ -159,7 +167,8 @@ OpenRGBDialog2::OpenRGBDialog2(std::vector<i2c_smbus_interface *>& bus, std::vec
UpdateProfileList();
/*-----------------------------------------------------*\
| Update the device list |
| Update the device list and make sure the |
| ProgressBar gets a proper value |
\*-----------------------------------------------------*/
UpdateDevicesList();
}
@@ -185,8 +194,9 @@ void OpenRGBDialog2::AddSoftwareInfoPage()
ui->InformationTabBar->addTab(SoftInfoPage, "");
QString SoftwareLabelString = "<html><table><tr><td width='30'><img src='";
SoftwareLabelString += ":/software.png";
SoftwareLabelString += "' height='16' width='16'></td><td>Software</td></tr></table></html>";
SoftwareLabelString += ":/software";
if(darkTheme) SoftwareLabelString += "_dark";
SoftwareLabelString += ".png' height='16' width='16'></td><td>Software</td></tr></table></html>";
QLabel *SoftwareTabLabel = new QLabel();
SoftwareTabLabel->setText(SoftwareLabelString);
@@ -211,8 +221,9 @@ void OpenRGBDialog2::AddI2CToolsPage()
ui->InformationTabBar->addTab(SMBusToolsPage, "");
QString SMBusToolsLabelString = "<html><table><tr><td width='30'><img src='";
SMBusToolsLabelString += ":/tools.png";
SMBusToolsLabelString += "' height='16' width='16'></td><td>SMBus Tools</td></tr></table></html>";
SMBusToolsLabelString += ":/tools";
if(darkTheme) SMBusToolsLabelString += "_dark";
SMBusToolsLabelString += ".png' height='16' width='16'></td><td>SMBus Tools</td></tr></table></html>";
QLabel *SMBusToolsTabLabel = new QLabel();
SMBusToolsTabLabel->setText(SMBusToolsLabelString);
@@ -282,6 +293,11 @@ void OpenRGBDialog2::ClearDevicesList()
void OpenRGBDialog2::UpdateDevicesList()
{
/*-----------------------------------------------------*\
| Clear on each update |
\*-----------------------------------------------------*/
ClearDevicesList();
/*-----------------------------------------------------*\
| Set up list of devices |
\*-----------------------------------------------------*/
@@ -314,7 +330,7 @@ void OpenRGBDialog2::UpdateDevicesList()
| type and append device name string. |
\*-----------------------------------------------------*/
QString NewLabelString = "<html><table><tr><td width='30'><img src=':/";
NewLabelString += GetIconString(controllers[dev_idx]->type);
NewLabelString += GetIconString(controllers[dev_idx]->type, darkTheme);
NewLabelString += "' height='16' width='16'></td><td>" + QString::fromStdString(controllers[dev_idx]->name) + "</td></tr></table></html>";
QLabel *NewTabLabel = new QLabel();
@@ -341,7 +357,7 @@ void OpenRGBDialog2::UpdateDevicesList()
| type and append device name string. |
\*-----------------------------------------------------*/
QString NewLabelString = "<html><table><tr><td width='30'><img src=':/";
NewLabelString += GetIconString(controllers[dev_idx]->type);
NewLabelString += GetIconString(controllers[dev_idx]->type, darkTheme);
NewLabelString += "' height='16' width='16'></td><td>" + QString::fromStdString(controllers[dev_idx]->name) + "</td></tr></table></html>";
QLabel *NewTabLabel = new QLabel();
@@ -442,7 +458,6 @@ void OpenRGBDialog2::on_QuickWhite()
void OpenRGBDialog2::on_ClientListUpdated()
{
ClearDevicesList();
UpdateDevicesList();
ui->DetectionProgressBar->setValue(ResourceManager::get()->GetDetectionPercent());
@@ -452,6 +467,7 @@ void OpenRGBDialog2::on_ClientListUpdated()
{
ui->DetectionProgressBar->setVisible(false);
ui->DetectionProgressLabel->setVisible(false);
ui->ButtonStopDetection->setVisible(false);
ui->ButtonToggleDeviceView->setVisible(true);
ui->ButtonLoadProfile->setVisible(true);
@@ -608,3 +624,23 @@ void Ui::OpenRGBDialog2::on_ButtonToggleDeviceView_clicked()
device_view_showing = true;
}
}
void Ui::OpenRGBDialog2::on_ButtonStopDetection_clicked()
{
/*---------------------------------------------------------*\
| Notify the detection thread that it has to die |
\*---------------------------------------------------------*/
ResourceManager::get()->StopDeviceDetection();
/*---------------------------------------------------------*\
| Pretend we're done already by hiding the progress bar |
\*---------------------------------------------------------*/
ui->DetectionProgressBar->setVisible(false);
ui->DetectionProgressLabel->setVisible(false);
ui->ButtonStopDetection->setVisible(false);
ui->ButtonLoadProfile->setVisible(true);
ui->ButtonSaveProfile->setVisible(true);
ui->ButtonDeleteProfile->setVisible(true);
ui->ProfileBox->setVisible(true);
}
+2
View File
@@ -73,6 +73,7 @@ private:
void closeEvent(QCloseEvent *event);
bool device_view_showing = false;
bool darkTheme = false;
private slots:
void on_Exit();
@@ -93,6 +94,7 @@ private slots:
void on_ButtonLoadProfile_clicked();
void on_ButtonDeleteProfile_clicked();
void on_ButtonToggleDeviceView_clicked();
void on_ButtonStopDetection_clicked();
};
#endif // OPENRGBDIALOG2_H
+7
View File
@@ -116,6 +116,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonStopDetection">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
+3 -3
View File
@@ -50,7 +50,7 @@ void Ui::OpenRGBSystemInfoPage::on_DetectButton_clicked()
current_index = 0;
}
if(busses.size() > current_index)
if((int)(busses.size()) > current_index)
{
i2c_smbus_interface* bus = busses[current_index];
@@ -80,7 +80,7 @@ void Ui::OpenRGBSystemInfoPage::on_DumpButton_clicked()
current_index = 0;
}
if(busses.size() > current_index)
if((int)(busses.size()) > current_index)
{
i2c_smbus_interface* bus = busses[current_index];
unsigned char address = ui->DumpAddressBox->value();
@@ -98,7 +98,7 @@ void Ui::OpenRGBSystemInfoPage::on_ReadButton_clicked()
current_index = 0;
}
if(busses.size() > current_index)
if((int)(busses.size()) > current_index)
{
i2c_smbus_interface* bus = busses[current_index];
unsigned char address = ui->ReadAddressBox->value();
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 640 B

After

Width:  |  Height:  |  Size: 109 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

After

Width:  |  Height:  |  Size: 164 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

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