Compare commits

...
9 changed files with 1398 additions and 549 deletions
@@ -37,12 +37,12 @@ void DetectLEDStripControllers(std::vector<RGBController*> &rgb_controllers)
#ifdef WIN32
GetModuleFileName(NULL, filename, 2048);
strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str());
strcat(filename, "\\settings.txt");
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, "/settings.txt");
strcat(filename, "/ledstrip.txt");
#endif
//Open settings file
+3 -1
View File
@@ -439,6 +439,7 @@ void DetectHyperXControllers(std::vector<i2c_smbus_interface*> &busses, std::vec
void DetectLEDStripControllers(std::vector<RGBController*> &rgb_controllers);
void DetectOpenRazerControllers(std::vector<RGBController*> &rgb_controllers);
void DetectRazerChromaSDKControllers(std::vector<RGBController*>& rgb_controllers);
void DetectE131Controllers(std::vector<RGBController*> &rgb_controllers);
/******************************************************************************************\
* *
@@ -458,7 +459,8 @@ void DetectRGBControllers(void)
DetectHyperXControllers(busses, rgb_controllers);
DetectLEDStripControllers(rgb_controllers);
DetectE131Controllers(rgb_controllers);
#ifdef WIN32
DetectRazerChromaSDKControllers(rgb_controllers);
#else
+5
View File
@@ -1,5 +1,7 @@
QT += core gui
LIBS += -le131
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = OpenAuraSDK.bin
@@ -39,9 +41,11 @@ SOURCES += \
Controllers/LEDStripController/LEDStripController.cpp \
Controllers/LEDStripController/LEDStripControllerDetect.cpp \
RGBController/OpenRazerDetect.cpp \
RGBController/E131ControllerDetect.cpp \
RGBController/RGBController_Aura.cpp \
RGBController/RGBController_Corsair.cpp \
RGBController/RGBController_CorsairPro.cpp \
RGBController/RGBController_E131.cpp \
RGBController/RGBController_HuePlus.cpp \
RGBController/RGBController_HyperX.cpp \
RGBController/RGBController_LEDStrip.cpp \
@@ -63,6 +67,7 @@ HEADERS += \
RGBController/RGBController_Aura.h \
RGBController/RGBController_Corsair.h \
RGBController/RGBController_CorsairPro.h \
RGBController/RGBController_E131.h \
RGBController/RGBController_HuePlus.h \
RGBController/RGBController_HyperX.h \
RGBController/RGBController_OpenRazer.h
+170
View File
@@ -0,0 +1,170 @@
#include "RGBController.h"
#include "RGBController_E131.h"
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <fstream>
#include <iostream>
#include <string>
#ifndef WIN32
#include <unistd.h>
#include <dirent.h>
#endif
#ifndef WIN32
#define LPSTR char *
#define strtok_s strtok_r
#endif
/******************************************************************************************\
* *
* DetectE131Controllers *
* *
* Detect devices supported by the E131 driver *
* * *
\******************************************************************************************/
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;
bool new_device = false;
//Open settings file
infile.open(filename);
if (infile.good())
{
for (std::string line; std::getline(infile, line); )
{
if (new_device)
{
dev.name = line;
new_device = false;
}
if (line == "")
{
continue;
}
if ((line[0] != ';') && (line[0] != '#') && (line[0] != '/'))
{
char * argument;
char * value;
value = (char *)line.c_str();
argument = strtok_s(value, "=", &value);
//Strip off new line characters if present
argument = strtok(argument, "\r\n");
value = strtok(value, "\r\n");
if(argument)
{
if (strcmp(argument, "e131_device_start") == 0)
{
new_device = true;
}
else if(strcmp(argument, "num_leds") == 0)
{
dev.num_leds = atoi(value);
}
else if(strcmp(argument, "start_universe") == 0)
{
dev.start_universe = atoi(value);
}
else if(strcmp(argument, "start_channel") == 0)
{
dev.start_channel = atoi(value);
}
else if(strcmp(argument, "rgb_order") == 0)
{
if(strcmp(value, "RGB") == 0)
{
dev.rgb_order = E131_RGB_ORDER_RGB;
}
else if(strcmp(value, "RBG") == 0)
{
dev.rgb_order = E131_RGB_ORDER_RBG;
}
else if(strcmp(value, "GRB") == 0)
{
dev.rgb_order = E131_RGB_ORDER_GRB;
}
else if(strcmp(value, "GBR") == 0)
{
dev.rgb_order = E131_RGB_ORDER_GBR;
}
else if(strcmp(value, "BRG") == 0)
{
dev.rgb_order = E131_RGB_ORDER_BRG;
}
else if(strcmp(value, "BGR") == 0)
{
dev.rgb_order = E131_RGB_ORDER_BGR;
}
else
{
dev.rgb_order = atoi(value);
}
}
else if(strcmp(argument, "type") == 0)
{
if(strcmp(value, "SINGLE") == 0)
{
dev.type = ZONE_TYPE_SINGLE;
}
else if(strcmp(value, "LINEAR") == 0)
{
dev.type = ZONE_TYPE_LINEAR;
}
else if(strcmp(value, "MATRIX") == 0)
{
dev.type = ZONE_TYPE_MATRIX;
}
else
{
dev.type = atoi(value);
}
}
else if(strcmp(argument, "e131_device_end") == 0)
{
devices.push_back(dev);
}
}
}
}
if(devices.size() > 0)
{
new_controller = new RGBController_E131(devices);
rgb_controllers.push_back(new_controller);
}
}
} /* DetectLEDStripControllers() */
+1 -1
View File
@@ -104,7 +104,7 @@ void DetectOpenRazerControllers(std::vector<RGBController*> &rgb_controllers)
RGBController_OpenRazer * razer_rgb = new RGBController_OpenRazer(device_string);
if(razer_rgb->device != RGBController_OpenRazer::RAZER_NO_DEVICE)
if(razer_rgb->device != -1)
{
rgb_controllers.push_back(razer_rgb);
}
+193
View File
@@ -0,0 +1,193 @@
/*-----------------------------------------*\
| RGBController_LEDStrip.cpp |
| |
| Generic RGB Interface for OpenAuraSDK |
| E1.31 Streaming ACN interface |
| |
| Adam Honse (CalcProgrammer1) 10/18/2019 |
\*-----------------------------------------*/
#include "RGBController_E131.h"
#include <e131.h>
#include <math.h>
RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
{
name = "E1.31 Streaming ACN Device";
devices = device_list;
unsigned int led_zone_idx = 0;
mode led_mode;
led_mode.name = "Custom";
modes.push_back(led_mode);
sockfd = e131_socket();
for (int i = 0; i < devices.size(); i++)
{
/*-----------------------------------------*\
| Add LEDs |
\*-----------------------------------------*/
for (int led_idx = 0; led_idx < devices[i].num_leds; led_idx++)
{
colors.push_back(0x00000000);
led new_led;
new_led.name = devices[i].name + " LED";
leds.push_back(new_led);
}
/*-----------------------------------------*\
| Add Zones |
\*-----------------------------------------*/
zone led_zone;
led_zone.name = devices[i].name;
led_zone.type = devices[i].type;
std::vector<int> led_zone_map;
for (int led_idx = 0; led_idx < devices[i].num_leds; led_idx++)
{
led_zone_map.push_back(led_zone_idx);
led_zone_idx++;
}
led_zone.map.push_back(led_zone_map);
zones.push_back(led_zone);
/*-----------------------------------------*\
| Add Universes |
\*-----------------------------------------*/
unsigned int total_universes = ceil( ( ( devices[i].num_leds * 3 ) + devices[i].start_channel ) / 512.0f );
for (int univ_idx = 0; univ_idx < total_universes; univ_idx++)
{
unsigned int universe = devices[i].start_universe + univ_idx;
bool universe_exists = false;
for (int pkt_idx = 0; pkt_idx < packets.size(); pkt_idx++)
{
if(universes[pkt_idx] == universe)
{
universe_exists = true;
}
}
if(!universe_exists)
{
e131_packet_t packet;
e131_addr_t dest_addr;
e131_pkt_init(&packet, universe, 512);
e131_multicast_dest(&dest_addr, universe, E131_DEFAULT_PORT);
packets.push_back(packet);
universes.push_back(universe);
dest_addrs.push_back(dest_addr);
}
}
}
}
int RGBController_E131::GetMode()
{
return 0;
}
void RGBController_E131::SetMode(int mode)
{
}
void RGBController_E131::SetCustomMode()
{
}
void RGBController_E131::SetAllLEDs(RGBColor color)
{
for (int i = 0; i < colors.size(); i++)
{
colors[i] = color;
}
UpdateLEDs();
}
void RGBController_E131::SetAllZoneLEDs(int zone, RGBColor color)
{
for (int x = 0; x < zones[zone].map.size(); x++)
{
for (int y = 0; y < zones[zone].map[x].size(); y++)
{
colors[zones[zone].map[x][y]] = color;
}
}
UpdateLEDs();
}
void RGBController_E131::SetLED(int led, RGBColor color)
{
colors[led] = color;
UpdateLEDs();
}
void RGBController_E131::UpdateLEDs()
{
int color_idx = 0;
for(int device_idx = 0; device_idx < devices.size(); device_idx++)
{
unsigned int total_universes = ceil( ( ( devices[device_idx].num_leds * 3 ) + devices[device_idx].start_channel ) / 512.0f );
unsigned int channel_idx = devices[device_idx].start_channel;
unsigned int led_idx = 0;
unsigned int rgb_idx = 0;
bool done = false;
for (int univ_idx = 0; univ_idx < total_universes; univ_idx++)
{
unsigned int universe = devices[device_idx].start_universe + univ_idx;
for(int packet_idx = 0; packet_idx < packets.size(); packet_idx++)
{
if(!done && (universes[packet_idx] == universe))
{
while(!done && (channel_idx <= 512))
{
switch(rgb_idx)
{
case 0:
packets[packet_idx].dmp.prop_val[channel_idx] = RGBGetRValue( colors[color_idx] );
rgb_idx = 1;
break;
case 1:
packets[packet_idx].dmp.prop_val[channel_idx] = RGBGetGValue( colors[color_idx] );
rgb_idx = 2;
break;
case 2:
packets[packet_idx].dmp.prop_val[channel_idx] = RGBGetBValue( colors[color_idx] );
rgb_idx = 0;
led_idx++;
color_idx++;
break;
}
if(led_idx >= devices[device_idx].num_leds)
{
done = true;
}
channel_idx++;
}
}
}
channel_idx = 1;
}
}
for(int packet_idx = 0; packet_idx < packets.size(); packet_idx++)
{
e131_send(sockfd, &packets[packet_idx], &dest_addrs[packet_idx]);
packets[packet_idx].frame.seq_number++;
}
}
+54
View File
@@ -0,0 +1,54 @@
/*-----------------------------------------*\
| RGBController_E131.h |
| |
| Generic RGB Interface for OpenAuraSDK |
| E1.31 Streaming ACN interface |
| |
| Adam Honse (CalcProgrammer1) 10/18/2019 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include <e131.h>
typedef unsigned int e131_rgb_order;
enum
{
E131_RGB_ORDER_RGB,
E131_RGB_ORDER_RBG,
E131_RGB_ORDER_GRB,
E131_RGB_ORDER_GBR,
E131_RGB_ORDER_BRG,
E131_RGB_ORDER_BGR
};
struct E131Device
{
std::string name;
unsigned int num_leds;
unsigned int start_universe;
unsigned int start_channel;
e131_rgb_order rgb_order;
zone_type type;
};
class RGBController_E131 : public RGBController
{
public:
RGBController_E131(std::vector<E131Device> device_list);
int GetMode();
void SetMode(int mode);
void SetCustomMode();
void SetAllLEDs(RGBColor color);
void SetAllZoneLEDs(int zone, RGBColor color);
void SetLED(int led, RGBColor color);
void UpdateLEDs();
private:
std::vector<E131Device> devices;
std::vector<e131_packet_t> packets;
std::vector<e131_addr_t> dest_addrs;
std::vector<unsigned int> universes;
int sockfd;
};
+107 -519
View File
@@ -10,7 +10,7 @@
#include "RGBController_OpenRazer.h"
#include <fstream>
#include <unistd.h>
int RGBController_OpenRazer::GetMode()
{
return(0);
@@ -96,28 +96,30 @@ void RGBController_OpenRazer::UpdateLEDs()
{
case RAZER_TYPE_MATRIX_FRAME:
case RAZER_TYPE_MATRIX_NOFRAME:
case RAZER_TYPE_MATRIX_STATIC:
{
char update_value = 1;
for (int row = 0; row < matrix_rows; row++)
{
unsigned int output_array_size;
unsigned int output_offset;
unsigned int row_offset = (row * matrix_cols);
if(type == RAZER_TYPE_MATRIX_NOFRAME)
{
output_array_size = 3;
output_offset = 0;
}
else
if(type == RAZER_TYPE_MATRIX_FRAME)
{
output_array_size = 3 + (matrix_cols* 3);
output_offset = 3;
}
else
{
output_array_size = 3;
output_offset = 0;
}
char output_array[output_array_size];
char update_value = 1;
if(type != RAZER_TYPE_MATRIX_NOFRAME)
if(type == RAZER_TYPE_MATRIX_FRAME)
{
output_array[0] = row;
output_array[1] = 0;
@@ -132,19 +134,28 @@ void RGBController_OpenRazer::UpdateLEDs()
output_array[(col * 3) + 2 + output_offset] = (char)RGBGetBValue(colors[color_idx]);
}
if(type == RAZER_TYPE_MATRIX_NOFRAME)
if(type == RAZER_TYPE_MATRIX_FRAME)
{
matrix_custom_frame.write(output_array, output_array_size);
matrix_custom_frame.flush();
}
else if(type == RAZER_TYPE_MATRIX_NOFRAME)
{
matrix_effect_custom.write(output_array, output_array_size);
matrix_effect_custom.flush();
}
else
{
matrix_custom_frame.write(output_array, output_array_size);
matrix_custom_frame.flush();
matrix_effect_custom.write(&update_value, 1);
matrix_effect_custom.flush();
matrix_effect_static.write(output_array, output_array_size);
matrix_effect_static.flush();
}
}
if(type == RAZER_TYPE_MATRIX_FRAME)
{
matrix_effect_custom.write(&update_value, 1);
matrix_effect_custom.flush();
}
}
break;
@@ -220,74 +231,6 @@ static std::string GetDeviceTypeString(std::string dev_path)
return(ret_str);
}
unsigned int RGBController_OpenRazer::GetTypeFromDeviceName(std::string dev_name)
{
if(dev_name == "Razer Mamba Tournament Edition")
{
return(RAZER_MAMBA_TOURNAMENT_EDITION_CHROMA);
}
else if(dev_name == "Razer DeathAdder Chroma")
{
return(RAZER_DEATHADDER_CHROMA);
}
else if(dev_name == "Razer Diamondback Chroma")
{
return(RAZER_DIAMONDBACK_CHROMA);
}
else if(dev_name == "Razer DeathStalker Chroma")
{
return(RAZER_DEATHSTALKER_CHROMA);
}
else if(dev_name == "Razer Tartarus Chroma")
{
return(RAZER_TARTARUS_CHROMA);
}
else if(dev_name == "Razer Core")
{
return(RAZER_CORE);
}
else if(dev_name == "Razer Firefly")
{
return(RAZER_FIREFLY_CHROMA);
}
else if(dev_name == "Razer Goliathus Extended")
{
return(RAZER_GOLIATHUS_EXTENDED_CHROMA);
}
else if(dev_name == "Razer Chroma Mug Holder")
{
return(RAZER_MUG_HOLDER);
}
else if(dev_name == "Razer Kraken 7.1 Chroma")
{
return(RAZER_KRAKEN_V1);
}
else if(dev_name == "Razer Kraken 7.1 V2")
{
return(RAZER_KRAKEN_V2);
}
else if(dev_name == "Razer Chroma HDK")
{
return(RAZER_CHROMA_HDK);
}
else
{
return(RAZER_NO_DEVICE);
}
}
void RGBController_OpenRazer::SetupMatrixDevice(std::string dev_path, unsigned int rows, unsigned int cols)
{
matrix_custom_frame.open(dev_path + "/matrix_custom_frame");
@@ -301,7 +244,17 @@ void RGBController_OpenRazer::SetupMatrixDevice(std::string dev_path, unsigned i
if(!matrix_custom_frame)
{
type = RAZER_TYPE_MATRIX_NOFRAME;
if(!matrix_effect_custom)
{
type = RAZER_TYPE_MATRIX_STATIC;
}
else
{
type = RAZER_TYPE_MATRIX_NOFRAME;
}
matrix_rows = 1;
matrix_cols = 1;
}
else
{
@@ -324,459 +277,94 @@ void RGBController_OpenRazer::SetupNonMatrixDevice(std::string dev_path)
RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
{
unsigned int led_count = 0;
/*-----------------------------------------------------------------*\
| Start device at -1. This indicates the device was not detected |
\*-----------------------------------------------------------------*/
device = -1;
/*-----------------------------------------------------------------*\
| Get the device name from the OpenRazer driver |
\*-----------------------------------------------------------------*/
name = GetDeviceTypeString(dev_path);
device = GetTypeFromDeviceName(name);
mode razer_modes[RAZER_NUM_MODES];
razer_modes[0].name = "Custom";
razer_modes[1].name = "Off";
razer_modes[2].name = "Static";
razer_modes[3].name = "Breathing";
razer_modes[4].name = "Spectrum Cycle";
razer_modes[5].name = "Wave";
razer_modes[6].name = "Reactive";
for (int i = 0; i < RAZER_NUM_MODES; i++)
/*-----------------------------------------------------------------*\
| Loop through all known devices to look for a name match |
\*-----------------------------------------------------------------*/
for (int i = 0; i < RAZER_NUM_DEVICES; i++)
{
modes.push_back(razer_modes[i]);
}
if (device_list[i]->name == name)
{
/*---------------------------------------------------------*\
| Set device ID |
\*---------------------------------------------------------*/
device = i;
switch(device)
{
case RAZER_MAMBA_TOURNAMENT_EDITION_CHROMA:
/*---------------------------------------------------------*\
| Initialize modes |
\*---------------------------------------------------------*/
mode razer_modes[RAZER_NUM_MODES];
razer_modes[0].name = "Custom";
razer_modes[1].name = "Off";
razer_modes[2].name = "Static";
razer_modes[3].name = "Breathing";
razer_modes[4].name = "Spectrum Cycle";
razer_modes[5].name = "Wave";
razer_modes[6].name = "Reactive";
for (int i = 0; i < RAZER_NUM_MODES; i++)
{
SetupMatrixDevice(dev_path, 1, 16);
for (int i = 0; i < 16; i++)
{
RGBColor new_color = 0x00000000;
colors.push_back(new_color);
}
for (int i = 0; i < 7; i++)
{
led* new_led = new led();
new_led->name = "Left Strip";
leds.push_back(*new_led);
}
for (int i = 7; i < 14; i++)
{
led* new_led = new led();
new_led->name = "Right Strip";
leds.push_back(*new_led);
}
{
led* new_led = new led();
new_led->name = "Logo";
leds.push_back(*new_led);
}
{
led* new_led = new led();
new_led->name = "Mouse Wheel";
leds.push_back(*new_led);
}
zone left_zone;
left_zone.name = "Left Strip";
left_zone.type = ZONE_TYPE_LINEAR;
std::vector<int> left_zone_map;
for(int i = 0; i < 7; i++)
{
left_zone_map.push_back(i);
}
left_zone.map.push_back(left_zone_map);
zones.push_back(left_zone);
zone right_zone;
right_zone.name = "Right Strip";
right_zone.type = ZONE_TYPE_LINEAR;
std::vector<int> right_zone_map;
for(int i = 7; i < 14; i++)
{
right_zone_map.push_back(i);
}
right_zone.map.push_back(right_zone_map);
zones.push_back(right_zone);
zone logo_zone;
logo_zone.name = "Logo";
logo_zone.type = ZONE_TYPE_SINGLE;
std::vector<int> logo_zone_map;
logo_zone_map.push_back(14);
logo_zone.map.push_back(logo_zone_map);
zones.push_back(logo_zone);
zone wheel_zone;
wheel_zone.name = "Mouse Wheel";
wheel_zone.type = ZONE_TYPE_SINGLE;
std::vector<int> wheel_zone_map;
wheel_zone_map.push_back(15);
wheel_zone.map.push_back(wheel_zone_map);
zones.push_back(wheel_zone);
modes.push_back(razer_modes[i]);
}
break;
case RAZER_DIAMONDBACK_CHROMA:
/*---------------------------------------------------------*\
| Initialize file descriptors |
\*---------------------------------------------------------*/
if(device_list[i]->matrix_type == true)
{
SetupMatrixDevice(dev_path, 1, 21);
for (int i = 0; i < 21; i++)
{
RGBColor new_color = 0x00000000;
colors.push_back(new_color);
}
for (int i = 0; i < 9; i++)
{
led* new_led = new led();
new_led->name = "Left Strip";
leds.push_back(*new_led);
}
for (int i = 7; i < 19; i++)
{
led* new_led = new led();
new_led->name = "Right Strip";
leds.push_back(*new_led);
}
{
led* new_led = new led();
new_led->name = "Logo";
leds.push_back(*new_led);
}
{
led* new_led = new led();
new_led->name = "Mouse Wheel";
leds.push_back(*new_led);
}
zone left_zone;
left_zone.name = "Left Strip";
left_zone.type = ZONE_TYPE_LINEAR;
std::vector<int> left_zone_map;
for(int i = 0; i < 9; i++)
{
left_zone_map.push_back(i);
}
left_zone.map.push_back(left_zone_map);
zones.push_back(left_zone);
zone right_zone;
right_zone.name = "Right Strip";
right_zone.type = ZONE_TYPE_LINEAR;
std::vector<int> right_zone_map;
for(int i = 7; i < 19; i++)
{
right_zone_map.push_back(i);
}
right_zone.map.push_back(right_zone_map);
zones.push_back(right_zone);
zone logo_zone;
logo_zone.name = "Logo";
logo_zone.type = ZONE_TYPE_SINGLE;
std::vector<int> logo_zone_map;
logo_zone_map.push_back(19);
logo_zone.map.push_back(logo_zone_map);
zones.push_back(logo_zone);
zone wheel_zone;
wheel_zone.name = "Mouse Wheel";
wheel_zone.type = ZONE_TYPE_SINGLE;
std::vector<int> wheel_zone_map;
wheel_zone_map.push_back(20);
wheel_zone.map.push_back(wheel_zone_map);
zones.push_back(wheel_zone);
SetupMatrixDevice(dev_path, device_list[i]->rows, device_list[i]->cols);
}
break;
case RAZER_DEATHADDER_CHROMA:
else
{
SetupNonMatrixDevice(dev_path);
for (int i = 0; i < 2; i++)
{
RGBColor new_color = 0x00000000;
colors.push_back(new_color);
}
led logo_led;
logo_led.name = "Logo";
leds.push_back(logo_led);
led wheel_led;
wheel_led.name = "Mouse Wheel";
leds.push_back(wheel_led);
zone logo_zone;
logo_zone.name = "Logo";
logo_zone.type = ZONE_TYPE_SINGLE;
std::vector<int> logo_zone_map;
logo_zone_map.push_back(0);
logo_zone.map.push_back(logo_zone_map);
zones.push_back(logo_zone);
zone wheel_zone;
wheel_zone.name = "Mouse Wheel";
wheel_zone.type = ZONE_TYPE_SINGLE;
std::vector<int> wheel_zone_map;
wheel_zone_map.push_back(1);
wheel_zone.map.push_back(wheel_zone_map);
zones.push_back(wheel_zone);
}
break;
case RAZER_DEATHSTALKER_CHROMA:
/*---------------------------------------------------------*\
| Fill in zone information based on device table |
\*---------------------------------------------------------*/
for (int zone_id = 0; zone_id < RAZER_MAX_ZONES; zone_id++)
{
SetupMatrixDevice(dev_path, 1, 12);
for(int i = 0; i < 12; i++)
if (device_list[i]->zones[zone_id] != NULL)
{
RGBColor new_color = 0x00000000;
colors.push_back(new_color);
}
zone new_zone;
new_zone.name = device_list[i]->zones[zone_id]->name;
new_zone.type = device_list[i]->zones[zone_id]->type;
for (int i = 0; i < 12; i++)
{
led* new_led = new led();
new_led->name = "Keyboard";
leds.push_back(*new_led);
}
zone keyboard_zone;
keyboard_zone.name = "Keyboard";
keyboard_zone.type = ZONE_TYPE_LINEAR;
std::vector<int> keyboard_zone_map;
for(int i = 0; i < 12; i++)
{
keyboard_zone_map.push_back(i);
}
keyboard_zone.map.push_back(keyboard_zone_map);
zones.push_back(keyboard_zone);
}
break;
case RAZER_TARTARUS_CHROMA:
{
SetupMatrixDevice(dev_path, 1, 1);
for (int i = 0; i < 1; i++)
{
RGBColor new_color = 0x00000000;
colors.push_back(new_color);
}
led logo_led;
logo_led.name = "Keypad";
leds.push_back(logo_led);
zone logo_zone;
logo_zone.name = "Keypad";
logo_zone.type = ZONE_TYPE_SINGLE;
std::vector<int> logo_zone_map;
logo_zone_map.push_back(0);
logo_zone.map.push_back(logo_zone_map);
zones.push_back(logo_zone);
}
break;
case RAZER_CORE:
{
SetupMatrixDevice(dev_path, 1, 9);
for(int i = 0; i < 9; i++)
{
RGBColor new_color = 0x00000000;
colors.push_back(new_color);
}
for (int i = 0; i < 1; i++)
{
led* new_led = new led();
new_led->name = "GPU Lighting";
leds.push_back(*new_led);
}
for (int i = 0; i < 8; i++)
{
led* new_led = new led();
new_led->name = "LED Strip";
leds.push_back(*new_led);
}
zone zone_1;
zone_1.name = "GPU Lighting";
zone_1.type = ZONE_TYPE_SINGLE;
std::vector<int> zone_1_map;
for(int i = 0; i < 1; i++)
{
zone_1_map.push_back(i);
}
zone_1.map.push_back(zone_1_map);
zones.push_back(zone_1);
zone zone_2;
zone_2.name = "LED Strip";
zone_2.type = ZONE_TYPE_LINEAR;
std::vector<int> zone_2_map;
for(int i = 0; i < 8; i++)
{
zone_2_map.push_back(i);
}
zone_2.map.push_back(zone_2_map);
zones.push_back(zone_2);
}
break;
case RAZER_FIREFLY_CHROMA:
{
SetupMatrixDevice(dev_path, 1, 15);
for(int i = 0; i < 15; i++)
{
RGBColor new_color = 0x00000000;
colors.push_back(new_color);
}
for (int i = 0; i < 15; i++)
{
led* new_led = new led();
new_led->name = "LED Strip";
leds.push_back(*new_led);
}
zone zone_1;
zone_1.name = "LED Strip";
zone_1.type = ZONE_TYPE_LINEAR;
std::vector<int> zone_1_map;
for(int i = 0; i < 15; i++)
{
zone_1_map.push_back(i);
}
zone_1.map.push_back(zone_1_map);
zones.push_back(zone_1);
}
break;
case RAZER_GOLIATHUS_EXTENDED_CHROMA:
{
SetupMatrixDevice(dev_path, 1, 1);
for (int i = 0; i < 1; i++)
{
RGBColor new_color = 0x00000000;
colors.push_back(new_color);
}
led logo_led;
logo_led.name = "Logo";
leds.push_back(logo_led);
zone logo_zone;
logo_zone.name = "Logo";
logo_zone.type = ZONE_TYPE_SINGLE;
std::vector<int> logo_zone_map;
logo_zone_map.push_back(0);
logo_zone.map.push_back(logo_zone_map);
zones.push_back(logo_zone);
}
break;
case RAZER_MUG_HOLDER:
{
SetupMatrixDevice(dev_path, 1, 15);
for(int i = 0; i < 15; i++)
{
RGBColor new_color = 0x00000000;
colors.push_back(new_color);
}
for (int i = 0; i < 15; i++)
{
led* new_led = new led();
new_led->name = "LED Strip";
leds.push_back(*new_led);
}
zone keyboard_zone;
keyboard_zone.name = "LED Strip";
keyboard_zone.type = ZONE_TYPE_LINEAR;
std::vector<int> keyboard_zone_map;
for(int i = 0; i < 15; i++)
{
keyboard_zone_map.push_back(i);
}
keyboard_zone.map.push_back(keyboard_zone_map);
zones.push_back(keyboard_zone);
}
break;
case RAZER_KRAKEN_V1:
case RAZER_KRAKEN_V2:
{
SetupMatrixDevice(dev_path, 1, 1);
for (int i = 0; i < 1; i++)
{
RGBColor new_color = 0x00000000;
colors.push_back(new_color);
}
led logo_led;
logo_led.name = "Logo";
leds.push_back(logo_led);
zone logo_zone;
logo_zone.name = "Logo";
logo_zone.type = ZONE_TYPE_SINGLE;
std::vector<int> logo_zone_map;
logo_zone_map.push_back(0);
logo_zone.map.push_back(logo_zone_map);
zones.push_back(logo_zone);
}
break;
case RAZER_CHROMA_HDK:
{
SetupMatrixDevice(dev_path, 4, 16);
for (int i = 0; i < 64; i++)
{
RGBColor new_color = 0x00000000;
colors.push_back(new_color);
}
for (int i = 0; i < 64; i++)
{
led* new_led = new led();
new_led->name = "LED Strip";
leds.push_back(*new_led);
}
for (int i = 0; i < 4; i++)
{
zone* new_zone = new zone();
new_zone->name = "LED Strip";
new_zone->type = ZONE_TYPE_LINEAR;
std::vector<int>* new_zone_map = new std::vector<int>();
for (int j = 0; j < 16; j++)
for (int row_id = 0; row_id < device_list[i]->zones[zone_id]->rows; row_id++)
{
new_zone_map->push_back((i * 16) + j);
std::vector<int> new_zone_map;
for (int col_id = 0; col_id < device_list[i]->zones[zone_id]->cols; col_id++)
{
RGBColor new_color = 0x00000000;
colors.push_back(new_color);
led* new_led = new led();
new_led->name = device_list[i]->zones[zone_id]->name;
leds.push_back(*new_led);
new_zone_map.push_back(led_count);
led_count++;
}
new_zone.map.push_back(new_zone_map);
}
new_zone->map.push_back(*new_zone_map);
zones.push_back(*new_zone);
zones.push_back(new_zone);
}
}
break;
}
}
}
+863 -26
View File
@@ -12,33 +12,870 @@
#include "RGBController.h"
#include <fstream>
#define RAZER_MAX_ZONES 6
typedef struct
{
std::string name;
unsigned int type;
unsigned int rows;
unsigned int cols;
} razer_zone;
typedef struct
{
std::string name;
bool matrix_type;
unsigned int rows;
unsigned int cols;
const razer_zone* zones[RAZER_MAX_ZONES];
} razer_device;
/*-------------------------------------------------------------------------*\
| KEYBOARDS |
\*-------------------------------------------------------------------------*/
/*-------------------------------------------------------------*\
| Razer BlackWidow Chroma |
| |
| Zone "Keyboard" |
| Matrix |
| 6 Rows, 22 Columns |
\*-------------------------------------------------------------*/
static const razer_zone blackwidow_chroma_zone =
{
"Keyboard",
ZONE_TYPE_MATRIX,
6,
22
};
static const razer_device blackwidow_chroma_device =
{
"Razer BlackWidow Chroma",
true,
6,
22,
{
&blackwidow_chroma_zone,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------*\
| Razer BlackWidow Chroma Tournament Edition |
| |
| Zone "Keyboard" |
| Matrix |
| 6 Rows, 22 Columns |
\*-------------------------------------------------------------*/
static const razer_zone blackwidow_chroma_te_zone =
{
"Keyboard",
ZONE_TYPE_MATRIX,
6,
22
};
static const razer_device blackwidow_chroma_te_device =
{
"Razer BlackWidow Chroma Tournament Edition",
true,
6,
22,
{
&blackwidow_chroma_te_zone,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------*\
| Razer Ornata Chroma |
| |
| Zone "Keyboard" |
| Matrix |
| 6 Rows, 22 Columns |
\*-------------------------------------------------------------*/
static const razer_zone ornata_chroma_zone =
{
"Keyboard",
ZONE_TYPE_MATRIX,
6,
22
};
static const razer_device ornata_chroma_device =
{
"Razer Ornata Chroma",
true,
6,
22,
{
&ornata_chroma_zone,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------*\
| Razer DeathStalker Chroma |
| |
| Zone "Keyboard" |
| Linear |
| 12 LEDs |
\*-------------------------------------------------------------*/
static const razer_zone deathstalker_chroma_zone =
{
"Keyboard",
ZONE_TYPE_LINEAR,
1,
12
};
static const razer_device deathstalker_chroma_device =
{
"Razer DeathStalker Chroma",
true,
1,
12,
{
&deathstalker_chroma_zone,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------------------*\
| LAPTOPS |
\*-------------------------------------------------------------------------*/
/*-------------------------------------------------------------*\
| Razer Blade Stealth |
| |
| Zone "Keyboard" |
| Matrix |
| 6 Rows, 16 Columns |
\*-------------------------------------------------------------*/
static const razer_zone blade_stealth_zone =
{
"Keyboard",
ZONE_TYPE_MATRIX,
6,
16
};
static const razer_device blade_stealth_device =
{
"Razer Blade Stealth",
true,
6,
16,
{
&blade_stealth_zone,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------*\
| Razer Blade Pro (Late 2016) |
| |
| Zone "Keyboard" |
| Matrix |
| 6 Rows, 25 Columns |
\*-------------------------------------------------------------*/
static const razer_zone blade_pro_late_2016_zone =
{
"Keyboard",
ZONE_TYPE_MATRIX,
6,
25
};
static const razer_device blade_pro_late_2016_device =
{
"Razer Blade Pro (Late 2016)",
true,
6,
25,
{
&blade_pro_late_2016_zone,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------*\
| Razer Blade Pro (2017) |
| |
| Zone "Keyboard" |
| Matrix |
| 6 Rows, 25 Columns |
\*-------------------------------------------------------------*/
static const razer_zone blade_pro_2017_zone =
{
"Keyboard",
ZONE_TYPE_MATRIX,
6,
25
};
static const razer_device blade_pro_2017_device =
{
"Razer Blade Pro (2017)",
true,
6,
25,
{
&blade_pro_2017_zone,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------------------*\
| MICE |
\*-------------------------------------------------------------------------*/
/*-------------------------------------------------------------*\
| Razer Mamba Tournament Edition |
| |
| Zone "Left" |
| Linear |
| 7 LEDs |
| |
| Zone "Right" |
| Linear |
| 7 LEDs |
| |
| Zone "Logo" |
| Single |
| 1 LED |
| |
| Zone "Scroll Wheel" |
| Single |
| 1 LED |
\*-------------------------------------------------------------*/
static const razer_zone mamba_te_left_zone =
{
"Left LED Strip",
ZONE_TYPE_LINEAR,
1,
7
};
static const razer_zone mamba_te_right_zone =
{
"Right LED Strip",
ZONE_TYPE_LINEAR,
1,
7
};
static const razer_zone mamba_te_logo_zone =
{
"Logo",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_zone mamba_te_scroll_wheel_zone =
{
"Scroll Wheel",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_device mamba_te_device =
{
"Razer Mamba Tournament Edition",
true,
1,
16,
{
&mamba_te_left_zone,
&mamba_te_right_zone,
&mamba_te_logo_zone,
&mamba_te_scroll_wheel_zone,
NULL,
NULL
}
};
/*-------------------------------------------------------------*\
| Razer Diamondback Chroma |
| |
| Zone "Right" |
| Linear |
| 7 LEDs |
| |
| Zone "Bottom" |
| Linear |
| 5 LEDs |
| |
| Zone "Left" |
| Linear |
| 7 LEDs |
| |
| Zone "Logo" |
| Single |
| 1 LED |
| |
| Zone "Scroll Wheel" |
| Single |
| 1 LED |
\*-------------------------------------------------------------*/
static const razer_zone diamondback_chroma_right_zone =
{
"Right LED Strip",
ZONE_TYPE_LINEAR,
1,
7
};
static const razer_zone diamondback_chroma_bottom_zone =
{
"Bottom LED Strip",
ZONE_TYPE_LINEAR,
1,
5
};
static const razer_zone diamondback_chroma_left_zone =
{
"Left LED Strip",
ZONE_TYPE_LINEAR,
1,
7
};
static const razer_zone diamondback_chroma_logo_zone =
{
"Logo",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_zone diamondback_chroma_scroll_wheel_zone =
{
"Scroll Wheel",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_device diamondback_chroma_device =
{
"Razer Diamondback Chroma",
true,
1,
21,
{
&diamondback_chroma_right_zone,
&diamondback_chroma_bottom_zone,
&diamondback_chroma_left_zone,
&diamondback_chroma_logo_zone,
&diamondback_chroma_scroll_wheel_zone,
NULL
}
};
/*-------------------------------------------------------------*\
| Razer DeathAdder Chroma |
| |
| Zone "Logo" |
| Single |
| 1 LED |
| |
| Zone "Scroll Wheel" |
| Single |
| 1 LED |
\*-------------------------------------------------------------*/
static const razer_zone deathadder_chroma_logo_zone =
{
"Logo",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_zone deathadder_chroma_scroll_wheel_zone =
{
"Scroll Wheel",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_device deathadder_chroma_device =
{
"Razer DeathAdder Chroma",
false,
1,
2,
{
&deathadder_chroma_logo_zone,
&deathadder_chroma_scroll_wheel_zone,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------*\
| Razer Naga Chroma |
| |
| Zone "Logo" |
| Single |
| 1 LED |
| |
| Zone "Scroll Wheel" |
| Single |
| 1 LED |
| |
| Zone "Numpad" |
| Single |
| 1 LED |
\*-------------------------------------------------------------*/
static const razer_zone naga_chroma_logo_zone =
{
"Logo",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_zone naga_chroma_scroll_wheel_zone =
{
"Scroll Wheel",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_zone naga_chroma_numpad_zone =
{
"Numpad",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_device naga_chroma_device =
{
"Razer Naga Chroma",
false,
1,
3,
{
&naga_chroma_logo_zone,
&naga_chroma_scroll_wheel_zone,
&naga_chroma_numpad_zone,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------------------*\
| KEYPADS |
\*-------------------------------------------------------------------------*/
/*-------------------------------------------------------------*\
| Razer Orbweaver Chroma |
| |
| Zone "Keypad" |
| Matrix |
| 4 Rows, 5 Columns |
\*-------------------------------------------------------------*/
static const razer_zone orbweaver_chroma_zone =
{
"Keypad",
ZONE_TYPE_MATRIX,
4,
5
};
static const razer_device orbweaver_chroma_device =
{
"Razer Orbweaver Chroma",
true,
6,
25,
{
&orbweaver_chroma_zone,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------*\
| Razer Tartarus Chroma |
| |
| Zone "Keypad" |
| Single |
| 1 LED |
\*-------------------------------------------------------------*/
static const razer_zone tartarus_chroma_zone =
{
"Keypad",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_device tartarus_chroma_device =
{
"Razer Tartarus Chroma",
true,
1,
1,
{
&tartarus_chroma_zone,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------------------*\
| MOUSEMATS |
\*-------------------------------------------------------------------------*/
/*-------------------------------------------------------------*\
| Razer Firefly |
| |
| Zone "LED Strip" |
| Linear |
| 15 LEDs |
\*-------------------------------------------------------------*/
static const razer_zone firefly_zone =
{
"LED Strip",
ZONE_TYPE_LINEAR,
1,
15
};
static const razer_device firefly_device =
{
"Razer Firefly",
true,
1,
15,
{
&firefly_zone,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------*\
| Razer Goliathus Extended |
| |
| Zone "LED Strip" |
| Single |
| 1 LED |
\*-------------------------------------------------------------*/
static const razer_zone goliathus_extended_zone =
{
"LED Strip",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_device goliathus_extended_device =
{
"Razer Goliathus Extended",
true,
1,
1,
{
&goliathus_extended_zone,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------------------*\
| HEADSETS |
\*-------------------------------------------------------------------------*/
/*-------------------------------------------------------------*\
| Razer Kraken 7.1 Chroma |
| |
| Zone "Headset" |
| Single |
| 1 LED |
\*-------------------------------------------------------------*/
static const razer_zone kraken_chroma_zone =
{
"Headset",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_device kraken_chroma_device =
{
"Razer Kraken 7.1 Chroma",
true,
1,
1,
{
&kraken_chroma_zone,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------*\
| Razer Kraken 7.1 V2 |
| |
| Zone "Headset" |
| Single |
| 1 LED |
\*-------------------------------------------------------------*/
static const razer_zone kraken_v2_zone =
{
"Headset",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_device kraken_v2_device =
{
"Razer Kraken 7.1 V2",
true,
1,
1,
{
&kraken_v2_zone,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------------------*\
| OTHER |
\*-------------------------------------------------------------------------*/
/*-------------------------------------------------------------*\
| Razer Core |
| |
| Zone "Side Window Lights" |
| Single |
| 1 LED |
| |
| Zone "LED Strip" |
| Linear |
| 8 LEDs |
\*-------------------------------------------------------------*/
static const razer_zone core_side_zone =
{
"Side Window Lights",
ZONE_TYPE_SINGLE,
1,
1
};
static const razer_zone core_led_strip_zone =
{
"LED Strip",
ZONE_TYPE_LINEAR,
1,
8
};
static const razer_device core_device =
{
"Razer Core",
true,
1,
9,
{
&core_side_zone,
&core_led_strip_zone,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------*\
| Razer Chroma Mug Holder |
| |
| Zone "LED Strip" |
| Linear |
| 15 LEDs |
\*-------------------------------------------------------------*/
static const razer_zone mug_holder_zone =
{
"LED Strip",
ZONE_TYPE_LINEAR,
1,
15
};
static const razer_device mug_holder_device =
{
"Razer Chroma Mug Holder",
true,
1,
15,
{
&mug_holder_zone,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
/*-------------------------------------------------------------*\
| Razer Chroma HDK |
| |
| Zone "LED Strip" |
| Linear |
| 16 LEDs |
| |
| Zone "LED Strip" |
| Linear |
| 16 LEDs |
| |
| Zone "LED Strip" |
| Linear |
| 16 LEDs |
| |
| Zone "LED Strip" |
| Linear |
| 16 LEDs |
\*-------------------------------------------------------------*/
static const razer_zone chromahdk_zone =
{
"LED Strip",
ZONE_TYPE_LINEAR,
1,
16
};
static const razer_device chromahdk_device =
{
"Razer Chroma HDK",
true,
4,
16,
{
&chromahdk_zone,
&chromahdk_zone,
&chromahdk_zone,
&chromahdk_zone,
NULL,
NULL
}
};
/*-------------------------------------------------------------------------*\
| DEVICE MASTER LIST |
\*-------------------------------------------------------------------------*/
#define RAZER_NUM_DEVICES (sizeof(device_list) / sizeof(device_list[ 0 ]))
static const razer_device* device_list[] =
{
/*-----------------------------------------------------------------*\
| KEYBOARDS |
\*-----------------------------------------------------------------*/
&blackwidow_chroma_device,
&blackwidow_chroma_te_device,
&ornata_chroma_device,
&deathstalker_chroma_device,
/*-----------------------------------------------------------------*\
| LAPTOPS |
\*-----------------------------------------------------------------*/
&blade_stealth_device,
&blade_pro_late_2016_device,
&blade_pro_2017_device,
/*-----------------------------------------------------------------*\
| MICE |
\*-----------------------------------------------------------------*/
&mamba_te_device,
&diamondback_chroma_device,
&deathadder_chroma_device,
/*-----------------------------------------------------------------*\
| KEYPADS |
\*-----------------------------------------------------------------*/
&orbweaver_chroma_device,
&tartarus_chroma_device,
/*-----------------------------------------------------------------*\
| MOUSEMATS |
\*-----------------------------------------------------------------*/
&firefly_device,
&goliathus_extended_device,
/*-----------------------------------------------------------------*\
| HEADSETS |
\*-----------------------------------------------------------------*/
&kraken_chroma_device,
&kraken_v2_device,
/*-----------------------------------------------------------------*\
| OTHER |
\*-----------------------------------------------------------------*/
&core_device,
&mug_holder_device,
&chromahdk_device
};
class RGBController_OpenRazer : public RGBController
{
public:
enum
{
RAZER_NO_DEVICE,
RAZER_BLACKWIDOW_CHROMA,
RAZER_DEATHSTALKER_CHROMA,
RAZER_ORNATA_CHROMA,
RAZER_BLADE_STEALTH,
RAZER_BLADE_PRO,
RAZER_TARTARUS_CHROMA,
RAZER_DEATHADDER_CHROMA,
RAZER_DEATHADDER_ELITE,
RAZER_NAGA_CHROMA,
RAZER_DIAMONDBACK_CHROMA,
RAZER_MAMBA_TOURNAMENT_EDITION_CHROMA,
RAZER_FIREFLY_CHROMA,
RAZER_GOLIATHUS_EXTENDED_CHROMA,
RAZER_MUG_HOLDER,
RAZER_CORE,
RAZER_KRAKEN_V1,
RAZER_KRAKEN_V2,
RAZER_CHROMA_HDK,
RAZER_NUM_DEVICES
};
enum
{
RAZER_MODE_CUSTOM,
@@ -55,6 +892,7 @@ public:
{
RAZER_TYPE_MATRIX_FRAME,
RAZER_TYPE_MATRIX_NOFRAME,
RAZER_TYPE_MATRIX_STATIC,
RAZER_TYPE_NOMATRIX,
RAZER_NUM_TYPES
};
@@ -69,12 +907,11 @@ public:
void SetLED(int led, RGBColor color);
void UpdateLEDs();
unsigned int device;
int device;
private:
void SetupMatrixDevice(std::string dev_path, unsigned int rows, unsigned int cols);
void SetupNonMatrixDevice(std::string dev_path);
unsigned int GetTypeFromDeviceName(std::string dev_name);
unsigned int type;
unsigned int matrix_rows;