Compare commits

...
34 Commits
Author SHA1 Message Date
Adam Honse fe37c261a2 Move Set Color buttons up for better alignment 2019-12-23 16:51:10 -06:00
Adam Honse cbdbb71d79 Add Set All Devices button 2019-12-23 16:17:00 -06:00
Adam Honse 5f786e649a Fix Hue+ initialization on Windows 2019-12-23 15:37:15 -06:00
Adam Honse f76bf34d8d HyperX zones per slot, set Hue Plus zones as linear type 2019-12-23 12:35:42 -06:00
Adam Honse e799574730 Add additional information to OpenRazer, set SPD to page 1 for proper HyperX detection 2019-12-23 02:52:09 -06:00
Adam Honse 1a5b12c7a0 OAdd strip autodetection to NZXT Hue+ interface, group zones into channels 2019-12-23 02:21:20 -06:00
Adam Honse d2acc75ba8 Report correct device types on OpenRazer interface 2019-12-22 23:11:11 -06:00
Adam Honse 74bcfbd940 Make Sleep function static on linux to avoid compile errors 2019-12-22 22:44:28 -06:00
Adam Honse 1db45f2cf2 Update slot addresses for HyperX Predator RGB and set brightness on effect modes 2019-12-22 21:27:27 -06:00
Adam Honse 6e467fe8cd Initial work on direct mode for HyperX Predator RGB 2019-12-22 02:18:20 -06:00
Adam Honse 441c462e59 Add SMBus/I2C dumping tool to System Information page 2019-12-22 00:02:08 -06:00
Adam Honse 89b4716012 Fix Aura DRAM detection and move firmware name to Version field 2019-12-20 14:28:42 -06:00
Adam Honse e51e9a71a0 Add name and serial number information fields to UI 2019-12-20 14:03:37 -06:00
Adam Honse 02273a3601 Exclude SMBus addresses from detection matching upstream i2c-tools code 2019-12-20 13:07:21 -06:00
Adam Honse e0018b23aa Use monospace font in system information box 2019-12-20 12:45:29 -06:00
Adam Honse b06f384350 System information page with i2c detect 2019-12-20 12:22:14 -06:00
Adam Honse 7dddb9d111 Start work on Information page and add information fields to RGBController API 2019-12-20 00:54:37 -06:00
Adam Honse 0d38154134 Fix DRAM type detection for some Aura based RAM Modules 2019-12-18 23:08:48 -06:00
Adam Honse 7dd84c7ac8 First round of user interface rework changes 2019-12-18 20:33:55 -06:00
Adam Honse ffd0088378 Rename dialog components from OpenAuraSDK to OpenRGB 2019-12-17 20:23:36 -06:00
Adam Honse f0c486c30d Rename OpenAuraSDK to OpenRGB for kernel patch and project file 2019-12-17 20:11:43 -06:00
Adam Honse 010ab1182d Move OpenAuraSDK_Win.pro to OpenAuraSDK.pro to unify the two project files for good 2019-12-17 19:57:06 -06:00
Adam Honse 7e64ca1f83 Merge QT project files in OpenAuraSDK_Win.pro 2019-12-17 19:51:34 -06:00
Adam Honse 2fcff92523 Add icon to Windows Qt project 2019-12-17 19:00:07 -06:00
Adam Honse 8beeb5f7b2 Get Qt project building on Windows, remove Visual Studio files 2019-12-17 18:57:53 -06:00
Adam Honse 7d2b5f285f More work on ASR LED/Polychrome support 2019-12-15 02:12:12 -06:00
Adam Honse b8eb4e9bcb Initial work on ASRock Polychrome/ASR LED interface. Does not function yet. 2019-12-14 11:15:55 -06:00
Adam Honse 733b904ec4 Undo commenting out of custom mode set function 2019-12-11 21:43:51 -06:00
Adam Honse 59a3b41480 Initial support for Gigabyte Aorus RGB Fusion motherboards 2019-12-11 20:19:21 -06:00
Adam Honse 28b41451f8 Fix typo in Aura header 2019-12-11 19:38:28 -06:00
Adam Honse 126c9295ac Add OpenRGB icon 2019-10-26 22:47:21 -05:00
Steven Franzen 0e4a162667 Change search path for i2c devices on linux
Looking for devices by bus instead of class should fix issues where the
class is named differently, e.g. i2c-dev instead of i2c-adapter.
2019-10-26 21:46:10 -05:00
Adam Honse 15fd537fa8 Add support for RGB E1.31 Streaming ACN multicast devices using libe131. Linux only for now. 2019-10-26 21:34:25 -05:00
Adam Honse 557c9df9a0 Rewrite OpenRazer support to use static constant device mapping table instead of big switch/case. Add support for some extra Razer devices. Use "ledstrip.txt" for LED strip settings 2019-10-26 18:21:02 -05:00
83 changed files with 5187 additions and 1867 deletions
+3
View File
@@ -0,0 +1,3 @@
[submodule "dependencies/libe131"]
path = dependencies/libe131
url = https://github.com/hhromic/libe131
+13 -3
View File
@@ -1,5 +1,5 @@
/*-----------------------------------------*\
| AuraController.h |
| AuraController.cpp |
| |
| Driver for ASUS Aura RGB lighting |
| controller |
@@ -82,11 +82,21 @@ AuraController::~AuraController()
}
char * AuraController::GetDeviceName()
std::string AuraController::GetDeviceName()
{
return(device_name);
}
std::string AuraController::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);
}
unsigned char AuraController::GetChannel(unsigned int led)
{
return(config_table[channel_cfg + led]);
@@ -245,4 +255,4 @@ void AuraController::AuraRegisterWriteBlock(aura_register reg, unsigned char * d
//Write Aura block data
bus->i2c_smbus_write_block_data(dev, 0x03, sz, data);
}
}
+4 -2
View File
@@ -7,6 +7,7 @@
| Adam Honse (CalcProgrammer1) 8/19/2018 |
\*-----------------------------------------*/
#include <string>
#include "i2c_smbus.h"
#pragma once
@@ -93,7 +94,8 @@ public:
AuraController(i2c_smbus_interface* bus, aura_dev_id dev);
~AuraController();
char* GetDeviceName();
std::string GetDeviceName();
std::string GetDeviceLocation();
unsigned char GetChannel(unsigned int led);
const char* GetChannelName(unsigned int led);
unsigned int GetLEDCount();
@@ -120,4 +122,4 @@ private:
i2c_smbus_interface * bus;
aura_dev_id dev;
};
};
@@ -24,11 +24,21 @@ CorsairController::~CorsairController()
}
char * CorsairController::GetDeviceName()
std::string CorsairController::GetDeviceName()
{
return(device_name);
}
std::string CorsairController::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);
}
unsigned int CorsairController::GetLEDCount()
{
return(led_count);
@@ -55,4 +65,4 @@ void CorsairController::SetLEDColor(unsigned int led, unsigned char red, unsigne
void CorsairController::SetMode(unsigned char mode)
{
bus->i2c_smbus_write_byte_data(dev, CORSAIR_VENGEANCE_RGB_CMD_MODE, CORSAIR_VENGEANCE_RGB_MODE_SINGLE);
}
}
@@ -7,6 +7,7 @@
| Adam Honse (CalcProgrammer1) 3/8/2019 |
\*-----------------------------------------*/
#include <string>
#include "i2c_smbus.h"
#pragma once
@@ -38,7 +39,8 @@ public:
CorsairController(i2c_smbus_interface* bus, corsair_dev_id dev);
~CorsairController();
char* GetDeviceName();
std::string GetDeviceName();
std::string GetDeviceLocation();
unsigned int GetLEDCount();
void SetMode(unsigned char mode);
@@ -50,4 +52,4 @@ private:
unsigned int led_count;
i2c_smbus_interface * bus;
corsair_dev_id dev;
};
};
@@ -15,7 +15,7 @@
#else
#include <unistd.h>
void Sleep(unsigned int milliseconds)
static void Sleep(unsigned int milliseconds)
{
usleep(1000 * milliseconds);
}
@@ -42,11 +42,21 @@ CorsairProController::~CorsairProController()
}
char* CorsairProController::GetDeviceName()
std::string CorsairProController::GetDeviceName()
{
return(device_name);
}
std::string CorsairProController::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);
}
unsigned int CorsairProController::GetLEDCount()
{
return(led_count);
@@ -134,4 +144,4 @@ bool CorsairProController::WaitReady()
}
return false;
}
}
@@ -7,6 +7,7 @@
| Adam Honse (CalcProgrammer1) 6/30/2019 |
\*-----------------------------------------*/
#include <string>
#include "i2c_smbus.h"
#pragma once
@@ -65,7 +66,8 @@ public:
CorsairProController(i2c_smbus_interface* bus, corsair_dev_id dev);
~CorsairProController();
char* GetDeviceName();
std::string GetDeviceName();
std::string GetDeviceLocation();
unsigned int GetLEDCount();
void SetEffect(unsigned char mode);
void SetCustom();
@@ -85,4 +87,4 @@ private:
i2c_smbus_interface* bus;
corsair_dev_id dev;
};
};
@@ -10,87 +10,35 @@
#include <iostream>
#include <string>
#ifdef WIN32
#include <Windows.h>
#else
#include <unistd.h>
static void Sleep(unsigned int milliseconds)
{
usleep(1000 * milliseconds);
}
#endif
HuePlusController::HuePlusController()
{
}
HuePlusController::~HuePlusController()
{
}
void HuePlusController::Initialize(char* ledstring)
void HuePlusController::Initialize(char* port_name)
{
strcpy(led_string, ledstring);
strcpy(led_string, port_name);
serialport = new serial_port(port_name, HUE_PLUS_BAUD);
LPSTR source = NULL;
LPSTR channels = NULL;
LPSTR numleds = NULL;
LPSTR next = NULL;
source = strtok_s(ledstring, ",", &next);
//Check for selected channel 0=both, 1= Ch.1, 2= Ch.2
if (strlen(next))
{
channels = strtok_s(next, ",", &next);
}
switch (atoi(channels))
{
case 0:
channel = 0x00;
break;
case 1:
channel = 0x01;
break;
case 2:
channel = 0x02;
break;
}
//Check for the number of LEDs, sets the corresponding variable with the counter for the fans
if (strlen(next))
{
numleds = strtok_s(next, ",", &next);
}
switch (atoi(numleds) / 8)
{
case 1:
fans = 0x00;
break;
case 2:
fans = 0x01;
break;
case 3:
fans = 0x02;
break;
case 4:
fans = 0x03;
break;
case 5:
fans = 0x04;
break;
}
//Initialize with default baud rate
source = strtok(source, "\r");
strcpy(port_name, source);
baud_rate = 256000;
serialport = new serial_port(port_name, baud_rate);
if (numleds != NULL && strlen(numleds))
{
num_leds = atoi(numleds);
}
channel_leds[HUE_PLUS_CHANNEL_1_IDX] = GetStripsOnChannel(HUE_PLUS_CHANNEL_1) * 10;
channel_leds[HUE_PLUS_CHANNEL_2_IDX] = GetStripsOnChannel(HUE_PLUS_CHANNEL_2) * 10;
}
char* HuePlusController::GetLEDString()
@@ -98,27 +46,57 @@ char* HuePlusController::GetLEDString()
return(led_string);
}
void HuePlusController::SetLEDs(std::vector<RGBColor> colors)
unsigned int HuePlusController::GetStripsOnChannel(unsigned int channel)
{
unsigned int ret_val = 0;
if (serialport != NULL)
{
unsigned char *serial_buf;
serial_buf = new unsigned char[5];
serial_buf[0] = 0x8D;
serial_buf[1] = channel;
serialport->serial_flush_rx();
serialport->serial_write((char *)serial_buf, 2);
serialport->serial_flush_tx();
Sleep(50);
int bytes_read = serialport->serial_read((char *)serial_buf, 5);
if(bytes_read == 5)
{
ret_val = serial_buf[4];
}
delete[] serial_buf;
}
return(ret_val);
}
void HuePlusController::SetChannelLEDs(unsigned int channel, std::vector<RGBColor> colors)
{
if (serialport != NULL)
{
unsigned char *serial_buf;
serial_buf = new unsigned char[hueSize]; //Size of Message always 5 XX Blocks (Mode Selection) + 3 XX for each LED (1 color)
//-> max of 40 LEDs per Channel (or 5 Fans a 8 LEDs) -> 125 Blocks (empty LEDs are written, too
serial_buf[0] = 0x4b;
serial_buf = new unsigned char[HUE_PLUS_PACKET_SIZE];
serial_buf[0] = 0x4B;
serial_buf[1] = channel;
serial_buf[2] = 0x0e;
serial_buf[3] = fans;
serial_buf[2] = HUE_PLUS_MODE_FIXED;
serial_buf[3] = 0x00;
serial_buf[4] = 0x00;
for (int i = 5; i < hueSize; i++)
for (int i = 5; i < HUE_PLUS_PACKET_SIZE; i++)
{
//clearing the buf otherwise sometimes strange things are written to the COM Port
serial_buf[i] = 0x00;
}
for (int idx = 0; idx < (num_leds * 3); idx += 3)
for (int idx = 0; idx < (colors.size() * 3); idx += 3)
{
int pixel_idx = idx / 3;
RGBColor color = colors[pixel_idx];
@@ -127,7 +105,7 @@ void HuePlusController::SetLEDs(std::vector<RGBColor> colors)
serial_buf[idx + 7] = RGBGetBValue(color);
}
serialport->serial_write((char *)serial_buf, hueSize);
serialport->serial_write((char *)serial_buf, HUE_PLUS_PACKET_SIZE);
serialport->serial_flush_tx();
delete[] serial_buf;
@@ -22,24 +22,45 @@
#define strtok_s strtok_r
#endif
#define HUE_PLUS_BAUD 256000
#define HUE_PLUS_PACKET_SIZE 125
enum
{
HUE_PLUS_CHANNEL_BOTH = 0x00, /* Both channels */
HUE_PLUS_CHANNEL_1 = 0x01, /* Channel 1 */
HUE_PLUS_CHANNEL_2 = 0x02, /* Channel 2 */
HUE_PLUS_NUM_CHANNELS = 0x02 /* Number of channels */
};
enum
{
HUE_PLUS_CHANNEL_1_IDX = 0x00, /* Channel 1 array index */
HUE_PLUS_CHANNEL_2_IDX = 0x01, /* Channel 2 array index */
};
enum
{
HUE_PLUS_MODE_FIXED = 0x00, /* Fixed colors mode */
HUE_PLUS_MODE_FADING = 0x01, /* Fading mode */
HUE_PLUS_MODE_SPECTRUM = 0x02, /* Spectrum cycle mode */
HUE_PLUS_NUM_MODES /* Number of Hue Plus modes */
};
class HuePlusController
{
public:
HuePlusController();
~HuePlusController();
void Initialize(char* ledstring);
char* GetLEDString();
void SetLEDs(std::vector<RGBColor> colors);
void Initialize(char* port_name);
char* GetLEDString();
unsigned int GetStripsOnChannel(unsigned int channel);
void SetChannelLEDs(unsigned int channel, std::vector<RGBColor> colors);
int num_leds;
unsigned int channel_leds[HUE_PLUS_NUM_CHANNELS];
private:
int baud_rate;
int fans;
int channel;
const int hueSize = 125;
char led_string[1024];
char port_name[128];
serial_port *serialport;
@@ -37,7 +37,6 @@ void DetectHuePlusControllers(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");
#else
snprintf(arg1, 64, "/proc/%d/exe", getpid());
readlink(arg1, filename, 1024);
@@ -86,4 +85,4 @@ void DetectHuePlusControllers(std::vector<RGBController*> &rgb_controllers)
}
} /* DetectHuePlusControllers() */
} /* DetectHuePlusControllers() */
+155 -13
View File
@@ -10,13 +10,25 @@
#include "HyperXController.h"
#include <cstring>
HyperXController::HyperXController(i2c_smbus_interface* bus, hyperx_dev_id dev)
HyperXController::HyperXController(i2c_smbus_interface* bus, hyperx_dev_id dev, unsigned char slots)
{
this->bus = bus;
this->dev = dev;
this->bus = bus;
this->dev = dev;
slots_valid = slots;
strcpy(device_name, "HyperX Predator RGB");
led_count = 1;
led_count = 0;
for(int i = 0; i < 8; i++)
{
if((slots_valid & (1 << i)) != 0)
{
led_count += 5;
}
}
mode = HYPERX_MODE_DIRECT;
}
HyperXController::~HyperXController()
@@ -24,23 +36,91 @@ HyperXController::~HyperXController()
}
char* HyperXController::GetDeviceName()
std::string HyperXController::GetDeviceName()
{
return(device_name);
}
std::string HyperXController::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);
}
unsigned int HyperXController::GetLEDCount()
{
return(led_count);
}
unsigned int HyperXController::GetSlotCount()
{
unsigned int slot_count = 0;
for(int slot = 0; slot < 4; slot++)
{
if((slots_valid & (1 << slot)) != 0)
{
slot_count++;
}
}
return(slot_count);
}
unsigned int HyperXController::GetMode()
{
return(mode);
}
void HyperXController::SetEffectColor(unsigned char red, unsigned char green, unsigned char blue)
{
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x01);
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_EFFECT_RED, red );
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_EFFECT_GREEN, green);
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_EFFECT_BLUE, blue );
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_EFFECT_BRIGHTNESS, 0x64 );
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x02);
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x03);
}
void HyperXController::SetAllColors(unsigned char red, unsigned char green, unsigned char blue)
{
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x01);
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_RED, red);
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_GREEN, green);
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_BLUE, blue);
/*-----------------------------------------------------*\
| Loop through all slots and only set those which are |
| active. |
\*-----------------------------------------------------*/
for(int slot = 0; slot < 4; slot++)
{
if((slots_valid & (1 << slot)) != 0)
{
unsigned char base = slot_base[slot];
unsigned char red_base = base + 0x00;
unsigned char green_base = base + 0x01;
unsigned char blue_base = base + 0x02;
unsigned char bright_base = base + 0x10;
if(mode == HYPERX_MODE_DIRECT)
{
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_MODE3, HYPERX_MODE3_DIRECT);
}
for(int led = 0; led < 5; led++)
{
bus->i2c_smbus_write_byte_data(dev, red_base + (3 * led), red );
bus->i2c_smbus_write_byte_data(dev, green_base + (3 * led), green);
bus->i2c_smbus_write_byte_data(dev, blue_base + (3 * led), blue );
bus->i2c_smbus_write_byte_data(dev, bright_base + (3 * led), 0x64 );
}
}
}
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x02);
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x03);
@@ -48,22 +128,84 @@ void HyperXController::SetAllColors(unsigned char red, unsigned char green, unsi
void HyperXController::SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
{
/*-----------------------------------------------------*\
| led_slot - the unmapped slot ID for the given LED |
| led - the LED ID within that slot |
| slot_id - counts enabled slots |
| slot - the mapped slot ID for the given LED |
\*-----------------------------------------------------*/
int led_slot = led / 5;
int slot_id = -1;
int slot;
led -= (led_slot * 5);
/*-----------------------------------------------------*\
| Loop through all possible slots and only count those |
| which are active. |
\*-----------------------------------------------------*/
for(slot = 0; slot < 4; slot++)
{
if((slots_valid & ( 1 << slot)) != 0)
{
slot_id++;
}
if(slot_id == led_slot)
{
break;
}
}
unsigned char base = slot_base[slot];
unsigned char red_base = base + 0x00;
unsigned char green_base = base + 0x01;
unsigned char blue_base = base + 0x02;
unsigned char bright_base = base + 0x10;
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x01);
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_RED, red);
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_GREEN, green);
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_BLUE, blue);
bus->i2c_smbus_write_byte_data(dev, red_base + (3 * led), red );
bus->i2c_smbus_write_byte_data(dev, green_base + (3 * led), green);
bus->i2c_smbus_write_byte_data(dev, blue_base + (3 * led), blue );
bus->i2c_smbus_write_byte_data(dev, bright_base + (3 * led), 0x64 );
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x02);
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x03);
}
void HyperXController::SetMode(unsigned char mode)
void HyperXController::SetLEDColor(unsigned int slot, unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
{
unsigned char base = slot_base[slot];
unsigned char red_base = base + 0x00;
unsigned char green_base = base + 0x01;
unsigned char blue_base = base + 0x02;
unsigned char bright_base = base + 0x10;
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x01);
bus->i2c_smbus_write_byte_data(dev, red_base + (3 * led), red );
bus->i2c_smbus_write_byte_data(dev, green_base + (3 * led), green);
bus->i2c_smbus_write_byte_data(dev, blue_base + (3 * led), blue );
bus->i2c_smbus_write_byte_data(dev, bright_base + (3 * led), 0x64 );
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x02);
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x03);
}
void HyperXController::SetMode(unsigned char new_mode)
{
mode = new_mode;
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x01);
switch (mode)
{
case HYPERX_MODE_DIRECT:
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_MODE3, HYPERX_MODE3_DIRECT);
break;
case HYPERX_MODE_STATIC:
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_MODE2, HYPERX_MODE2_STATIC);
break;
@@ -99,4 +241,4 @@ void HyperXController::SetMode(unsigned char mode)
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x02);
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x03);
}
}
+122 -16
View File
@@ -7,6 +7,7 @@
| Adam Honse (CalcProgrammer1) 6/29/2019 |
\*-----------------------------------------*/
#include <string>
#include "i2c_smbus.h"
#pragma once
@@ -16,13 +17,98 @@ typedef unsigned short hyperx_register;
enum
{
HYPERX_REG_BRIGHTNESS = 0xDD, /* Brightness control register (0-100) */
HYPERX_REG_SLOT0_LED0_RED = 0x11, /* R color register for LED 0, Slot 0 */
HYPERX_REG_SLOT0_LED0_GREEN = 0x12, /* G color register for LED 0, Slot 0 */
HYPERX_REG_SLOT0_LED0_BLUE = 0x13, /* B color register for LED 0, Slot 0 */
HYPERX_REG_SLOT0_LED1_RED = 0x14, /* R color register for LED 1, Slot 0 */
HYPERX_REG_SLOT0_LED1_GREEN = 0x15, /* G color register for LED 1, Slot 0 */
HYPERX_REG_SLOT0_LED1_BLUE = 0x16, /* B color register for LED 1, Slot 0 */
HYPERX_REG_SLOT0_LED2_RED = 0x17, /* R color register for LED 2, Slot 0 */
HYPERX_REG_SLOT0_LED2_GREEN = 0x18, /* G color register for LED 2, Slot 0 */
HYPERX_REG_SLOT0_LED2_BLUE = 0x19, /* B color register for LED 2, Slot 0 */
HYPERX_REG_SLOT0_LED3_RED = 0x1A, /* R color register for LED 3, Slot 0 */
HYPERX_REG_SLOT0_LED3_GREEN = 0x1B, /* G color register for LED 3, Slot 0 */
HYPERX_REG_SLOT0_LED3_BLUE = 0x1C, /* B color register for LED 3, Slot 0 */
HYPERX_REG_SLOT0_LED4_RED = 0x1D, /* R color register for LED 4, Slot 0 */
HYPERX_REG_SLOT0_LED4_GREEN = 0x1E, /* G color register for LED 4, Slot 0 */
HYPERX_REG_SLOT0_LED4_BLUE = 0x1F, /* B color register for LED 4, Slot 0 */
HYPERX_REG_SLOT0_LED0_BRIGHTNESS = 0x21, /* Brightness for LED 0, Slot 0 (0-100) */
HYPERX_REG_SLOT0_LED1_BRIGHTNESS = 0x24, /* Brightness for LED 1, Slot 0 (0-100) */
HYPERX_REG_SLOT0_LED2_BRIGHTNESS = 0x27, /* Brightness for LED 2, Slot 0 (0-100) */
HYPERX_REG_SLOT0_LED3_BRIGHTNESS = 0x2A, /* Brightness for LED 3, Slot 0 (0-100) */
HYPERX_REG_SLOT0_LED4_BRIGHTNESS = 0x2D, /* Brightness for LED 4, Slot 0 (0-100) */
HYPERX_REG_SLOT1_LED0_RED = 0x41, /* R color register for LED 0, Slot 1 */
HYPERX_REG_SLOT1_LED0_GREEN = 0x42, /* G color register for LED 0, Slot 1 */
HYPERX_REG_SLOT1_LED0_BLUE = 0x43, /* B color register for LED 0, Slot 1 */
HYPERX_REG_SLOT1_LED1_RED = 0x44, /* R color register for LED 1, Slot 1 */
HYPERX_REG_SLOT1_LED1_GREEN = 0x45, /* G color register for LED 1, Slot 1 */
HYPERX_REG_SLOT1_LED1_BLUE = 0x46, /* B color register for LED 1, Slot 1 */
HYPERX_REG_SLOT1_LED2_RED = 0x47, /* R color register for LED 2, Slot 1 */
HYPERX_REG_SLOT1_LED2_GREEN = 0x48, /* G color register for LED 2, Slot 1 */
HYPERX_REG_SLOT1_LED2_BLUE = 0x49, /* B color register for LED 2, Slot 1 */
HYPERX_REG_SLOT1_LED3_RED = 0x4A, /* R color register for LED 3, Slot 1 */
HYPERX_REG_SLOT1_LED3_GREEN = 0x4B, /* G color register for LED 3, Slot 1 */
HYPERX_REG_SLOT1_LED3_BLUE = 0x4C, /* B color register for LED 3, Slot 1 */
HYPERX_REG_SLOT1_LED4_RED = 0x4D, /* R color register for LED 4, Slot 1 */
HYPERX_REG_SLOT1_LED4_GREEN = 0x4E, /* G color register for LED 4, Slot 1 */
HYPERX_REG_SLOT1_LED4_BLUE = 0x4F, /* B color register for LED 4, Slot 1 */
HYPERX_REG_SLOT1_LED0_BRIGHTNESS = 0x51, /* Brightness for LED 0, Slot 1 (0-100) */
HYPERX_REG_SLOT1_LED1_BRIGHTNESS = 0x54, /* Brightness for LED 1, Slot 1 (0-100) */
HYPERX_REG_SLOT1_LED2_BRIGHTNESS = 0x57, /* Brightness for LED 2, Slot 1 (0-100) */
HYPERX_REG_SLOT1_LED3_BRIGHTNESS = 0x5A, /* Brightness for LED 3, Slot 1 (0-100) */
HYPERX_REG_SLOT1_LED4_BRIGHTNESS = 0x5D, /* Brightness for LED 4, Slot 1 (0-100) */
HYPERX_REG_SLOT2_LED0_RED = 0x71, /* R color register for LED 0, Slot 2 */
HYPERX_REG_SLOT2_LED0_GREEN = 0x72, /* G color register for LED 0, Slot 2 */
HYPERX_REG_SLOT2_LED0_BLUE = 0x73, /* B color register for LED 0, Slot 2 */
HYPERX_REG_SLOT2_LED1_RED = 0x74, /* R color register for LED 1, Slot 2 */
HYPERX_REG_SLOT2_LED1_GREEN = 0x75, /* G color register for LED 1, Slot 2 */
HYPERX_REG_SLOT2_LED1_BLUE = 0x76, /* B color register for LED 1, Slot 2 */
HYPERX_REG_SLOT2_LED2_RED = 0x77, /* R color register for LED 2, Slot 2 */
HYPERX_REG_SLOT2_LED2_GREEN = 0x78, /* G color register for LED 2, Slot 2 */
HYPERX_REG_SLOT2_LED2_BLUE = 0x79, /* B color register for LED 2, Slot 2 */
HYPERX_REG_SLOT2_LED3_RED = 0x7A, /* R color register for LED 3, Slot 2 */
HYPERX_REG_SLOT2_LED3_GREEN = 0x7B, /* G color register for LED 3, Slot 2 */
HYPERX_REG_SLOT2_LED3_BLUE = 0x7C, /* B color register for LED 3, Slot 2 */
HYPERX_REG_SLOT2_LED4_RED = 0x7D, /* R color register for LED 4, Slot 2 */
HYPERX_REG_SLOT2_LED4_GREEN = 0x7E, /* G color register for LED 4, Slot 2 */
HYPERX_REG_SLOT2_LED4_BLUE = 0x7F, /* B color register for LED 4, Slot 2 */
HYPERX_REG_SLOT2_LED0_BRIGHTNESS = 0x81, /* Brightness for LED 0, Slot 2 (0-100) */
HYPERX_REG_SLOT2_LED1_BRIGHTNESS = 0x84, /* Brightness for LED 1, Slot 2 (0-100) */
HYPERX_REG_SLOT2_LED2_BRIGHTNESS = 0x87, /* Brightness for LED 2, Slot 2 (0-100) */
HYPERX_REG_SLOT2_LED3_BRIGHTNESS = 0x8A, /* Brightness for LED 3, Slot 2 (0-100) */
HYPERX_REG_SLOT2_LED4_BRIGHTNESS = 0x8D, /* Brightness for LED 4, Slot 2 (0-100) */
HYPERX_REG_SLOT3_LED0_RED = 0xA1, /* R color register for LED 0, Slot 3 */
HYPERX_REG_SLOT3_LED0_GREEN = 0xA2, /* G color register for LED 0, Slot 3 */
HYPERX_REG_SLOT3_LED0_BLUE = 0xA3, /* B color register for LED 0, Slot 3 */
HYPERX_REG_SLOT3_LED1_RED = 0xA4, /* R color register for LED 1, Slot 3 */
HYPERX_REG_SLOT3_LED1_GREEN = 0xA5, /* G color register for LED 1, Slot 3 */
HYPERX_REG_SLOT3_LED1_BLUE = 0xA6, /* B color register for LED 1, Slot 3 */
HYPERX_REG_SLOT3_LED2_RED = 0xA7, /* R color register for LED 2, Slot 3 */
HYPERX_REG_SLOT3_LED2_GREEN = 0xA8, /* G color register for LED 2, Slot 3 */
HYPERX_REG_SLOT3_LED2_BLUE = 0xA9, /* B color register for LED 2, Slot 3 */
HYPERX_REG_SLOT3_LED3_RED = 0xAA, /* R color register for LED 3, Slot 3 */
HYPERX_REG_SLOT3_LED3_GREEN = 0xAB, /* G color register for LED 3, Slot 3 */
HYPERX_REG_SLOT3_LED3_BLUE = 0xAC, /* B color register for LED 3, Slot 3 */
HYPERX_REG_SLOT3_LED4_RED = 0xAD, /* R color register for LED 4, Slot 3 */
HYPERX_REG_SLOT3_LED4_GREEN = 0xAE, /* G color register for LED 4, Slot 3 */
HYPERX_REG_SLOT3_LED4_BLUE = 0xAF, /* B color register for LED 4, Slot 3 */
HYPERX_REG_SLOT3_LED0_BRIGHTNESS = 0xB1, /* Brightness for LED 0, Slot 3 (0-100) */
HYPERX_REG_SLOT3_LED1_BRIGHTNESS = 0xB4, /* Brightness for LED 1, Slot 3 (0-100) */
HYPERX_REG_SLOT3_LED2_BRIGHTNESS = 0xB7, /* Brightness for LED 2, Slot 3 (0-100) */
HYPERX_REG_SLOT3_LED3_BRIGHTNESS = 0xBA, /* Brightness for LED 3, Slot 3 (0-100) */
HYPERX_REG_SLOT3_LED4_BRIGHTNESS = 0xBD, /* Brightness for LED 4, Slot 3 (0-100) */
HYPERX_REG_EFFECT_BRIGHTNESS = 0xDD, /* Brightness for effects (0-100) */
HYPERX_REG_APPLY = 0xE1, /* Apply changes register */
HYPERX_REG_MODE1 = 0xE3, /* Mode control register 1 */
HYPERX_REG_MODE2 = 0xE4, /* Mode control register 2 */
HYPERX_REG_RED = 0xEC, /* Red color register */
HYPERX_REG_GREEN = 0xED, /* Green color register */
HYPERX_REG_BLUE = 0xEE, /* Blue color register */
HYPERX_REG_MODE3 = 0xE5, /* Mode control register 3 */
HYPERX_REG_EFFECT_RED = 0xEC, /* Red color register for effects */
HYPERX_REG_EFFECT_GREEN = 0xED, /* Green color register for effects */
HYPERX_REG_EFFECT_BLUE = 0xEE, /* Blue color register for effects */
};
enum
@@ -43,34 +129,54 @@ enum
enum
{
HYPERX_MODE_STATIC = 0, /* Static color mode */
HYPERX_MODE_RAINBOW = 1, /* Rainbow wave mode */
HYPERX_MODE_COMET = 2, /* Comet (chase) mode */
HYPERX_MODE_HEARTBEAT = 3, /* Heartbeat (pulsing) mode */
HYPERX_MODE_CYCLE = 4, /* Spectrum cycle mode */
HYPERX_MODE_BREATHING = 5, /* Breathing mode */
HYPERX_MODE_BOUNCE = 6, /* Bounce mode */
HYPERX_MODE_BLINK = 7, /* Blinking mode */
HYPERX_MODE3_DIRECT = 0x21, /* Mode 3 direct control */
};
enum
{
HYPERX_MODE_DIRECT = 0, /* Direct control mode */
HYPERX_MODE_STATIC = 1, /* Static color mode */
HYPERX_MODE_RAINBOW = 2, /* Rainbow wave mode */
HYPERX_MODE_COMET = 3, /* Comet (chase) mode */
HYPERX_MODE_HEARTBEAT = 4, /* Heartbeat (pulsing) mode */
HYPERX_MODE_CYCLE = 5, /* Spectrum cycle mode */
HYPERX_MODE_BREATHING = 6, /* Breathing mode */
HYPERX_MODE_BOUNCE = 7, /* Bounce mode */
HYPERX_MODE_BLINK = 8, /* Blinking mode */
HYPERX_NUMBER_MODES /* Number of HyperX modes */
};
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_SLOT3_LED0_RED /* SPD 0x53 maps to slot 3 */
};
class HyperXController
{
public:
HyperXController(i2c_smbus_interface* bus, hyperx_dev_id dev);
HyperXController(i2c_smbus_interface* bus, hyperx_dev_id dev, unsigned char slots);
~HyperXController();
char* GetDeviceName();
std::string GetDeviceName();
std::string GetDeviceLocation();
unsigned int GetLEDCount();
void SetMode(unsigned char mode);
unsigned int GetSlotCount();
unsigned int GetMode();
void SetMode(unsigned char new_mode);
void SetAllColors(unsigned char red, unsigned char green, unsigned char blue);
void SetEffectColor(unsigned char red, unsigned char green, unsigned char blue);
void SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
void SetLEDColor(unsigned int slot, unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
private:
char device_name[32];
unsigned int led_count;
unsigned char slots_valid;
i2c_smbus_interface* bus;
hyperx_dev_id dev;
};
unsigned int mode;
};
@@ -6,6 +6,17 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef WIN32
#include <Windows.h>
#else
#include <unistd.h>
static void Sleep(unsigned int milliseconds)
{
usleep(1000 * milliseconds);
}
#endif
/******************************************************************************************\
* *
* TestForHyperXController *
@@ -58,13 +69,38 @@ void DetectHyperXControllers(std::vector<i2c_smbus_interface*> &busses, std::vec
for (unsigned int bus = 0; bus < busses.size(); bus++)
{
unsigned char slots_valid = 0x00;
// Check for HyperX controller at 0x27
if (TestForHyperXController(busses[bus], 0x27))
{
new_hyperx = new HyperXController(busses[bus], 0x27);
new_controller = new RGBController_HyperX(new_hyperx);
rgb_controllers.push_back(new_controller);
busses[bus]->i2c_smbus_write_byte_data(0x37, 0x00, 0xFF);
Sleep(1);
for(int slot_addr = 0x50; slot_addr <= 0x57; slot_addr++)
{
// Test for HyperX SPD at slot_addr
// This test was copied from NGENUITY software
// Tests SPD addresses in order: 0x40, 0x41, 0x68, and 0x67
if((busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x40) == 0x01)
&&(busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x41) == 0x98)
&&(busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x68) == 0x10)
&&(busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x67) == 0x00))
{
slots_valid |= (1 << (slot_addr - 0x50));
}
Sleep(1);
}
if(slots_valid != 0)
{
new_hyperx = new HyperXController(busses[bus], 0x27, slots_valid);
new_controller = new RGBController_HyperX(new_hyperx);
rgb_controllers.push_back(new_controller);
}
}
}
} /* DetectHyperXControllers() */
} /* DetectHyperXControllers() */
@@ -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
@@ -0,0 +1,110 @@
/*-----------------------------------------*\
| PolychromeController.cpp |
| |
| Driver for for ASRock ASR LED and |
| Polychrome RGB lighting controller |
| |
| Adam Honse (CalcProgrammer1) 12/14/2019 |
\*-----------------------------------------*/
#include "PolychromeController.h"
#include <cstring>
PolychromeController::PolychromeController(i2c_smbus_interface* bus, polychrome_dev_id dev)
{
this->bus = bus;
this->dev = dev;
switch (GetFirmwareVersion())
{
case FIRMWARE_VER_1_PT_10:
led_count = 1;
asr_led = true;
strcpy(device_name, "ASRock ASR LED FW 1.10");
break;
case FIRMWARE_VER_2_PT_00:
led_count = 1;
asr_led = false;
strcpy(device_name, "ASRock Polychrome FW 2.00");
break;
case FIRMWARE_VER_3_PT_00:
led_count = 1;
asr_led = false;
strcpy(device_name, "ASRock Polychrome FW 3.00");
break;
}
}
PolychromeController::~PolychromeController()
{
}
char* PolychromeController::GetDeviceName()
{
return(device_name);
}
unsigned short PolychromeController::GetFirmwareVersion()
{
// 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)
{
unsigned char major = bus->i2c_smbus_read_byte(dev);
unsigned char minor = bus->i2c_smbus_read_byte(dev);
return((major << 8) | minor);
}
else
{
return(0xFFFF);
}
}
unsigned int PolychromeController::GetLEDCount()
{
return(led_count);
}
void PolychromeController::SetAllColors(unsigned char red, unsigned char green, unsigned char blue)
{
if (asr_led)
{
}
else
{
unsigned char colors[3] = { red, green, blue };
bus->i2c_smbus_write_block_data(dev, POLYCHROME_REG_COLOR, 3, colors);
}
}
void PolychromeController::SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
{
if (asr_led)
{
}
else
{
unsigned char colors[3] = { red, green, blue };
bus->i2c_smbus_write_block_data(dev, POLYCHROME_REG_COLOR, 3, colors);
}
}
void PolychromeController::SetMode(unsigned char mode)
{
if (asr_led)
{
}
else
{
bus->i2c_smbus_write_byte_data(dev, POLYCHROME_REG_MODE, mode);
}
}
@@ -0,0 +1,91 @@
/*-----------------------------------------*\
| PolychromeController.h |
| |
| Definitions and types for ASRock |
| ASR LED and Polychrome RGB lighting |
| controller |
| |
| Adam Honse (CalcProgrammer1) 12/13/2019 |
\*-----------------------------------------*/
#include "i2c_smbus.h"
#pragma once
typedef unsigned char polychrome_dev_id;
enum
{
FIRMWARE_VER_1_PT_10 = 0x010A, /* Firmware nu51_1.10 */
FIRMWARE_VER_2_PT_00 = 0x0200, /* Firmware nu51_2.00 */
FIRMWARE_VER_3_PT_00 = 0x0300, /* Firmware nu51_3.00 */
};
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 */
};
enum
{
POLYCHROME_REG_FIRMWARE_VER = 0x00, /* Firmware version Major.Minor */
POLYCHROME_REG_MODE = 0x30, /* Mode selection register */
POLYCHROME_REG_COLOR = 0x34, /* Color register: Red, Green, Blue */
};
#define POLYCHROME_NUM_MODES 14 /* Number of Polychrome 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 */
};
class PolychromeController
{
public:
PolychromeController(i2c_smbus_interface* bus, polychrome_dev_id dev);
~PolychromeController();
char* GetDeviceName();
unsigned int GetLEDCount();
void SetAllColors(unsigned char red, unsigned char green, unsigned char blue);
void SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
void SetMode(unsigned char mode);
unsigned short GetFirmwareVersion();
private:
bool asr_led;
char device_name[32];
unsigned int led_count;
i2c_smbus_interface* bus;
polychrome_dev_id dev;
};
@@ -0,0 +1,171 @@
/*-----------------------------------------*\
| RGBFusionController.cpp |
| |
| Driver for Gigabyte Aorus RGB Fusion |
| lighting controller |
| |
| Adam Honse (CalcProgrammer1) 12/10/2019 |
\*-----------------------------------------*/
#include "RGBFusionController.h"
#include <cstring>
#include <stdio.h>
#include <stdlib.h>
RGBFusionController::RGBFusionController(i2c_smbus_interface* bus, rgb_fusion_dev_id dev)
{
this->bus = bus;
this->dev = dev;
// Set Device name
strcpy(device_name, "Gigabyte Motherboard");
// Set LED count
led_count = 2;
}
RGBFusionController::~RGBFusionController()
{
}
std::string RGBFusionController::GetDeviceName()
{
return(device_name);
}
std::string RGBFusionController::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);
}
unsigned int RGBFusionController::GetLEDCount()
{
return(led_count);
}
unsigned char RGBFusionController::GetMode()
{
switch_bank(0);
return(get_mode_ch_0());
}
void RGBFusionController::SetAllColors(unsigned char red, unsigned char green, unsigned char blue)
{
unsigned char mode_ch_0;
unsigned char mode_ch_1;
switch_bank(1);
set_color_ch_0(red, green, blue);
set_color_ch_1(red, green, blue);
switch_bank(0);
mode_ch_0 = get_mode_ch_0();
mode_ch_1 = get_mode_ch_1();
set_mode_ch_0(mode_ch_0);
set_mode_ch_1(mode_ch_1);
}
void RGBFusionController::SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
{
unsigned char mode;
switch (led)
{
case 0:
switch_bank(1);
set_color_ch_0(red, green, blue);
switch_bank(0);
mode = get_mode_ch_0();
set_mode_ch_0(mode);
break;
case 1:
switch_bank(1);
set_color_ch_1(red, green, blue);
switch_bank(0);
mode = get_mode_ch_1();
set_mode_ch_1(mode);
break;
}
}
void RGBFusionController::SetMode(unsigned char mode)
{
switch_bank(0);
set_mode_ch_0(mode);
set_mode_ch_1(mode);
}
void RGBFusionController::dump()
{
int i, j;
int start = 0x00;
FILE* file = freopen("rgb_fusion_dump.txt", "a", stdout);
printf(" 0 1 2 3 4 5 6 7 8 9 a b c d e f\r\n");
for (i = 0; i < 0xFF; i += 16)
{
printf("%04x: ", i + start);
for (j = 0; j < 16; j++)
{
printf("%02x ", bus->i2c_smbus_read_byte_data(dev, (start + i + j)));
}
printf("\r\n");
}
fclose(file);
}
unsigned char RGBFusionController::get_mode_ch_0()
{
s32 temp = bus->i2c_smbus_read_byte_data(dev, RGB_FUSION_BANK_1_REG_CH_0_MODE);
return(temp);
}
unsigned char RGBFusionController::get_mode_ch_1()
{
return(bus->i2c_smbus_read_byte_data(dev, RGB_FUSION_BANK_1_REG_CH_1_MODE));
}
void RGBFusionController::set_color_ch_0(unsigned char red, unsigned char green, unsigned char blue)
{
bus->i2c_smbus_write_byte_data(dev, RGB_FUSION_BANK_0_REG_CH_0_R, red);
bus->i2c_smbus_write_byte_data(dev, RGB_FUSION_BANK_0_REG_CH_0_G, green);
bus->i2c_smbus_write_byte_data(dev, RGB_FUSION_BANK_0_REG_CH_0_B, blue);
}
void RGBFusionController::set_color_ch_1(unsigned char red, unsigned char green, unsigned char blue)
{
bus->i2c_smbus_write_byte_data(dev, RGB_FUSION_BANK_0_REG_CH_1_R, red);
bus->i2c_smbus_write_byte_data(dev, RGB_FUSION_BANK_0_REG_CH_1_G, green);
bus->i2c_smbus_write_byte_data(dev, RGB_FUSION_BANK_0_REG_CH_1_B, blue);
}
void RGBFusionController::set_mode_ch_0(unsigned char mode)
{
bus->i2c_smbus_write_byte_data(dev, RGB_FUSION_BANK_1_REG_CH_0_MODE, mode + RGB_FUSION_WRITE_MODE_OFST);
}
void RGBFusionController::set_mode_ch_1(unsigned char mode)
{
bus->i2c_smbus_write_byte_data(dev, RGB_FUSION_BANK_1_REG_CH_1_MODE, mode + RGB_FUSION_WRITE_MODE_OFST);
}
void RGBFusionController::switch_bank(unsigned char bank)
{
bus->i2c_smbus_write_byte_data(dev, RGB_FUSION_BANK_SWITCH_REG, bank);
}
@@ -0,0 +1,71 @@
/*-----------------------------------------*\
| RGBFusionController.h |
| |
| Definitions and types for Gigabyte Aorus |
| RGB Fusion lighting controller |
| |
| Adam Honse (CalcProgrammer1) 12/10/2019 |
\*-----------------------------------------*/
#include <string>
#include "i2c_smbus.h"
#pragma once
typedef unsigned char rgb_fusion_dev_id;
enum
{
RGB_FUSION_BANK_0_REG_CH_0_R = 0x00, /* Channel 0 Red Value */
RGB_FUSION_BANK_0_REG_CH_0_G = 0x01, /* Channel 0 Green Value */
RGB_FUSION_BANK_0_REG_CH_0_B = 0x02, /* Channel 0 Blue Value */
RGB_FUSION_BANK_0_REG_CH_1_R = 0x08, /* Channel 1 Red Value */
RGB_FUSION_BANK_0_REG_CH_1_G = 0x09, /* Channel 1 Green Value */
RGB_FUSION_BANK_0_REG_CH_1_B = 0x0A, /* Channel 1 Blue Value */
RGB_FUSION_BANK_1_REG_CH_0_MODE = 0x03, /* Channel 0 Mode Selection */
RGB_FUSION_BANK_1_REG_CH_1_MODE = 0x13, /* Channel 1 Mode Selection */
RGB_FUSION_BANK_SWITCH_REG = 0xF0, /* Bank Switch Register */
};
#define RGB_FUSION_NUMBER_MODES 3 /* Number of RGB Fusion modes */
#define RGB_FUSION_WRITE_MODE_OFST 0x10 /* offset to add when writing mode */
enum
{
RGB_FUSION_MODE_STATIC = 0x00, /* Static color mode */
RGB_FUSION_MODE_BREATHING = 0x01, /* Breathing effect mode */
RGB_FUSION_MODE_FLASHING = 0x02, /* Flashing effect mode */
};
class RGBFusionController
{
public:
RGBFusionController(i2c_smbus_interface* bus, rgb_fusion_dev_id dev);
~RGBFusionController();
std::string GetDeviceName();
std::string GetDeviceLocation();
unsigned int GetLEDCount();
unsigned char GetMode();
void SetAllColors(unsigned char red, unsigned char green, unsigned char blue);
void SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
void SetMode(unsigned char mode);
private:
void dump();
unsigned char get_mode_ch_0();
unsigned char get_mode_ch_1();
void set_color_ch_0(unsigned char red, unsigned char green, unsigned char blue);
void set_color_ch_1(unsigned char red, unsigned char green, unsigned char blue);
void set_mode_ch_0(unsigned char mode);
void set_mode_ch_1(unsigned char mode);
void switch_bank(unsigned char bank);
char device_name[32];
unsigned int led_count;
i2c_smbus_interface* bus;
rgb_fusion_dev_id dev;
};
@@ -0,0 +1,60 @@
#include "RGBFusionController.h"
#include "RGBController.h"
#include "RGBController_RGBFusion.h"
#include "i2c_smbus.h"
#include <vector>
#include <stdio.h>
#include <stdlib.h>
/******************************************************************************************\
* *
* TestForRGBFusionController *
* *
* Tests the given address to see if an RGB Fusion controller exists there. First *
* does a quick write to test for a response *
* *
\******************************************************************************************/
bool TestForRGBFusionController(i2c_smbus_interface* bus, unsigned char address)
{
bool pass = false;
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
if (res >= 0)
{
pass = true;
}
return(pass);
} /* TestForRGBFusionController() */
/******************************************************************************************\
* *
* DetectRGBFusionControllers *
* *
* Detect RGB Fusion controllers on the enumerated I2C busses at address 0x28. *
* *
* bus - pointer to i2c_smbus_interface where RGB Fusion device is connected *
* dev - I2C address of RGB Fusion device *
* *
\******************************************************************************************/
void DetectRGBFusionControllers(std::vector<i2c_smbus_interface*>& busses, std::vector<RGBController*>& rgb_controllers)
{
RGBFusionController* new_rgb_fusion;
RGBController_RGBFusion* new_controller;
for (unsigned int bus = 0; bus < busses.size(); bus++)
{
// Check for RGB Fusion controller at 0x28
if (TestForRGBFusionController(busses[bus], 0x28))
{
new_rgb_fusion = new RGBFusionController(busses[bus], 0x28);
new_controller = new RGBController_RGBFusion(new_rgb_fusion);
rgb_controllers.push_back(new_controller);
}
}
} /* DetectRGBFusionControllers() */
+8 -82
View File
@@ -16,7 +16,6 @@
#ifdef WIN32
#include <tchar.h>
#include <regex>
#include "i2c_smbus_piix4.h"
#include "i2c_smbus_i801.h"
@@ -260,8 +259,8 @@ void DetectI2CBusses()
struct dirent * ent;
int test_fd;
// Start looking for I2C adapters in /sys/class/i2c-adapter/
strcpy(driver_path, "/sys/class/i2c-adapter/");
// Start looking for I2C adapters in /sys/bus/i2c/devices/
strcpy(driver_path, "/sys/bus/i2c/devices/");
dir = opendir(driver_path);
if(dir == NULL)
@@ -320,84 +319,6 @@ void DetectI2CBusses()
#endif /* WIN32 */
/******************************************************************************************\
* *
* DetectI2C *
* *
* Prints a list of all detected I2C addresses on the given bus *
* *
* bus - pointer to i2c_smbus_interface to scan *
* mode - one of AUTO, QUICK, READ, FUNC - method of access *
* *
* Code adapted from i2cdetect.c from i2c-tools Linux package *
* *
\******************************************************************************************/
#define MODE_AUTO 0
#define MODE_QUICK 1
#define MODE_READ 2
#define MODE_FUNC 3
std::string DetectI2C(i2c_smbus_interface * bus, int mode)
{
int i, j;
int res;
int slave_addr;
char line[128];
std::string text;
sprintf(line, " 0 1 2 3 4 5 6 7 8 9 a b c d e f\r\n");
text.append(line);
for (i = 0; i < 128; i += 16)
{
sprintf(line, "%02x: ", i);
text.append(line);
for (j = 0; j < 16; j++)
{
/* Set slave address */
slave_addr = i + j;
/* Probe this address */
switch (mode)
{
case MODE_QUICK:
res = bus->i2c_smbus_write_quick(slave_addr, I2C_SMBUS_WRITE);
break;
case MODE_READ:
res = bus->i2c_smbus_read_byte(slave_addr);
break;
default:
if ((i + j >= 0x30 && i + j <= 0x37)
|| (i + j >= 0x50 && i + j <= 0x5F))
res = bus->i2c_smbus_read_byte(slave_addr);
else
res = bus->i2c_smbus_write_quick(slave_addr, I2C_SMBUS_WRITE);
break;
}
if (res < 0)
{
sprintf(line, "-- ");
text.append(line);
}
else
{
sprintf(line, "%02x ", i + j);
text.append(line);
}
}
sprintf(line, "\r\n");
text.append(line);
}
return text;
} /* DetectI2C() */
/******************************************************************************************\
* *
* DumpAuraRegisters *
@@ -436,9 +357,12 @@ void DetectAuraControllers(std::vector<i2c_smbus_interface*> &busses, std::vecto
void DetectCorsairControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
void DetectCorsairProControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
void DetectHyperXControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
void DetectRGBFusionControllers(std::vector<i2c_smbus_interface*>& busses, std::vector<RGBController*>& rgb_controllers);
void DetectLEDStripControllers(std::vector<RGBController*> &rgb_controllers);
void DetectHuePlusControllers(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);
/******************************************************************************************\
* *
@@ -456,12 +380,14 @@ void DetectRGBControllers(void)
DetectCorsairControllers(busses, rgb_controllers);
DetectCorsairProControllers(busses, rgb_controllers);
DetectHyperXControllers(busses, rgb_controllers);
DetectRGBFusionControllers(busses, rgb_controllers);
DetectLEDStripControllers(rgb_controllers);
DetectHuePlusControllers(rgb_controllers);
#ifdef WIN32
DetectRazerChromaSDKControllers(rgb_controllers);
#else
DetectE131Controllers(rgb_controllers);
DetectOpenRazerControllers(rgb_controllers);
#endif
-71
View File
@@ -1,71 +0,0 @@
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = OpenAuraSDK.bin
TEMPLATE = app
INCLUDEPATH += \
i2c_smbus/ \
net_port/ \
serial_port/ \
Controllers/AuraController/ \
Controllers/CorsairController/ \
Controllers/CorsairProController/ \
Controllers/HuePlusController/ \
Controllers/HyperXController/ \
Controllers/LEDStripController/ \
RGBController/ \
qt/
SOURCES += \
main.cpp \
OpenAuraSDK.cpp \
qt/OpenAuraSDKQtDialog.cpp \
i2c_smbus/i2c_smbus.cpp \
i2c_smbus/i2c_smbus_linux.cpp \
net_port/net_port.cpp \
serial_port/serial_port.cpp \
Controllers/AuraController/AuraController.cpp \
Controllers/AuraController/AuraControllerDetect.cpp \
Controllers/CorsairController/CorsairController.cpp \
Controllers/CorsairController/CorsairControllerDetect.cpp \
Controllers/CorsairProController/CorsairProController.cpp \
Controllers/CorsairProController/CorsairProControllerDetect.cpp \
Controllers/HuePlusController/HuePlusController.cpp \
Controllers/HuePlusController/HuePlusControllerDetect.cpp \
Controllers/HyperXController/HyperXController.cpp \
Controllers/HyperXController/HyperXControllerDetect.cpp \
Controllers/LEDStripController/LEDStripController.cpp \
Controllers/LEDStripController/LEDStripControllerDetect.cpp \
RGBController/OpenRazerDetect.cpp \
RGBController/RGBController_Aura.cpp \
RGBController/RGBController_Corsair.cpp \
RGBController/RGBController_CorsairPro.cpp \
RGBController/RGBController_HuePlus.cpp \
RGBController/RGBController_HyperX.cpp \
RGBController/RGBController_LEDStrip.cpp \
RGBController/RGBController_OpenRazer.cpp
HEADERS += \
qt/OpenAuraSDKQtDialog.h \
i2c_smbus/i2c_smbus.h \
i2c_smbus/i2c_smbus_linux.h \
net_port/net_port.h \
serial_port/serial_port.h \
Controllers/AuraController/AuraController.h \
Controllers/CorsairController/CorsairController.h \
Controllers/CorsairProController/CorsairProController.h \
Controllers/HuePlusController/HuePlusController.h \
Controllers/HyperXController/HyperXController.h \
Controllers/LEDStripController/LEDStripController.h \
RGBController/RGBController.h \
RGBController/RGBController_Aura.h \
RGBController/RGBController_Corsair.h \
RGBController/RGBController_CorsairPro.h \
RGBController/RGBController_HuePlus.h \
RGBController/RGBController_HyperX.h \
RGBController/RGBController_OpenRazer.h
FORMS += \
qt/openaurasdk.ui
-31
View File
@@ -1,31 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.452
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenAuraSDK", "OpenAuraSDK.vcxproj", "{6D22BFF3-C1DF-407A-8816-05D63919A991}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6D22BFF3-C1DF-407A-8816-05D63919A991}.Debug|x64.ActiveCfg = Debug|x64
{6D22BFF3-C1DF-407A-8816-05D63919A991}.Debug|x64.Build.0 = Debug|x64
{6D22BFF3-C1DF-407A-8816-05D63919A991}.Debug|x86.ActiveCfg = Debug|Win32
{6D22BFF3-C1DF-407A-8816-05D63919A991}.Debug|x86.Build.0 = Debug|Win32
{6D22BFF3-C1DF-407A-8816-05D63919A991}.Release|x64.ActiveCfg = Release|x64
{6D22BFF3-C1DF-407A-8816-05D63919A991}.Release|x64.Build.0 = Release|x64
{6D22BFF3-C1DF-407A-8816-05D63919A991}.Release|x86.ActiveCfg = Release|Win32
{6D22BFF3-C1DF-407A-8816-05D63919A991}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A2BB3E13-D506-413D-900E-F2B1323B3BB3}
EndGlobalSection
EndGlobal
-249
View File
@@ -1,249 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{6D22BFF3-C1DF-407A-8816-05D63919A991}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>OpenAuraSDK</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<TargetExt>.exe</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<TargetExt>.exe</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetExt>.exe</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetExt>.exe</TargetExt>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_AFXDLL;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32_LEAN_AND_MEAN</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>.\dependencies\inpout32_1501\Win32;.\dependencies\razer-chroma-2.9.0\inc;.\Controllers\AuraController;.\Controllers\CorsairController;.\Controllers\CorsairProController;.\Controllers\HuePlusController;.\Controllers\HyperXController;.\Controllers\LEDStripController;.\RGBController;.\i2c_smbus;.\net_port;.\serial_port;.\vc;.\wmi;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PrecompiledHeaderFile />
<PrecompiledHeaderOutputFile />
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>.\dependencies\inpout32_1501\Win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_AFXDLL;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32_LEAN_AND_MEAN</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile />
<PrecompiledHeaderOutputFile />
<AdditionalIncludeDirectories>.\dependencies\inpout32_1501\Win32;.\dependencies\razer-chroma-2.9.0\inc;.\Controllers\AuraController;.\Controllers\CorsairController;.\Controllers\CorsairProController;.\Controllers\HuePlusController;.\Controllers\HyperXController;.\Controllers\LEDStripController;.\RGBController;.\i2c_smbus;.\net_port;.\serial_port;.\vc;.\wmi;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>.\dependencies\inpout32_1501\Win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_AFXDLL;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32_LEAN_AND_MEAN</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>.\dependencies\inpout32_1501\Win32;.\dependencies\razer-chroma-2.9.0\inc;.\Controllers\AuraController;.\Controllers\CorsairController;.\Controllers\CorsairProController;.\Controllers\HuePlusController;.\Controllers\HyperXController;.\Controllers\LEDStripController;.\RGBController;.\i2c_smbus;.\net_port;.\serial_port;.\vc;.\wmi;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PrecompiledHeaderFile />
<PrecompiledHeaderOutputFile />
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>.\dependencies\inpout32_1501\Win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_AFXDLL;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32_LEAN_AND_MEAN</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile />
<PrecompiledHeaderOutputFile />
<AdditionalIncludeDirectories>.\dependencies\inpout32_1501\Win32;.\dependencies\razer-chroma-2.9.0\inc;.\Controllers\AuraController;.\Controllers\CorsairController;.\Controllers\CorsairProController;.\Controllers\HuePlusController;.\Controllers\HyperXController;.\Controllers\LEDStripController;.\RGBController;.\i2c_smbus;.\net_port;.\serial_port;.\vc;.\wmi;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>.\dependencies\inpout32_1501\Win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Controllers\AuraController\AuraController.cpp" />
<ClCompile Include="Controllers\AuraController\AuraControllerDetect.cpp" />
<ClCompile Include="Controllers\CorsairController\CorsairController.cpp" />
<ClCompile Include="Controllers\CorsairController\CorsairControllerDetect.cpp" />
<ClCompile Include="Controllers\CorsairProController\CorsairProController.cpp" />
<ClCompile Include="Controllers\CorsairProController\CorsairProControllerDetect.cpp" />
<ClCompile Include="Controllers\HuePlusController\HuePlusController.cpp" />
<ClCompile Include="Controllers\HuePlusController\HuePlusControllerDetect.cpp" />
<ClCompile Include="Controllers\HyperXController\HyperXController.cpp" />
<ClCompile Include="Controllers\HyperXController\HyperXControllerDetect.cpp" />
<ClCompile Include="Controllers\LEDStripController\LEDStripController.cpp" />
<ClCompile Include="Controllers\LEDStripController\LEDStripControllerDetect.cpp" />
<ClCompile Include="i2c_smbus\i2c_smbus.cpp" />
<ClCompile Include="i2c_smbus\i2c_smbus_i801.cpp" />
<ClCompile Include="i2c_smbus\i2c_smbus_nct6775.cpp" />
<ClCompile Include="i2c_smbus\i2c_smbus_piix4.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="net_port\net_port.cpp" />
<ClCompile Include="OpenAuraSDK.cpp" />
<ClCompile Include="RGBController\RazerChromaSDKDetect.cpp" />
<ClCompile Include="RGBController\RGBController_AorusGPU.cpp" />
<ClCompile Include="RGBController\RGBController_Aura.cpp" />
<ClCompile Include="RGBController\RGBController_Corsair.cpp" />
<ClCompile Include="RGBController\RGBController_CorsairPro.cpp" />
<ClCompile Include="RGBController\RGBController_HuePlus.cpp" />
<ClCompile Include="RGBController\RGBController_HyperX.cpp" />
<ClCompile Include="RGBController\RGBController_LEDStrip.cpp" />
<ClCompile Include="RGBController\RGBController_RazerChromaSDK.cpp" />
<ClCompile Include="serial_port\serial_port.cpp" />
<ClCompile Include="vc\I2CDetectDialog.cpp" />
<ClCompile Include="vc\OpenAuraSDKDialog.cpp" />
<ClCompile Include="wmi\wmi.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="vc\Resource.rc" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Controllers\AuraController\AuraController.h" />
<ClInclude Include="Controllers\CorsairController\CorsairController.h" />
<ClInclude Include="Controllers\CorsairProController\CorsairProController.h" />
<ClInclude Include="Controllers\HuePlusController\HuePlusController.h" />
<ClInclude Include="Controllers\HyperXController\HyperXController.h" />
<ClInclude Include="Controllers\LEDStripController\LEDStripController.h" />
<ClInclude Include="i2c_smbus\i2c_smbus.h" />
<ClInclude Include="i2c_smbus\i2c_smbus_i801.h" />
<ClInclude Include="i2c_smbus\i2c_smbus_nct6775.h" />
<ClInclude Include="i2c_smbus\i2c_smbus_piix4.h" />
<ClInclude Include="net_port\net_port.h" />
<ClInclude Include="OpenAuraSDK.h" />
<ClInclude Include="RGBController\RGBController.h" />
<ClInclude Include="RGBController\RGBController_AorusGPU.h" />
<ClInclude Include="RGBController\RGBController_Aura.h" />
<ClInclude Include="RGBController\RGBController_Corsair.h" />
<ClInclude Include="RGBController\RGBController_CorsairPro.h" />
<ClInclude Include="RGBController\RGBController_HuePlus.h" />
<ClInclude Include="RGBController\RGBController_HyperX.h" />
<ClInclude Include="RGBController\RGBController_LEDStrip.h" />
<ClInclude Include="RGBController\RGBController_RazerChromaSDK.h" />
<ClInclude Include="serial_port\serial_port.h" />
<ClInclude Include="vc\I2CDetectDialog.h" />
<ClInclude Include="vc\OpenAuraSDKDialog.h" />
<ClInclude Include="vc\resource.h" />
<ClInclude Include="wmi\wmi.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
-221
View File
@@ -1,221 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Source Files\Controllers">
<UniqueIdentifier>{192d5e34-581a-40c4-bc69-f4b61632fd81}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\Application">
<UniqueIdentifier>{d64d74dd-f822-4617-a88c-00dca03f70d9}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\RGBController">
<UniqueIdentifier>{ee7c811d-9bd1-43a8-9d42-62801332ab30}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\i2c_smbus">
<UniqueIdentifier>{fa28cfae-d8a7-4194-8f25-e35827dd0145}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\Controllers">
<UniqueIdentifier>{a50a158e-81a1-45c3-a300-67e869afcc2f}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\i2c_smbus">
<UniqueIdentifier>{8eae9b90-7558-4b0b-9f03-d3a651cb6624}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\RGBController">
<UniqueIdentifier>{02dd848e-6106-4f74-a58c-4a7547498ac3}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="OpenAuraSDK.cpp">
<Filter>Source Files\Application</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files\Application</Filter>
</ClCompile>
<ClCompile Include="wmi\wmi.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="serial_port\serial_port.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Controllers\AuraController\AuraController.cpp">
<Filter>Source Files\Controllers</Filter>
</ClCompile>
<ClCompile Include="Controllers\AuraController\AuraControllerDetect.cpp">
<Filter>Source Files\Controllers</Filter>
</ClCompile>
<ClCompile Include="Controllers\CorsairController\CorsairController.cpp">
<Filter>Source Files\Controllers</Filter>
</ClCompile>
<ClCompile Include="Controllers\CorsairController\CorsairControllerDetect.cpp">
<Filter>Source Files\Controllers</Filter>
</ClCompile>
<ClCompile Include="Controllers\CorsairProController\CorsairProController.cpp">
<Filter>Source Files\Controllers</Filter>
</ClCompile>
<ClCompile Include="Controllers\CorsairProController\CorsairProControllerDetect.cpp">
<Filter>Source Files\Controllers</Filter>
</ClCompile>
<ClCompile Include="Controllers\HyperXController\HyperXController.cpp">
<Filter>Source Files\Controllers</Filter>
</ClCompile>
<ClCompile Include="Controllers\HyperXController\HyperXControllerDetect.cpp">
<Filter>Source Files\Controllers</Filter>
</ClCompile>
<ClCompile Include="i2c_smbus\i2c_smbus.cpp">
<Filter>Source Files\i2c_smbus</Filter>
</ClCompile>
<ClCompile Include="i2c_smbus\i2c_smbus_i801.cpp">
<Filter>Source Files\i2c_smbus</Filter>
</ClCompile>
<ClCompile Include="i2c_smbus\i2c_smbus_nct6775.cpp">
<Filter>Source Files\i2c_smbus</Filter>
</ClCompile>
<ClCompile Include="i2c_smbus\i2c_smbus_piix4.cpp">
<Filter>Source Files\i2c_smbus</Filter>
</ClCompile>
<ClCompile Include="RGBController\RGBController_AorusGPU.cpp">
<Filter>Source Files\RGBController</Filter>
</ClCompile>
<ClCompile Include="RGBController\RGBController_Aura.cpp">
<Filter>Source Files\RGBController</Filter>
</ClCompile>
<ClCompile Include="RGBController\RGBController_Corsair.cpp">
<Filter>Source Files\RGBController</Filter>
</ClCompile>
<ClCompile Include="RGBController\RGBController_CorsairPro.cpp">
<Filter>Source Files\RGBController</Filter>
</ClCompile>
<ClCompile Include="RGBController\RGBController_HyperX.cpp">
<Filter>Source Files\RGBController</Filter>
</ClCompile>
<ClCompile Include="RGBController\RGBController_LEDStrip.cpp">
<Filter>Source Files\RGBController</Filter>
</ClCompile>
<ClCompile Include="vc\I2CDetectDialog.cpp">
<Filter>Source Files\Application</Filter>
</ClCompile>
<ClCompile Include="Controllers\LEDStripController\LEDStripController.cpp">
<Filter>Source Files\Controllers</Filter>
</ClCompile>
<ClCompile Include="Controllers\LEDStripController\LEDStripControllerDetect.cpp">
<Filter>Source Files\Controllers</Filter>
</ClCompile>
<ClCompile Include="vc\OpenAuraSDKDialog.cpp">
<Filter>Source Files\Application</Filter>
</ClCompile>
<ClCompile Include="Controllers\HuePlusController\HuePlusController.cpp">
<Filter>Source Files\Controllers</Filter>
</ClCompile>
<ClCompile Include="Controllers\HuePlusController\HuePlusControllerDetect.cpp">
<Filter>Source Files\Controllers</Filter>
</ClCompile>
<ClCompile Include="net_port\net_port.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RGBController\RGBController_HuePlus.cpp">
<Filter>Source Files\RGBController</Filter>
</ClCompile>
<ClCompile Include="RGBController\RGBController_RazerChromaSDK.cpp">
<Filter>Source Files\RGBController</Filter>
</ClCompile>
<ClCompile Include="RGBController\RazerChromaSDKDetect.cpp">
<Filter>Source Files\RGBController</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="vc\Resource.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="wmi\wmi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="serial_port\serial_port.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Controllers\AuraController\AuraController.h">
<Filter>Header Files\Controllers</Filter>
</ClInclude>
<ClInclude Include="Controllers\CorsairController\CorsairController.h">
<Filter>Header Files\Controllers</Filter>
</ClInclude>
<ClInclude Include="Controllers\CorsairProController\CorsairProController.h">
<Filter>Header Files\Controllers</Filter>
</ClInclude>
<ClInclude Include="Controllers\HyperXController\HyperXController.h">
<Filter>Header Files\Controllers</Filter>
</ClInclude>
<ClInclude Include="Controllers\LEDStripController\LEDStripController.h">
<Filter>Header Files\Controllers</Filter>
</ClInclude>
<ClInclude Include="RGBController\RGBController.h">
<Filter>Header Files\RGBController</Filter>
</ClInclude>
<ClInclude Include="RGBController\RGBController_AorusGPU.h">
<Filter>Header Files\RGBController</Filter>
</ClInclude>
<ClInclude Include="RGBController\RGBController_Aura.h">
<Filter>Header Files\RGBController</Filter>
</ClInclude>
<ClInclude Include="RGBController\RGBController_Corsair.h">
<Filter>Header Files\RGBController</Filter>
</ClInclude>
<ClInclude Include="RGBController\RGBController_CorsairPro.h">
<Filter>Header Files\RGBController</Filter>
</ClInclude>
<ClInclude Include="RGBController\RGBController_HyperX.h">
<Filter>Header Files\RGBController</Filter>
</ClInclude>
<ClInclude Include="RGBController\RGBController_LEDStrip.h">
<Filter>Header Files\RGBController</Filter>
</ClInclude>
<ClInclude Include="i2c_smbus\i2c_smbus.h">
<Filter>Header Files\i2c_smbus</Filter>
</ClInclude>
<ClInclude Include="i2c_smbus\i2c_smbus_i801.h">
<Filter>Header Files\i2c_smbus</Filter>
</ClInclude>
<ClInclude Include="i2c_smbus\i2c_smbus_nct6775.h">
<Filter>Header Files\i2c_smbus</Filter>
</ClInclude>
<ClInclude Include="i2c_smbus\i2c_smbus_piix4.h">
<Filter>Header Files\i2c_smbus</Filter>
</ClInclude>
<ClInclude Include="vc\I2CDetectDialog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="OpenAuraSDK.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="vc\OpenAuraSDKDialog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="vc\resource.h">
<Filter>Resource Files</Filter>
</ClInclude>
<ClInclude Include="Controllers\HuePlusController\HuePlusController.h">
<Filter>Header Files\Controllers</Filter>
</ClInclude>
<ClInclude Include="net_port\net_port.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="RGBController\RGBController_HuePlus.h">
<Filter>Header Files\RGBController</Filter>
</ClInclude>
<ClInclude Include="RGBController\RGBController_RazerChromaSDK.h">
<Filter>Header Files\RGBController</Filter>
</ClInclude>
</ItemGroup>
</Project>
View File
+147
View File
@@ -0,0 +1,147 @@
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = OpenRGB
TEMPLATE = app
INCLUDEPATH += \
i2c_smbus/ \
i2c_tools/ \
net_port/ \
serial_port/ \
Controllers/AuraController/ \
Controllers/CorsairController/ \
Controllers/CorsairProController/ \
Controllers/HuePlusController/ \
Controllers/HyperXController/ \
Controllers/LEDStripController/ \
Controllers/RGBFusionController/ \
RGBController/ \
qt/
SOURCES += \
main.cpp \
OpenAuraSDK.cpp \
qt/OpenRGBDeviceInfoPage.cpp \
qt/OpenRGBDevicePage.cpp \
qt/OpenRGBDialog.cpp \
i2c_smbus/i2c_smbus.cpp \
i2c_tools/i2c_tools.cpp \
net_port/net_port.cpp \
qt/OpenRGBDialog2.cpp \
qt/OpenRGBSystemInfoPage.cpp \
qt/hsv.cpp \
serial_port/serial_port.cpp \
Controllers/AuraController/AuraController.cpp \
Controllers/AuraController/AuraControllerDetect.cpp \
Controllers/CorsairController/CorsairController.cpp \
Controllers/CorsairController/CorsairControllerDetect.cpp \
Controllers/CorsairProController/CorsairProController.cpp \
Controllers/CorsairProController/CorsairProControllerDetect.cpp \
Controllers/HuePlusController/HuePlusController.cpp \
Controllers/HuePlusController/HuePlusControllerDetect.cpp \
Controllers/HyperXController/HyperXController.cpp \
Controllers/HyperXController/HyperXControllerDetect.cpp \
Controllers/LEDStripController/LEDStripController.cpp \
Controllers/LEDStripController/LEDStripControllerDetect.cpp \
Controllers/RGBFusionController/RGBFusionController.cpp \
Controllers/RGBFusionController/RGBFusionControllerDetect.cpp \
RGBController/RGBController_Aura.cpp \
RGBController/RGBController_Corsair.cpp \
RGBController/RGBController_CorsairPro.cpp \
RGBController/RGBController_HuePlus.cpp \
RGBController/RGBController_HyperX.cpp \
RGBController/RGBController_LEDStrip.cpp \
RGBController/RGBController_RGBFusion.cpp
HEADERS += \
Controllers/RGBFusionController/RGBFusionController.h \
qt/OpenRGBDeviceInfoPage.h \
qt/OpenRGBDevicePage.h \
qt/OpenRGBDialog.h \
i2c_smbus/i2c_smbus.h \
i2c_tools/i2c_tools.h \
net_port/net_port.h \
qt/OpenRGBDialog2.h \
qt/OpenRGBSystemInfoPage.h \
serial_port/serial_port.h \
Controllers/AuraController/AuraController.h \
Controllers/CorsairController/CorsairController.h \
Controllers/CorsairProController/CorsairProController.h \
Controllers/HuePlusController/HuePlusController.h \
Controllers/HyperXController/HyperXController.h \
Controllers/LEDStripController/LEDStripController.h \
RGBController/RGBController.h \
RGBController/RGBController_Aura.h \
RGBController/RGBController_Corsair.h \
RGBController/RGBController_CorsairPro.h \
RGBController/RGBController_HuePlus.h \
RGBController/RGBController_HyperX.h \
RGBController/RGBController_RGBFusion.h
RESOURCES += \
qt/resources.qrc
FORMS += \
qt/OpenRGBDeviceInfoPage.ui \
qt/OpenRGBDevicePage.ui \
qt/OpenRGBDialog.ui \
qt/OpenRGBDialog2.ui \
qt/OpenRGBSystemInfoPage.ui
#-----------------------------------------------
# Windows specific project configuration
#-----------------------------------------------
win32:INCLUDEPATH += \
dependencies/inpout32_1501/Win32/ \
dependencies/razer-chroma-2.9.0/inc \
wmi/ \
win32:SOURCES += \
i2c_smbus/i2c_smbus_i801.cpp \
i2c_smbus/i2c_smbus_nct6775.cpp \
i2c_smbus/i2c_smbus_piix4.cpp \
wmi/wmi.cpp \
RGBController/RazerChromaSDKDetect.cpp \
RGBController/RGBController_RazerChromaSDK.cpp \
win32:HEADERS += \
dependencies/inpout32_1501/Win32/inpout32.h \
i2c_smbus/i2c_smbus_i801.h \
i2c_smbus/i2c_smbus_nct6775.h \
i2c_smbus/i2c_smbus_piix4.h \
wmi/wmi.h \
RGBController/RGBController_RazerChromaSDK.h \
win32:LIBS += \
-lws2_32 \
-L"$$PWD/dependencies/inpout32_1501/Win32/" -linpout32
win32:DEFINES -= \
UNICODE
win32:DEFINES += \
_MBCS \
WIN32 \
_CRT_SECURE_NO_WARNINGS \
_WINSOCK_DEPRECATED_NO_WARNINGS \
WIN32_LEAN_AND_MEAN
#-----------------------------------------------
# Linux specific project configuration
#-----------------------------------------------
unix:INCLUDEPATH += \
dependencies/libe131/src/ \
unix:HEADERS += \
i2c_smbus/i2c_smbus_linux.h \
RGBController/RGBController_E131.h \
unix:SOURCES += \
dependencies/libe131/src/e131.c \
i2c_smbus/i2c_smbus_linux.cpp \
RGBController/OpenRazerDetect.cpp \
RGBController/E131ControllerDetect.cpp \
RGBController/RGBController_E131.cpp \
RGBController/RGBController_OpenRazer.cpp \
+30 -23
View File
@@ -1,32 +1,39 @@
# OpenAuraSDK
##### This project is an open-source implementation of the Asus Aura RGB controller software. It currently only supports a limited number of motherboard and RAM module lighting controllers.
# OpenRGB (formerly OpenAuraSDK)
## Supported Devices
The goal of this project is to create an easy-to-use open source software program and library for accessing and controlling RGB lights on various PC hardware including motherboards, RAM modules, graphics cards, cooling devices, and peripherals.
Confirmed supported motherboards:
- ASUS PRIME X370 Pro
- ASUS PRIME X470 Pro
- ASUS PRIME Z270-A
- ASUS PRIME Z370-A
- ASUS ROG Strix Z370-E
Confirmed supported RGB RAM (except on X299):
- G.Skill Trident Z RGB
- Geil Super Luce
- TeamGroup Delta RGB
This project originally focused only on ASUS Aura. It was spun off of Keyboard Visualizer's AsusAuraWindows branch to learn more about the details behind the Aura protocol and to develop a more flexible, compatible, and reliable driver for Aura. Our Aura implementation is now quite solid and supports multiple generations of Aura controller across both Intel and AMD platforms. It also supports Aura-compatible controllers used across multiple manufacturers of RGB memory modules including G.Skill Trident Z RGB and others. It is still lacking a few capabilities, namely saving settings to persist across reboots, but the core functionality of setting colors and modes is there.
Experimental support in generic RGB testing branch:
- Corsair Vengeance RGB
- Corsair Vengeance Pro RGB
- HyperX Predator RGB
After getting a solid Aura implementation, the project branched out into other manufacturers and categories of RGB devices. A major focus was to develop a software API that could reliably represent as many RGB devices as possible, exposing their various modes and describing their LED layouts via zones, that was generic enough to write a user application without specifically targeting any one manufacturer. To this extent, the generic_rgb_interface_test branch was created which became the foundation of OpenRGB. The goal of OpenRGB is to both develop new drivers for unsupported devices and integrate existing open source drivers for devices that do have some sort of open support. The goal is to be the one-stop solution to open source RGB lighting control!
## Supported Devices
* Asus Aura (SMBus variants only)
* Gigabyte RGB Fusion 1.0
* Asus Aura RAM
* Corsair Vengeance RGB
* Corsair Vengeance Pro RGB
* HyperX Predator RGB
* NZXT Hue+
* KeyboardVisualizer Arduino LED Strips
* E1.31 (Linux only)
* OpenRazer (Linux only)
## Installation
#### Windows
1. Download the latest Visual Studio Community Edition and open the `.sln`.
2. Build the project for `x86` Architecture. The InpOut32 library I use does not support x64.
3. Copy InpOut32.dll from dependencies to the same path as OpenAuraSDK.exe.
**You may have to retarget the project to the latest version of the Windows SDK and build tools and stuff.**
1. Download the latest Visual Studio Community Edition and Qt Creator.
2. Open the OpenRGB_Win.pro project.
3. Build the project for `x86` Architecture. The InpOut32 library I use does not support x64.
4. Copy InpOut32.dll from dependencies to the same path as OpenAuraSDK.exe along with the Qt libraries.
**You must run the application as Administrator the first time to allow InpOut32 to set up. It can be run as a normal user afterwards**
+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);
}
+27 -6
View File
@@ -39,6 +39,22 @@ enum
ZONE_TYPE_MATRIX
};
typedef int device_type;
enum
{
DEVICE_TYPE_MOTHERBOARD,
DEVICE_TYPE_DRAM,
DEVICE_TYPE_GPU,
DEVICE_TYPE_COOLER,
DEVICE_TYPE_LEDSTRIP,
DEVICE_TYPE_KEYBOARD,
DEVICE_TYPE_MOUSE,
DEVICE_TYPE_MOUSEMAT,
DEVICE_TYPE_HEADSET,
DEVICE_TYPE_UNKNOWN
};
typedef struct
{
std::string name; /* Zone name */
@@ -50,11 +66,16 @@ typedef struct
class RGBController
{
public:
std::string name; /* controller name */
std::vector<led> leds; /* LEDs */
std::vector<zone> zones; /* Zones */
std::vector<mode> modes; /* Modes */
std::vector<RGBColor> colors; /* Color buffer */
std::string name; /* controller name */
std::string description; /* controller description */
std::string version; /* controller version */
std::string serial; /* controller serial number */
std::string location; /* controller location */
std::vector<led> leds; /* LEDs */
std::vector<zone> zones; /* Zones */
std::vector<mode> modes; /* Modes */
std::vector<RGBColor> colors; /* Color buffer */
device_type type; /* device type */
virtual int GetMode() = 0;
virtual void SetMode(int mode) = 0;
@@ -63,4 +84,4 @@ public:
virtual void SetAllZoneLEDs(int zone, RGBColor color) = 0;
virtual void SetLED(int led, RGBColor color) = 0;
virtual void UpdateLEDs() = 0;
};
};
+13 -2
View File
@@ -118,7 +118,18 @@ RGBController_Aura::RGBController_Aura(AuraController * aura_ptr)
aura = aura_ptr;
name = aura->GetDeviceName();
version = aura->GetDeviceName();
location = aura->GetDeviceLocation();
if((version.find("DIMM_LED") != std::string::npos) || (version.find("AUDA") != std::string::npos) )
{
type = DEVICE_TYPE_DRAM;
name = "ASUS Aura DRAM";
}
else
{
type = DEVICE_TYPE_MOTHERBOARD;
name = "ASUS Aura Motherboard";
}
mode aura_modes[AURA_NUMBER_MODES + 1];
@@ -200,4 +211,4 @@ RGBController_Aura::RGBController_Aura(AuraController * aura_ptr)
zones.push_back(*new_zone);
}
}
}
}
+4 -1
View File
@@ -67,6 +67,9 @@ RGBController_Corsair::RGBController_Corsair(CorsairController* corsair_ptr)
corsair = corsair_ptr;
name = corsair->GetDeviceName();
location = corsair->GetDeviceLocation();
type = DEVICE_TYPE_DRAM;
mode corsair_modes[CORSAIR_NUMBER_MODES];
@@ -104,4 +107,4 @@ RGBController_Corsair::RGBController_Corsair(CorsairController* corsair_ptr)
new_zone.map.push_back(zone_row);
zones.push_back(new_zone);
}
}
+1 -1
View File
@@ -26,4 +26,4 @@ public:
private:
CorsairController* corsair;
};
};
+4 -1
View File
@@ -103,6 +103,9 @@ RGBController_CorsairPro::RGBController_CorsairPro(CorsairProController* corsair
corsair = corsair_ptr;
name = corsair->GetDeviceName();
location = corsair->GetDeviceLocation();
type = DEVICE_TYPE_DRAM;
mode corsair_modes[CORSAIR_PRO_NUMBER_MODES];
@@ -147,4 +150,4 @@ RGBController_CorsairPro::RGBController_CorsairPro(CorsairProController* corsair
new_zone.map.push_back(zone_row);
zones.push_back(new_zone);
}
}
+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;
};
+77 -23
View File
@@ -11,31 +11,60 @@
RGBController_HuePlus::RGBController_HuePlus(HuePlusController* hueplus_ptr)
{
strip = hueplus_ptr;
hueplus = hueplus_ptr;
name = "LED Strip";
name = "NZXT Hue+";
type = DEVICE_TYPE_LEDSTRIP;
location = hueplus->GetLEDString();
mode led_mode;
led_mode.name = "Custom";
modes.push_back(led_mode);
for (int i = 0; i < strip->num_leds; i++)
{
colors.push_back(0x00000000);
led new_led;
new_led.name = "LED Strip";
leds.push_back(new_led);
}
unsigned int led_idx = 0;
zone led_zone;
led_zone.name = "LED Strip";
std::vector<int> led_zone_map;
for (int i = 0; i < strip->num_leds; i++)
for (int channel_idx = 0; channel_idx < HUE_PLUS_NUM_CHANNELS; channel_idx++)
{
led_zone_map.push_back(i);
if(hueplus->channel_leds[channel_idx] > 0)
{
zone* new_zone = new zone;
char ch_idx_string[2];
sprintf(ch_idx_string, "%d", channel_idx + 1);
new_zone->name = "Hue+ Channel ";
new_zone->name.append(ch_idx_string);
new_zone->type = ZONE_TYPE_LINEAR;
std::vector<int> *new_zone_map = new std::vector<int>();
for (int led_ch_idx = 0; led_ch_idx < hueplus->channel_leds[channel_idx]; led_ch_idx++)
{
colors.push_back(0x00000000);
char led_idx_string[3];
sprintf(led_idx_string, "%d", led_ch_idx + 1);
led new_led;
new_led.name = "Hue+ Channel ";
new_led.name.append(ch_idx_string);
new_led.name.append(", LED ");
new_led.name.append(led_idx_string);
leds.push_back(new_led);
leds_channel.push_back(channel_idx + 1);
new_zone_map->push_back(led_idx);
led_idx++;
}
new_zone->map.push_back(*new_zone_map);
zones.push_back(*new_zone);
zones_channel.push_back(channel_idx + 1);
}
}
led_zone.map.push_back(led_zone_map);
zones.push_back(led_zone);
}
int RGBController_HuePlus::GetMode()
@@ -60,27 +89,52 @@ void RGBController_HuePlus::SetAllLEDs(RGBColor color)
colors[i] = color;
}
strip->SetLEDs(colors);
hueplus->SetChannelLEDs(0, colors);
}
void RGBController_HuePlus::SetAllZoneLEDs(int zone, RGBColor color)
{
for (int i = 0; i < colors.size(); i++)
int channel = zones_channel[zone];
for (int x = 0; x < zones[zone].map.size(); x++)
{
colors[i] = color;
for (int y = 0; y < zones[zone].map[x].size(); y++)
{
colors[zones[zone].map[x][y]] = color;
}
}
strip->SetLEDs(colors);
std::vector<RGBColor> channel_colors;
for(int color = 0; color < colors.size(); color++)
{
if(leds_channel[color] == channel)
{
channel_colors.push_back(colors[color]);
}
}
hueplus->SetChannelLEDs(channel, channel_colors);
}
void RGBController_HuePlus::SetLED(int led, RGBColor color)
{
int channel = leds_channel[led];
colors[led] = color;
strip->SetLEDs(colors);
std::vector<RGBColor> channel_colors;
for(int color = 0; color < colors.size(); color++)
{
if(leds_channel[color] == channel)
{
channel_colors.push_back(colors[color]);
}
}
hueplus->SetChannelLEDs(channel, channel_colors);
}
void RGBController_HuePlus::UpdateLEDs()
{
strip->SetLEDs(colors);
}
hueplus->SetChannelLEDs(0, colors);
}
+3 -1
View File
@@ -24,5 +24,7 @@ public:
void UpdateLEDs();
private:
HuePlusController* strip;
HuePlusController* hueplus;
std::vector<unsigned int> leds_channel;
std::vector<unsigned int> zones_channel;
};
+74 -36
View File
@@ -21,7 +21,7 @@ void RGBController_HyperX::SetMode(int mode)
void RGBController_HyperX::SetCustomMode()
{
hyperx->SetMode(HYPERX_MODE_STATIC);
hyperx->SetMode(HYPERX_MODE_DIRECT);
}
void RGBController_HyperX::SetAllLEDs(RGBColor color)
@@ -30,7 +30,15 @@ void RGBController_HyperX::SetAllLEDs(RGBColor color)
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
hyperx->SetAllColors(red, grn, blu);
if(hyperx->GetMode() == HYPERX_MODE_DIRECT)
{
hyperx->SetAllColors(red, grn, blu);
}
else
{
hyperx->SetEffectColor(red, grn, blu);
}
}
void RGBController_HyperX::SetAllZoneLEDs(int zone, RGBColor color)
@@ -39,13 +47,20 @@ void RGBController_HyperX::SetAllZoneLEDs(int zone, RGBColor color)
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
for (int x = 0; x < zones[zone].map.size(); x++)
if(hyperx->GetMode() == HYPERX_MODE_DIRECT)
{
for (int y = 0; y < zones[zone].map[x].size(); y++)
for (int x = 0; x < zones[zone].map.size(); x++)
{
hyperx->SetLEDColor(zones[zone].map[x][y], red, grn, blu);
for (int y = 0; y < zones[zone].map[x].size(); y++)
{
hyperx->SetLEDColor(zones[zone].map[x][y], red, grn, blu);
}
}
}
else
{
hyperx->SetEffectColor(red, grn, blu);
}
}
void RGBController_HyperX::SetLED(int led, RGBColor color)
@@ -54,7 +69,14 @@ void RGBController_HyperX::SetLED(int led, RGBColor color)
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
hyperx->SetLEDColor(led, red, grn, blu);
if(hyperx->GetMode() == HYPERX_MODE_DIRECT)
{
hyperx->SetLEDColor(led, red, grn, blu);
}
else
{
hyperx->SetEffectColor(red, grn, blu);
}
}
void RGBController_HyperX::UpdateLEDs()
@@ -67,46 +89,62 @@ RGBController_HyperX::RGBController_HyperX(HyperXController* hyperx_ptr)
hyperx = hyperx_ptr;
name = hyperx->GetDeviceName();
location = hyperx->GetDeviceLocation();
type = DEVICE_TYPE_DRAM;
mode hyperx_modes[HYPERX_NUMBER_MODES];
hyperx_modes[0].name = "Static";
hyperx_modes[1].name = "Rainbow";
hyperx_modes[2].name = "Comet";
hyperx_modes[3].name = "Heartbeat";
hyperx_modes[4].name = "Spectrum Cycle";
hyperx_modes[5].name = "Breathing";
hyperx_modes[6].name = "Bounce";
hyperx_modes[7].name = "Blink";
hyperx_modes[0].name = "Direct";
hyperx_modes[1].name = "Static";
hyperx_modes[2].name = "Rainbow";
hyperx_modes[3].name = "Comet";
hyperx_modes[4].name = "Heartbeat";
hyperx_modes[5].name = "Spectrum Cycle";
hyperx_modes[6].name = "Breathing";
hyperx_modes[7].name = "Bounce";
hyperx_modes[8].name = "Blink";
for (int i = 0; i < HYPERX_NUMBER_MODES; i++)
{
modes.push_back(hyperx_modes[i]);
}
for (int i = 0; i < hyperx->GetLEDCount(); i++)
unsigned int led_idx = 0;
for(int slot = 0; slot < hyperx->GetSlotCount(); slot++)
{
led* new_led = new led();
zone* new_zone = new zone;
new_led->name = "HyperX LED";
char slot_idx_str[3];
sprintf(slot_idx_str, "%d", slot);
new_zone->name = "HyperX Slot ";
new_zone->name.append(slot_idx_str);
leds.push_back(*new_led);
colors.push_back(0x00000000);
new_zone->type = ZONE_TYPE_LINEAR;
std::vector<int> *new_zone_map = new std::vector<int>();
for(int led_slot_idx = 0; led_slot_idx < 5; led_slot_idx++)
{
colors.push_back(0x00000000);
led* new_led = new led();
char led_idx_str[3];
sprintf(led_idx_str, "%d", led_slot_idx);
new_led->name = "HyperX Slot ";
new_led->name.append(slot_idx_str);
new_led->name.append(", LED ");
new_led->name.append(led_idx_str);
leds.push_back(*new_led);
new_zone_map->push_back(led_idx);
led_idx++;
}
new_zone->map.push_back(*new_zone_map);
zones.push_back(*new_zone);
}
zone new_zone;
new_zone.name = "HyperX Zone";
new_zone.type = ZONE_TYPE_SINGLE;
std::vector<int> zone_row;
for (int i = 0; i < hyperx->GetLEDCount(); i++)
{
zone_row.push_back(i);
}
new_zone.map.push_back(zone_row);
zones.push_back(new_zone);
}
}
+3 -1
View File
@@ -16,6 +16,8 @@ RGBController_LEDStrip::RGBController_LEDStrip(LEDStripController* ledstrip_ptr)
name = "LED Strip";
type = DEVICE_TYPE_LEDSTRIP;
mode led_mode;
led_mode.name = "Custom";
modes.push_back(led_mode);
@@ -84,4 +86,4 @@ void RGBController_LEDStrip::SetLED(int led, RGBColor color)
void RGBController_LEDStrip::UpdateLEDs()
{
strip->SetLEDs(colors);
}
}
+153 -512
View File
@@ -10,7 +10,7 @@
#include "RGBController_OpenRazer.h"
#include <fstream>
#include <unistd.h>
int RGBController_OpenRazer::GetMode()
{
return(0);
@@ -20,7 +20,7 @@ void RGBController_OpenRazer::SetMode(int mode)
{
char update_value = 1;
switch(type)
switch(matrix_type)
{
case RAZER_TYPE_MATRIX_FRAME:
case RAZER_TYPE_MATRIX_NOFRAME:
@@ -92,32 +92,34 @@ void RGBController_OpenRazer::SetCustomMode()
void RGBController_OpenRazer::UpdateLEDs()
{
switch(type)
switch(matrix_type)
{
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(matrix_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(matrix_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(matrix_type == RAZER_TYPE_MATRIX_FRAME)
{
matrix_custom_frame.write(output_array, output_array_size);
matrix_custom_frame.flush();
}
else if(matrix_type == RAZER_TYPE_MATRIX_NOFRAME)
{
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(matrix_type == RAZER_TYPE_MATRIX_FRAME)
{
matrix_effect_custom.write(&update_value, 1);
matrix_effect_custom.flush();
}
}
break;
@@ -220,72 +231,32 @@ static std::string GetDeviceTypeString(std::string dev_path)
return(ret_str);
}
unsigned int RGBController_OpenRazer::GetTypeFromDeviceName(std::string dev_name)
static std::string GetFirmwareVersionString(std::string dev_path)
{
if(dev_name == "Razer Mamba Tournament Edition")
{
return(RAZER_MAMBA_TOURNAMENT_EDITION_CHROMA);
}
// Read firmware_version for firmware version string
std::string firm_ver_path = dev_path + "/firmware_version";
std::ifstream firm_ver_file;
std::string ret_str;
else if(dev_name == "Razer DeathAdder Chroma")
{
return(RAZER_DEATHADDER_CHROMA);
}
firm_ver_file.open(firm_ver_path);
std::getline(firm_ver_file, ret_str);
firm_ver_file.close();
else if(dev_name == "Razer Diamondback Chroma")
{
return(RAZER_DIAMONDBACK_CHROMA);
}
return(ret_str);
}
else if(dev_name == "Razer DeathStalker Chroma")
{
return(RAZER_DEATHSTALKER_CHROMA);
}
static std::string GetSerialNumberString(std::string dev_path)
{
// Read device_serial for serial number string
std::string ser_num_path = dev_path + "/device_serial";
std::ifstream ser_num_file;
std::string ret_str;
else if(dev_name == "Razer Tartarus Chroma")
{
return(RAZER_TARTARUS_CHROMA);
}
ser_num_file.open(ser_num_path);
std::getline(ser_num_file, ret_str);
ser_num_file.close();
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);
}
return(ret_str);
}
void RGBController_OpenRazer::SetupMatrixDevice(std::string dev_path, unsigned int rows, unsigned int cols)
@@ -301,11 +272,21 @@ void RGBController_OpenRazer::SetupMatrixDevice(std::string dev_path, unsigned i
if(!matrix_custom_frame)
{
type = RAZER_TYPE_MATRIX_NOFRAME;
if(!matrix_effect_custom)
{
matrix_type = RAZER_TYPE_MATRIX_STATIC;
}
else
{
matrix_type = RAZER_TYPE_MATRIX_NOFRAME;
}
matrix_rows = 1;
matrix_cols = 1;
}
else
{
type = RAZER_TYPE_MATRIX_FRAME;
matrix_type = RAZER_TYPE_MATRIX_FRAME;
matrix_rows = rows;
matrix_cols = cols;
@@ -319,464 +300,124 @@ void RGBController_OpenRazer::SetupNonMatrixDevice(std::string dev_path)
scroll_led_effect.open(dev_path + "/scroll_led_effect");
scroll_led_rgb.open(dev_path + "/scroll_led_rgb");
type = RAZER_TYPE_NOMATRIX;
matrix_type = RAZER_TYPE_NOMATRIX;
}
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);
/*-----------------------------------------------------------------*\
| Set the description to indicate this is an OpenRazer device |
\*-----------------------------------------------------------------*/
description = "OpenRazer Device";
/*-----------------------------------------------------------------*\
| Set the device path as the location |
\*-----------------------------------------------------------------*/
location = dev_path;
mode razer_modes[RAZER_NUM_MODES];
/*-----------------------------------------------------------------*\
| Get the serial number from the dev path |
\*-----------------------------------------------------------------*/
serial = GetSerialNumberString(dev_path);
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";
/*-----------------------------------------------------------------*\
| Get the firmware version from the dev path |
\*-----------------------------------------------------------------*/
version = GetFirmwareVersionString(dev_path);
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:
/*---------------------------------------------------------*\
| Set device type |
\*---------------------------------------------------------*/
type = device_list[i]->type;
/*---------------------------------------------------------*\
| 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;
}
}
}
+885 -27
View File
@@ -12,33 +12,891 @@
#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;
device_type type;
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",
DEVICE_TYPE_KEYBOARD,
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",
DEVICE_TYPE_KEYBOARD,
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",
DEVICE_TYPE_KEYBOARD,
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",
DEVICE_TYPE_KEYBOARD,
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",
DEVICE_TYPE_KEYBOARD,
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)",
DEVICE_TYPE_KEYBOARD,
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)",
DEVICE_TYPE_KEYBOARD,
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",
DEVICE_TYPE_MOUSE,
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",
DEVICE_TYPE_MOUSE,
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",
DEVICE_TYPE_MOUSE,
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",
DEVICE_TYPE_MOUSE,
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",
DEVICE_TYPE_KEYBOARD,
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",
DEVICE_TYPE_KEYBOARD,
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",
DEVICE_TYPE_MOUSEMAT,
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",
DEVICE_TYPE_MOUSEMAT,
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",
DEVICE_TYPE_HEADSET,
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",
DEVICE_TYPE_HEADSET,
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",
DEVICE_TYPE_UNKNOWN,
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",
DEVICE_TYPE_UNKNOWN,
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",
DEVICE_TYPE_LEDSTRIP,
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 +913,7 @@ public:
{
RAZER_TYPE_MATRIX_FRAME,
RAZER_TYPE_MATRIX_NOFRAME,
RAZER_TYPE_MATRIX_STATIC,
RAZER_TYPE_NOMATRIX,
RAZER_NUM_TYPES
};
@@ -69,14 +928,13 @@ 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_type;
unsigned int matrix_rows;
unsigned int matrix_cols;
+112
View File
@@ -0,0 +1,112 @@
/*-----------------------------------------*\
| RGBController_Polychrome.cpp |
| |
| Generic RGB Interface for OpenRGB |
| ASRock ASR LED and Polychrome RGB Driver |
| |
| Adam Honse (CalcProgrammer1) 12/15/2019 |
\*-----------------------------------------*/
#include "RGBController_Polychrome.h"
int RGBController_Polychrome::GetMode()
{
return(polychrome->GetMode());
}
void RGBController_Polychrome::SetMode(int mode)
{
polychrome->SetMode(mode);
}
void RGBController_Polychrome::SetCustomMode()
{
polychrome->SetMode(POLYCHROME_MODE_STATIC);
}
void RGBController_Polychrome::SetAllLEDs(RGBColor color)
{
unsigned char red = RGBGetRValue(color);
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
polychrome->SetAllColors(red, grn, blu);
}
void RGBController_Polychrome::SetAllZoneLEDs(int zone, RGBColor color)
{
unsigned char red = RGBGetRValue(color);
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
polychrome->SetLEDColor(zone, red, grn, blu);
}
void RGBController_Polychrome::SetLED(int led, RGBColor color)
{
unsigned char red = RGBGetRValue(color);
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
polychrome->SetLEDColor(led, red, grn, blu);
}
void RGBController_Polychrome::UpdateLEDs()
{
for (int led = 0; led < colors.size(); led++)
{
unsigned char red = RGBGetRValue(colors[led]);
unsigned char grn = RGBGetGValue(colors[led]);
unsigned char blu = RGBGetBValue(colors[led]);
polychrome->SetLEDColor(led, red, grn, blu);
}
}
static const char* polychrome_zone_names[] =
{
"Motherboard"
};
RGBController_Polychrome::RGBController_Polychrome(PolychromeController* polychrome_ptr)
{
polychrome = polychrome_ptr;
name = polychrome->GetDeviceName();
mode polychrome_modes[POLYCHROME_NUM_MODES];
polychrome_modes[0].name = "Static";
polychrome_modes[1].name = "Breathing";
polychrome_modes[2].name = "Flashing";
for (int i = 0; i < POLYCHROME_NUM_MODES; i++)
{
modes.push_back(polychrome_modes[i]);
}
// Search through all LEDs and create zones for each channel type
for (int i = 0; i < polychrome->GetLEDCount(); i++)
{
zone* new_zone = new zone();
led* new_led = new led();
std::vector<int>* zone_row = new std::vector<int>();
// Set zone name to channel name
new_zone->name = polychrome_zone_names[i];
new_led->name = polychrome_zone_names[i];
zone_row->push_back(i);
// Aura devices can be either single or linear, never matrix
// That means only one row is needed
new_zone->map.push_back(*zone_row);
// Push new LED to LEDs vector
leds.push_back(*new_led);
// Push new zone to zones vector
zones.push_back(*new_zone);
}
}
+29
View File
@@ -0,0 +1,29 @@
/*-----------------------------------------*\
| RGBController_Polychrome.h |
| |
| Generic RGB Interface for OpenRGB |
| ASRock ASR LED and Polychrome RGB Driver |
| |
| Adam Honse (CalcProgrammer1) 12/15/2019 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "PolychromeController.h"
class RGBController_Polychrome : public RGBController
{
public:
RGBController_Polychrome(PolychromeController* polychrome_ptr);
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:
PolychromeController* polychrome;
};
+117
View File
@@ -0,0 +1,117 @@
/*-----------------------------------------*\
| RGBController_RGBFusion.cpp |
| |
| Generic RGB Interface for OpenRGB |
| Gigabyte RGB Fusion Driver |
| |
| Adam Honse (CalcProgrammer1) 12/11/2019 |
\*-----------------------------------------*/
#include "RGBController_RGBFusion.h"
int RGBController_RGBFusion::GetMode()
{
return(rgb_fusion->GetMode());
}
void RGBController_RGBFusion::SetMode(int mode)
{
rgb_fusion->SetMode(mode);
}
void RGBController_RGBFusion::SetCustomMode()
{
rgb_fusion->SetMode(RGB_FUSION_MODE_STATIC);
}
void RGBController_RGBFusion::SetAllLEDs(RGBColor color)
{
unsigned char red = RGBGetRValue(color);
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
rgb_fusion->SetAllColors(red, grn, blu);
}
void RGBController_RGBFusion::SetAllZoneLEDs(int zone, RGBColor color)
{
unsigned char red = RGBGetRValue(color);
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
rgb_fusion->SetLEDColor(zone, red, grn, blu);
}
void RGBController_RGBFusion::SetLED(int led, RGBColor color)
{
unsigned char red = RGBGetRValue(color);
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
rgb_fusion->SetLEDColor(led, red, grn, blu);
}
void RGBController_RGBFusion::UpdateLEDs()
{
for (int led = 0; led < colors.size(); led++)
{
unsigned char red = RGBGetRValue(colors[led]);
unsigned char grn = RGBGetGValue(colors[led]);
unsigned char blu = RGBGetBValue(colors[led]);
rgb_fusion->SetLEDColor(led, red, grn, blu);
}
}
static const char* rgb_fusion_zone_names[] =
{
"Motherboard",
"RGB Header"
};
RGBController_RGBFusion::RGBController_RGBFusion(RGBFusionController* rgb_fusion_ptr)
{
rgb_fusion = rgb_fusion_ptr;
name = rgb_fusion->GetDeviceName();
description = "RGB Fusion 1.0";
location = rgb_fusion->GetDeviceLocation();
type = DEVICE_TYPE_MOTHERBOARD;
mode rgb_fusion_modes[RGB_FUSION_NUMBER_MODES];
rgb_fusion_modes[0].name = "Static";
rgb_fusion_modes[1].name = "Breathing";
rgb_fusion_modes[2].name = "Flashing";
for (int i = 0; i < RGB_FUSION_NUMBER_MODES; i++)
{
modes.push_back(rgb_fusion_modes[i]);
}
// Search through all LEDs and create zones for each channel type
for (int i = 0; i < rgb_fusion->GetLEDCount(); i++)
{
zone* new_zone = new zone();
led* new_led = new led();
std::vector<int>* zone_row = new std::vector<int>();
// Set zone name to channel name
new_zone->name = rgb_fusion_zone_names[i];
new_led->name = rgb_fusion_zone_names[i];
zone_row->push_back(i);
// Aura devices can be either single or linear, never matrix
// That means only one row is needed
new_zone->map.push_back(*zone_row);
// Push new LED to LEDs vector
leds.push_back(*new_led);
// Push new zone to zones vector
zones.push_back(*new_zone);
}
}
+29
View File
@@ -0,0 +1,29 @@
/*-----------------------------------------*\
| RGBController_RGBFusion.h |
| |
| Generic RGB Interface for OpenRGB |
| Gigabyte RGB Fusion Driver |
| |
| Adam Honse (CalcProgrammer1) 12/11/2019 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "RGBFusionController.h"
class RGBController_RGBFusion : public RGBController
{
public:
RGBController_RGBFusion(RGBFusionController* rgb_fusion_ptr);
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:
RGBFusionController* rgb_fusion;
};
@@ -22,9 +22,11 @@ RGBController_RazerChromaSDK::RGBController_RazerChromaSDK(unsigned int device_t
for (int i = 0; i < RAZER_NUM_DEVICES; i++)
{
if (device_list[i]->type == device_type)
if (device_list[i]->razer_type == device_type)
{
name = device_list[i]->name;
type = device_list[i]->type;
location = "Razer Chroma SDK";
for (int zone_id = 0; zone_id < RAZER_MAX_ZONES; zone_id++)
{
@@ -115,7 +117,7 @@ void RGBController_RazerChromaSDK::SetLED(int led, RGBColor color)
void RGBController_RazerChromaSDK::UpdateLEDs()
{
switch (device->type)
switch (device->razer_type)
{
case RAZER_GENERIC_MOUSE:
{
@@ -186,4 +188,4 @@ void RGBController_RazerChromaSDK::UpdateLEDs()
}
break;
}
}
}
+5 -1
View File
@@ -59,6 +59,7 @@ typedef struct
typedef struct
{
std::string name;
unsigned int razer_type;
unsigned int type;
const razer_zone* zones[RAZER_MAX_ZONES];
} razer_device;
@@ -136,6 +137,7 @@ static const razer_device mouse_device =
{
"Razer Generic Mouse",
RAZER_GENERIC_MOUSE,
DEVICE_TYPE_MOUSE,
{
&mouse_left_zone,
&mouse_right_zone,
@@ -164,6 +166,7 @@ static const razer_device mousepad_device =
{
"Razer Generic Mousepad",
RAZER_GENERIC_MOUSEPAD,
DEVICE_TYPE_MOUSE,
{
&mousepad_zone,
NULL,
@@ -204,6 +207,7 @@ static const razer_device chromahdk_device =
{
"Razer Chroma HDK",
RAZER_CHROMA_HDK,
DEVICE_TYPE_LEDSTRIP,
{
&chromahdk_zone,
&chromahdk_zone,
@@ -242,4 +246,4 @@ private:
static CREATEMOUSEPADEFFECT CreateMousepadEffect;
static CREATEHEADSETEFFECT CreateHeadsetEffect;
static CREATECHROMALINKEFFECT CreateChromaLinkEffect;
};
};
Vendored Submodule
+1
Submodule dependencies/libe131 added at 0fc009f1f6
+123
View File
@@ -0,0 +1,123 @@
#include "i2c_tools.h"
/******************************************************************************************\
* *
* i2c_detect *
* *
* Prints a list of all detected I2C addresses on the given bus *
* *
* bus - pointer to i2c_smbus_interface to scan *
* mode - one of AUTO, QUICK, READ, FUNC - method of access *
* *
* Code adapted from i2cdetect.c from i2c-tools Linux package *
* *
\******************************************************************************************/
std::string i2c_detect(i2c_smbus_interface * bus, int mode)
{
int i, j;
int first = 0x03, last = 0x77;
int res;
int slave_addr;
char line[128];
std::string text;
sprintf(line, " 0 1 2 3 4 5 6 7 8 9 a b c d e f\r\n");
text.append(line);
for (i = 0; i < 128; i += 16)
{
sprintf(line, "%02x: ", i);
text.append(line);
for (j = 0; j < 16; j++)
{
/* Skip unwanted addresses */
if (i+j < first || i+j > last)
{
sprintf(line, " ");
text.append(line);
continue;
}
/* Set slave address */
slave_addr = i + j;
/* Probe this address */
switch (mode)
{
case MODE_QUICK:
res = bus->i2c_smbus_write_quick(slave_addr, I2C_SMBUS_WRITE);
break;
case MODE_READ:
res = bus->i2c_smbus_read_byte(slave_addr);
break;
default:
if ((i + j >= 0x30 && i + j <= 0x37)
|| (i + j >= 0x50 && i + j <= 0x5F))
res = bus->i2c_smbus_read_byte(slave_addr);
else
res = bus->i2c_smbus_write_quick(slave_addr, I2C_SMBUS_WRITE);
break;
}
if (res < 0)
{
sprintf(line, "-- ");
text.append(line);
}
else
{
sprintf(line, "%02x ", i + j);
text.append(line);
}
}
sprintf(line, "\r\n");
text.append(line);
}
return text;
} /* i2c_detect() */
/******************************************************************************************\
* *
* i2c_dump *
* *
* Prints the values at each address of a given SMBus device *
* *
* bus - pointer to i2c_smbus_interface to scan *
* address - SMBus device address to scan *
* *
\******************************************************************************************/
std::string i2c_dump(i2c_smbus_interface * bus, unsigned char address)
{
int i, j;
int start = 0x0000;
char line[128];
std::string text;
sprintf(line, " 0 1 2 3 4 5 6 7 8 9 a b c d e f\r\n");
text.append(line);
for (i = 0; i < 0xFF; i += 16)
{
sprintf(line, "%04x: ", i + start);
text.append(line);
for (j = 0; j < 16; j++)
{
sprintf(line, "%02x ", (unsigned char )bus->i2c_smbus_read_byte_data(address, start + i + j));
text.append(line);
}
sprintf(line, "\r\n");
text.append(line);
}
return text;
} /* i2c_dump() */
+11
View File
@@ -0,0 +1,11 @@
#include <string>
#include "i2c_smbus.h"
#define MODE_AUTO 0
#define MODE_QUICK 1
#define MODE_READ 2
#define MODE_FUNC 3
std::string i2c_detect(i2c_smbus_interface * bus, int mode);
std::string i2c_dump(i2c_smbus_interface * bus, unsigned char address);
+2 -32
View File
@@ -13,15 +13,8 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef WIN32
#include "OpenRGBDialog2.h"
#include "OpenAuraSDKDialog.h"
#else /* WIN32 */
#include "OpenAuraSDKQtDialog.h"
#endif /* WIN32 */
extern std::vector<i2c_smbus_interface*> busses;
extern std::vector<RGBController*> rgb_controllers;
@@ -38,33 +31,10 @@ int main(int argc, char* argv[])
{
DetectRGBControllers();
#if WIN32
OpenAuraSDKDialog dlg(busses, rgb_controllers);
dlg.DoModal();
return 0;
#else
QApplication a(argc, argv);
Ui::OpenAuraSDKQtDialog dlg(busses, rgb_controllers);
Ui::OpenRGBDialog2 dlg(busses, rgb_controllers);
dlg.show();
return a.exec();
#endif
}
/******************************************************************************************\
* *
* wWinMain *
* *
* Entry point for Windows. Calls main(). *
* *
\******************************************************************************************/
#ifdef WIN32
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
{
main(0, NULL);
}
#endif
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

+54
View File
@@ -0,0 +1,54 @@
#include "OpenRGBDeviceInfoPage.h"
using namespace Ui;
OpenRGBDeviceInfoPage::OpenRGBDeviceInfoPage(RGBController *dev, QWidget *parent) :
QFrame(parent),
ui(new Ui::OpenRGBDeviceInfoPageUi)
{
ui->setupUi(this);
switch(dev->type)
{
case DEVICE_TYPE_MOTHERBOARD:
ui->TypeValue->setText("Motherboard");
break;
case DEVICE_TYPE_DRAM:
ui->TypeValue->setText("DRAM");
break;
case DEVICE_TYPE_GPU:
ui->TypeValue->setText("GPU");
break;
case DEVICE_TYPE_COOLER:
ui->TypeValue->setText("Cooler");
break;
case DEVICE_TYPE_LEDSTRIP:
ui->TypeValue->setText("LED Strip");
break;
case DEVICE_TYPE_KEYBOARD:
ui->TypeValue->setText("Keyboard");
break;
case DEVICE_TYPE_MOUSE:
ui->TypeValue->setText("Mouse");
break;
case DEVICE_TYPE_MOUSEMAT:
ui->TypeValue->setText("Mousemat");
break;
case DEVICE_TYPE_HEADSET:
ui->TypeValue->setText("Headset");
break;
default:
ui->TypeValue->setText("Unknown");
}
ui->NameValue->setText(QString::fromStdString(dev->name));
ui->DescriptionValue->setText(QString::fromStdString(dev->description));
ui->VersionValue->setText(QString::fromStdString(dev->version));
ui->LocationValue->setText(QString::fromStdString(dev->location));
ui->SerialValue->setText(QString::fromStdString(dev->serial));
}
OpenRGBDeviceInfoPage::~OpenRGBDeviceInfoPage()
{
delete ui;
}
+24
View File
@@ -0,0 +1,24 @@
#ifndef OPENRGBDEVICEINFOPAGE_H
#define OPENRGBDEVICEINFOPAGE_H
#include <QFrame>
#include "RGBController.h"
#include "ui_OpenRGBDeviceInfoPage.h"
namespace Ui {
class OpenRGBDeviceInfoPage;
}
class Ui::OpenRGBDeviceInfoPage : public QFrame
{
Q_OBJECT
public:
explicit OpenRGBDeviceInfoPage(RGBController *dev, QWidget *parent = nullptr);
~OpenRGBDeviceInfoPage();
private:
Ui::OpenRGBDeviceInfoPageUi *ui;
};
#endif // OPENRGBDEVICEINFOPAGE_H
+175
View File
@@ -0,0 +1,175 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OpenRGBDeviceInfoPageUi</class>
<widget class="QFrame" name="OpenRGBDeviceInfoPageUi">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Frame</string>
</property>
<widget class="QLabel" name="TypeLabel">
<property name="geometry">
<rect>
<x>100</x>
<y>80</y>
<width>60</width>
<height>14</height>
</rect>
</property>
<property name="text">
<string>Type:</string>
</property>
</widget>
<widget class="QLabel" name="TypeValue">
<property name="geometry">
<rect>
<x>180</x>
<y>80</y>
<width>240</width>
<height>14</height>
</rect>
</property>
<property name="text">
<string>Type Value</string>
</property>
</widget>
<widget class="QLabel" name="DescriptionValue">
<property name="geometry">
<rect>
<x>180</x>
<y>100</y>
<width>240</width>
<height>14</height>
</rect>
</property>
<property name="text">
<string>Description Value</string>
</property>
</widget>
<widget class="QLabel" name="DescriptionLabel">
<property name="geometry">
<rect>
<x>100</x>
<y>100</y>
<width>60</width>
<height>14</height>
</rect>
</property>
<property name="text">
<string>Description:</string>
</property>
</widget>
<widget class="QLabel" name="VersionValue">
<property name="geometry">
<rect>
<x>180</x>
<y>120</y>
<width>240</width>
<height>14</height>
</rect>
</property>
<property name="text">
<string>Version Value</string>
</property>
</widget>
<widget class="QLabel" name="VersionLabel">
<property name="geometry">
<rect>
<x>100</x>
<y>120</y>
<width>60</width>
<height>14</height>
</rect>
</property>
<property name="text">
<string>Version:</string>
</property>
</widget>
<widget class="QLabel" name="LocationLabel">
<property name="geometry">
<rect>
<x>100</x>
<y>140</y>
<width>60</width>
<height>14</height>
</rect>
</property>
<property name="text">
<string>Location:</string>
</property>
</widget>
<widget class="QLabel" name="LocationValue">
<property name="geometry">
<rect>
<x>180</x>
<y>140</y>
<width>240</width>
<height>14</height>
</rect>
</property>
<property name="text">
<string>Location Value</string>
</property>
</widget>
<widget class="QLabel" name="NameValue">
<property name="geometry">
<rect>
<x>180</x>
<y>60</y>
<width>240</width>
<height>14</height>
</rect>
</property>
<property name="text">
<string>Name Value</string>
</property>
</widget>
<widget class="QLabel" name="NameLabel">
<property name="geometry">
<rect>
<x>100</x>
<y>60</y>
<width>60</width>
<height>14</height>
</rect>
</property>
<property name="text">
<string>Name:</string>
</property>
</widget>
<widget class="QLabel" name="SerialValue">
<property name="geometry">
<rect>
<x>180</x>
<y>160</y>
<width>240</width>
<height>14</height>
</rect>
</property>
<property name="text">
<string>Serial Value</string>
</property>
</widget>
<widget class="QLabel" name="SerialLabel">
<property name="geometry">
<rect>
<x>100</x>
<y>160</y>
<width>60</width>
<height>14</height>
</rect>
</property>
<property name="text">
<string>Serial:</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
+314
View File
@@ -0,0 +1,314 @@
#include "OpenRGBDevicePage.h"
#include "hsv.h"
using namespace Ui;
OpenRGBDevicePage::OpenRGBDevicePage(RGBController *dev, QWidget *parent) :
QFrame(parent),
ui(new Ui::OpenRGBDevicePageUi)
{
ui->setupUi(this);
/*-----------------------------------------------------*\
| Store device pointer |
\*-----------------------------------------------------*/
device = dev;
/*-----------------------------------------------------*\
| Set up the color palette buttons |
\*-----------------------------------------------------*/
QPalette pal;
pal = ui->ButtonRed->palette();
pal.setColor(QPalette::Button, QColor(255, 0, 0));
ui->ButtonRed->setAutoFillBackground(true);
ui->ButtonRed->setPalette(pal);
ui->ButtonRed->setFlat(true);
ui->ButtonRed->update();
pal = ui->ButtonYellow->palette();
pal.setColor(QPalette::Button, QColor(255, 255, 0));
ui->ButtonYellow->setAutoFillBackground(true);
ui->ButtonYellow->setPalette(pal);
ui->ButtonYellow->setFlat(true);
ui->ButtonYellow->update();
pal = ui->ButtonGreen->palette();
pal.setColor(QPalette::Button, QColor(0, 255, 0));
ui->ButtonGreen->setAutoFillBackground(true);
ui->ButtonGreen->setPalette(pal);
ui->ButtonGreen->setFlat(true);
ui->ButtonGreen->update();
pal = ui->ButtonCyan->palette();
pal.setColor(QPalette::Button, QColor(0, 255, 255));
ui->ButtonCyan->setAutoFillBackground(true);
ui->ButtonCyan->setPalette(pal);
ui->ButtonCyan->setFlat(true);
ui->ButtonCyan->update();
pal = ui->ButtonBlue->palette();
pal.setColor(QPalette::Button, QColor(0, 0, 255));
ui->ButtonBlue->setAutoFillBackground(true);
ui->ButtonBlue->setPalette(pal);
ui->ButtonBlue->setFlat(true);
ui->ButtonBlue->update();
pal = ui->ButtonMagenta->palette();
pal.setColor(QPalette::Button, QColor(255, 0, 255));
ui->ButtonMagenta->setAutoFillBackground(true);
ui->ButtonMagenta->setPalette(pal);
ui->ButtonMagenta->setFlat(true);
ui->ButtonMagenta->update();
/*-----------------------------------------------------*\
| Fill in the combo boxes with device information |
\*-----------------------------------------------------*/
ui->ModeBox->clear();
for (int i = 0; i < device->modes.size(); i++)
{
ui->ModeBox->addItem(device->modes[i].name.c_str());
}
ui->ModeBox->setCurrentIndex(device->GetMode());
ui->ZoneBox->clear();
for (int i = 0; i < device->zones.size(); i++)
{
ui->ZoneBox->addItem(device->zones[i].name.c_str());
}
ui->ZoneBox->setCurrentIndex(0);
ui->LEDBox->clear();
for (int i = 0; i < device->leds.size(); i++)
{
ui->LEDBox->addItem(device->leds[i].name.c_str());
}
ui->LEDBox->setCurrentIndex(0);
}
OpenRGBDevicePage::~OpenRGBDevicePage()
{
delete ui;
}
void Ui::OpenRGBDevicePage::on_ZoneBox_currentIndexChanged(int index)
{
}
void Ui::OpenRGBDevicePage::on_LEDBox_currentIndexChanged(int index)
{
}
void Ui::OpenRGBDevicePage::on_ModeBox_currentIndexChanged(int index)
{
/*-----------------------------------------------------*\
| Change device mode |
\*-----------------------------------------------------*/
device->SetMode(ui->ModeBox->currentIndex());
}
void Ui::OpenRGBDevicePage::SetDevice(unsigned char red, unsigned char green, unsigned char blue)
{
UpdatingColor = true;
ui->RedSpinBox->setValue(red);
ui->GreenSpinBox->setValue(green);
ui->BlueSpinBox->setValue(blue);
UpdatingColor = false;
updateHSV();
on_SetDeviceButton_clicked();
}
void Ui::OpenRGBDevicePage::on_SetDeviceButton_clicked()
{
/*-----------------------------------------------------*\
| Set all device LEDs to the current color |
\*-----------------------------------------------------*/
RGBColor color = ToRGBColor(
ui->RedSpinBox->text().toInt(),
ui->GreenSpinBox->text().toInt(),
ui->BlueSpinBox->text().toInt()
);
device->SetAllLEDs(color);
}
void Ui::OpenRGBDevicePage::on_SetZoneButton_clicked()
{
/*-----------------------------------------------------*\
| Set all LEDs in the selected zone to the current color|
\*-----------------------------------------------------*/
RGBColor color = ToRGBColor(
ui->RedSpinBox->text().toInt(),
ui->GreenSpinBox->text().toInt(),
ui->BlueSpinBox->text().toInt()
);
device->SetAllZoneLEDs(ui->ZoneBox->currentIndex(), color);
}
void Ui::OpenRGBDevicePage::on_SetLEDButton_clicked()
{
/*-----------------------------------------------------*\
| Set the selected LED to the current color |
\*-----------------------------------------------------*/
RGBColor color = ToRGBColor(
ui->RedSpinBox->text().toInt(),
ui->GreenSpinBox->text().toInt(),
ui->BlueSpinBox->text().toInt()
);
device->SetLED(ui->LEDBox->currentIndex(), color);
}
void Ui::OpenRGBDevicePage::on_ButtonRed_clicked()
{
UpdatingColor = true;
ui->RedSpinBox->setValue(255);
ui->GreenSpinBox->setValue(0);
ui->BlueSpinBox->setValue(0);
UpdatingColor = false;
updateHSV();
}
void Ui::OpenRGBDevicePage::on_ButtonYellow_clicked()
{
UpdatingColor = true;
ui->RedSpinBox->setValue(255);
ui->GreenSpinBox->setValue(255);
ui->BlueSpinBox->setValue(0);
UpdatingColor = false;
updateHSV();
}
void Ui::OpenRGBDevicePage::on_ButtonGreen_clicked()
{
UpdatingColor = true;
ui->RedSpinBox->setValue(0);
ui->GreenSpinBox->setValue(255);
ui->BlueSpinBox->setValue(0);
UpdatingColor = false;
updateHSV();
}
void Ui::OpenRGBDevicePage::on_ButtonCyan_clicked()
{
UpdatingColor = true;
ui->RedSpinBox->setValue(0);
ui->GreenSpinBox->setValue(255);
ui->BlueSpinBox->setValue(255);
UpdatingColor = false;
updateHSV();
}
void Ui::OpenRGBDevicePage::on_ButtonBlue_clicked()
{
UpdatingColor = true;
ui->RedSpinBox->setValue(0);
ui->GreenSpinBox->setValue(0);
ui->BlueSpinBox->setValue(255);
UpdatingColor = false;
updateHSV();
}
void Ui::OpenRGBDevicePage::on_ButtonMagenta_clicked()
{
UpdatingColor = true;
ui->RedSpinBox->setValue(255);
ui->GreenSpinBox->setValue(0);
ui->BlueSpinBox->setValue(255);
UpdatingColor = false;
updateHSV();
}
void Ui::OpenRGBDevicePage::updateRGB()
{
if(UpdatingColor)
{
return;
}
UpdatingColor = true;
hsv_t hsv;
hsv.hue = ui->HueSpinBox->value();
hsv.saturation = ui->SatSpinBox->value();
hsv.value = ui->ValSpinBox->value();
RGBColor rgb = hsv2rgb(&hsv);
ui->RedSpinBox->setValue(RGBGetRValue(rgb));
ui->GreenSpinBox->setValue(RGBGetGValue(rgb));
ui->BlueSpinBox->setValue(RGBGetBValue(rgb));
UpdatingColor = false;
}
void Ui::OpenRGBDevicePage::updateHSV()
{
if(UpdatingColor)
{
return;
}
UpdatingColor = true;
RGBColor rgb = ToRGBColor(ui->RedSpinBox->value(), ui->GreenSpinBox->value(), ui->BlueSpinBox->value());
hsv_t hsv;
rgb2hsv(rgb, &hsv);
ui->HueSpinBox->setValue(hsv.hue);
ui->SatSpinBox->setValue(hsv.saturation);
ui->ValSpinBox->setValue(hsv.value);
UpdatingColor = false;
}
void Ui::OpenRGBDevicePage::on_RedSpinBox_valueChanged(int arg1)
{
updateHSV();
}
void Ui::OpenRGBDevicePage::on_HueSpinBox_valueChanged(int arg1)
{
updateRGB();
}
void Ui::OpenRGBDevicePage::on_GreenSpinBox_valueChanged(int arg1)
{
updateHSV();
}
void Ui::OpenRGBDevicePage::on_SatSpinBox_valueChanged(int arg1)
{
updateRGB();
}
void Ui::OpenRGBDevicePage::on_BlueSpinBox_valueChanged(int arg1)
{
updateHSV();
}
void Ui::OpenRGBDevicePage::on_ValSpinBox_valueChanged(int arg1)
{
updateRGB();
}
void Ui::OpenRGBDevicePage::on_SetAllButton_clicked()
{
unsigned char red = ui->RedSpinBox->value();
unsigned char green = ui->GreenSpinBox->value();
unsigned char blue = ui->BlueSpinBox->value();
emit SetAllDevices(red, green, blue);
}
+59
View File
@@ -0,0 +1,59 @@
#ifndef OPENRGBDEVICEPAGE_H
#define OPENRGBDEVICEPAGE_H
#include "ui_OpenRGBDevicePage.h"
#include "RGBController.h"
#include <QFrame>
namespace Ui {
class OpenRGBDevicePage;
}
class Ui::OpenRGBDevicePage : public QFrame
{
Q_OBJECT
public:
explicit OpenRGBDevicePage(RGBController *dev, QWidget *parent = nullptr);
~OpenRGBDevicePage();
void SetDevice(unsigned char red, unsigned char green, unsigned char blue);
private slots:
void on_ButtonRed_clicked();
void on_ButtonYellow_clicked();
void on_ButtonGreen_clicked();
void on_ButtonCyan_clicked();
void on_ButtonBlue_clicked();
void on_ButtonMagenta_clicked();
void on_ZoneBox_currentIndexChanged(int index);
void on_LEDBox_currentIndexChanged(int index);
void on_ModeBox_currentIndexChanged(int index);
void on_SetDeviceButton_clicked();
void on_SetZoneButton_clicked();
void on_SetLEDButton_clicked();
void on_RedSpinBox_valueChanged(int arg1);
void on_HueSpinBox_valueChanged(int arg1);
void on_GreenSpinBox_valueChanged(int arg1);
void on_SatSpinBox_valueChanged(int arg1);
void on_BlueSpinBox_valueChanged(int arg1);
void on_ValSpinBox_valueChanged(int arg1);
void on_SetAllButton_clicked();
private:
Ui::OpenRGBDevicePageUi *ui;
RGBController *device;
bool UpdatingColor = false;
void updateRGB();
void updateHSV();
signals:
void SetAllDevices(unsigned char red, unsigned char green, unsigned char blue);
};
#endif // OPENRGBDEVICEPAGE_H
+387
View File
@@ -0,0 +1,387 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OpenRGBDevicePageUi</class>
<widget class="QFrame" name="OpenRGBDevicePageUi">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Frame</string>
</property>
<widget class="QComboBox" name="ZoneBox">
<property name="geometry">
<rect>
<x>71</x>
<y>50</y>
<width>160</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="ZoneLabel">
<property name="geometry">
<rect>
<x>31</x>
<y>50</y>
<width>40</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>Zone:</string>
</property>
</widget>
<widget class="QLabel" name="LEDLabel">
<property name="geometry">
<rect>
<x>31</x>
<y>90</y>
<width>40</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>LED:</string>
</property>
</widget>
<widget class="QComboBox" name="LEDBox">
<property name="geometry">
<rect>
<x>71</x>
<y>90</y>
<width>160</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="ModeLabel">
<property name="geometry">
<rect>
<x>31</x>
<y>210</y>
<width>40</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>Mode:</string>
</property>
</widget>
<widget class="QComboBox" name="ModeBox">
<property name="geometry">
<rect>
<x>71</x>
<y>210</y>
<width>160</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="SetLEDButton">
<property name="geometry">
<rect>
<x>190</x>
<y>140</y>
<width>41</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>LED</string>
</property>
</widget>
<widget class="QPushButton" name="SetZoneButton">
<property name="geometry">
<rect>
<x>130</x>
<y>140</y>
<width>41</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>Zone</string>
</property>
</widget>
<widget class="QSpinBox" name="RedSpinBox">
<property name="geometry">
<rect>
<x>310</x>
<y>120</y>
<width>50</width>
<height>22</height>
</rect>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
<widget class="QSpinBox" name="GreenSpinBox">
<property name="geometry">
<rect>
<x>310</x>
<y>160</y>
<width>50</width>
<height>22</height>
</rect>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
<widget class="QSpinBox" name="BlueSpinBox">
<property name="geometry">
<rect>
<x>310</x>
<y>200</y>
<width>50</width>
<height>22</height>
</rect>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
<widget class="QLabel" name="RedLabel">
<property name="geometry">
<rect>
<x>290</x>
<y>120</y>
<width>20</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>R:</string>
</property>
</widget>
<widget class="QLabel" name="GreenLabel">
<property name="geometry">
<rect>
<x>290</x>
<y>160</y>
<width>20</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>G:</string>
</property>
</widget>
<widget class="QLabel" name="BlueLabel">
<property name="geometry">
<rect>
<x>290</x>
<y>200</y>
<width>20</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>B:</string>
</property>
</widget>
<widget class="QPushButton" name="ButtonGreen">
<property name="geometry">
<rect>
<x>350</x>
<y>250</y>
<width>21</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="ButtonBlue">
<property name="geometry">
<rect>
<x>410</x>
<y>250</y>
<width>21</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="ButtonCyan">
<property name="geometry">
<rect>
<x>380</x>
<y>250</y>
<width>21</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="ButtonMagenta">
<property name="geometry">
<rect>
<x>440</x>
<y>250</y>
<width>21</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="ButtonRed">
<property name="geometry">
<rect>
<x>290</x>
<y>250</y>
<width>21</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="ButtonYellow">
<property name="geometry">
<rect>
<x>320</x>
<y>250</y>
<width>21</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QSpinBox" name="HueSpinBox">
<property name="geometry">
<rect>
<x>410</x>
<y>120</y>
<width>50</width>
<height>22</height>
</rect>
</property>
<property name="maximum">
<number>359</number>
</property>
</widget>
<widget class="QLabel" name="HueLabel">
<property name="geometry">
<rect>
<x>390</x>
<y>120</y>
<width>20</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>H:</string>
</property>
</widget>
<widget class="QLabel" name="SatLabel">
<property name="geometry">
<rect>
<x>390</x>
<y>160</y>
<width>20</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>S:</string>
</property>
</widget>
<widget class="QSpinBox" name="SatSpinBox">
<property name="geometry">
<rect>
<x>410</x>
<y>160</y>
<width>50</width>
<height>22</height>
</rect>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
<widget class="QSpinBox" name="ValSpinBox">
<property name="geometry">
<rect>
<x>410</x>
<y>200</y>
<width>50</width>
<height>22</height>
</rect>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
<widget class="QLabel" name="ValLabel">
<property name="geometry">
<rect>
<x>390</x>
<y>200</y>
<width>20</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>V:</string>
</property>
</widget>
<widget class="QPushButton" name="SetDeviceButton">
<property name="geometry">
<rect>
<x>70</x>
<y>140</y>
<width>41</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>Device</string>
</property>
</widget>
<widget class="QLabel" name="SetLabel">
<property name="geometry">
<rect>
<x>30</x>
<y>140</y>
<width>40</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>Set:</string>
</property>
</widget>
<widget class="QPushButton" name="SetAllButton">
<property name="geometry">
<rect>
<x>110</x>
<y>170</y>
<width>80</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>Set All Devices</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
@@ -1,12 +1,15 @@
#include "OpenAuraSDKQtDialog.h"
#include "OpenRGBDialog.h"
#include "OpenAuraSDK.h"
using namespace Ui;
OpenAuraSDKQtDialog::OpenAuraSDKQtDialog(std::vector<i2c_smbus_interface *>& bus, std::vector<RGBController *>& control, QWidget *parent) : QMainWindow(parent), busses(bus), controllers (control), ui(new OpenAuraSDKQtDialogUi)
OpenRGBDialog::OpenRGBDialog(std::vector<i2c_smbus_interface *>& bus, std::vector<RGBController *>& control, QWidget *parent) : QMainWindow(parent), busses(bus), controllers (control), ui(new OpenRGBDialogUi)
{
ui->setupUi(this);
QIcon icon(":OpenRGB.png");
setWindowIcon(icon);
QPalette pal;
pal = ui->ButtonRed->palette();
@@ -60,59 +63,59 @@ OpenAuraSDKQtDialog::OpenAuraSDKQtDialog(std::vector<i2c_smbus_interface *>& bus
ui->ComboDevices->setCurrentIndex(0);
}
OpenAuraSDKQtDialog::~OpenAuraSDKQtDialog()
OpenRGBDialog::~OpenRGBDialog()
{
delete ui;
}
void OpenAuraSDKQtDialog::show()
void OpenRGBDialog::show()
{
QMainWindow::show();
}
void Ui::OpenAuraSDKQtDialog::on_ButtonRed_clicked()
void Ui::OpenRGBDialog::on_ButtonRed_clicked()
{
ui->EditLED0R->setText("255");
ui->EditLED0G->setText("0");
ui->EditLED0B->setText("0");
}
void Ui::OpenAuraSDKQtDialog::on_ButtonYellow_clicked()
void Ui::OpenRGBDialog::on_ButtonYellow_clicked()
{
ui->EditLED0R->setText("255");
ui->EditLED0G->setText("255");
ui->EditLED0B->setText("0");
}
void Ui::OpenAuraSDKQtDialog::on_ButtonGreen_clicked()
void Ui::OpenRGBDialog::on_ButtonGreen_clicked()
{
ui->EditLED0R->setText("0");
ui->EditLED0G->setText("255");
ui->EditLED0B->setText("0");
}
void Ui::OpenAuraSDKQtDialog::on_ButtonCyan_clicked()
void Ui::OpenRGBDialog::on_ButtonCyan_clicked()
{
ui->EditLED0R->setText("0");
ui->EditLED0G->setText("255");
ui->EditLED0B->setText("255");
}
void Ui::OpenAuraSDKQtDialog::on_ButtonBlue_clicked()
void Ui::OpenRGBDialog::on_ButtonBlue_clicked()
{
ui->EditLED0R->setText("0");
ui->EditLED0G->setText("0");
ui->EditLED0B->setText("255");
}
void Ui::OpenAuraSDKQtDialog::on_ButtonMagenta_clicked()
void Ui::OpenRGBDialog::on_ButtonMagenta_clicked()
{
ui->EditLED0R->setText("255");
ui->EditLED0G->setText("0");
ui->EditLED0B->setText("255");
}
void Ui::OpenAuraSDKQtDialog::on_ButtonSetAll_clicked()
void Ui::OpenRGBDialog::on_ButtonSetAll_clicked()
{
RGBColor color = ToRGBColor(
ui->EditLED0R->text().toInt(),
@@ -127,7 +130,7 @@ void Ui::OpenAuraSDKQtDialog::on_ButtonSetAll_clicked()
}
}
void Ui::OpenAuraSDKQtDialog::on_ButtonSetDevice_clicked()
void Ui::OpenRGBDialog::on_ButtonSetDevice_clicked()
{
RGBColor color = ToRGBColor(
ui->EditLED0R->text().toInt(),
@@ -138,7 +141,7 @@ void Ui::OpenAuraSDKQtDialog::on_ButtonSetDevice_clicked()
controllers[ui->ComboDevices->currentIndex()]->SetAllLEDs(color);
}
void Ui::OpenAuraSDKQtDialog::on_ButtonSetZone_clicked()
void Ui::OpenRGBDialog::on_ButtonSetZone_clicked()
{
RGBColor color = ToRGBColor(
ui->EditLED0R->text().toInt(),
@@ -149,7 +152,7 @@ void Ui::OpenAuraSDKQtDialog::on_ButtonSetZone_clicked()
controllers[ui->ComboDevices->currentIndex()]->SetAllZoneLEDs(ui->ComboZones->currentIndex(), color);
}
void Ui::OpenAuraSDKQtDialog::on_ButtonSetLED_clicked()
void Ui::OpenRGBDialog::on_ButtonSetLED_clicked()
{
RGBColor color = ToRGBColor(
ui->EditLED0R->text().toInt(),
@@ -160,7 +163,7 @@ void Ui::OpenAuraSDKQtDialog::on_ButtonSetLED_clicked()
controllers[ui->ComboDevices->currentIndex()]->SetLED(ui->ComboLEDs->currentIndex(), color);
}
void Ui::OpenAuraSDKQtDialog::on_ComboDevices_currentIndexChanged(int index)
void Ui::OpenRGBDialog::on_ComboDevices_currentIndexChanged(int index)
{
ui->ComboModes->clear();
@@ -190,7 +193,7 @@ void Ui::OpenAuraSDKQtDialog::on_ComboDevices_currentIndexChanged(int index)
ui->ComboLEDs->setCurrentIndex(0);
}
void Ui::OpenAuraSDKQtDialog::on_ComboModes_currentIndexChanged(int index)
void Ui::OpenRGBDialog::on_ComboModes_currentIndexChanged(int index)
{
controllers[ui->ComboDevices->currentIndex()]->SetMode(ui->ComboModes->currentIndex());
}
@@ -1,7 +1,7 @@
#ifndef OPENAURASDKQTDIALOG_H
#define OPENAURASDKQTDIALOG_H
#ifndef OPENRGBDIALOG_H
#define OPENRGBDIALOG_H
#include "ui_openaurasdk.h"
#include "ui_OpenRGBDialog.h"
#include <vector>
#include "i2c_smbus.h"
@@ -14,16 +14,16 @@
namespace Ui
{
class OpenAuraSDKQtDialog;
class OpenRGBDialog;
}
class Ui::OpenAuraSDKQtDialog : public QMainWindow
class Ui::OpenRGBDialog : public QMainWindow
{
Q_OBJECT
public:
explicit OpenAuraSDKQtDialog(std::vector<i2c_smbus_interface *>& bus, std::vector<RGBController *>& control, QWidget *parent = 0);
~OpenAuraSDKQtDialog();
explicit OpenRGBDialog(std::vector<i2c_smbus_interface *>& bus, std::vector<RGBController *>& control, QWidget *parent = 0);
~OpenRGBDialog();
void show();
void setMode(unsigned char mode_val);
@@ -53,7 +53,7 @@ private slots:
void on_ComboModes_currentIndexChanged(int index);
private:
Ui::OpenAuraSDKQtDialogUi *ui;
Ui::OpenRGBDialogUi *ui;
};
#endif // OPENAURASDKQTDIALOG_H
#endif // OPENRGBDIALOG_H
+3 -3
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OpenAuraSDKQtDialogUi</class>
<widget class="QMainWindow" name="OpenAuraSDKQtDialogUi">
<class>OpenRGBDialogUi</class>
<widget class="QMainWindow" name="OpenRGBDialogUi">
<property name="geometry">
<rect>
<x>0</x>
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>OpenAuraSDK</string>
<string>OpenRGB</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QPushButton" name="ButtonSetAll">
+166
View File
@@ -0,0 +1,166 @@
#include "OpenRGBDialog2.h"
#include "OpenRGBDevicePage.h"
#include "OpenRGBDeviceInfoPage.h"
#include "OpenRGBSystemInfoPage.h"
#include "OpenAuraSDK.h"
#include <QLabel>
#include <QTabBar>
using namespace Ui;
OpenRGBDialog2::OpenRGBDialog2(std::vector<i2c_smbus_interface *>& bus, std::vector<RGBController *>& control, QWidget *parent) : QMainWindow(parent), busses(bus), controllers (control), ui(new OpenRGBDialog2Ui)
{
ui->setupUi(this);
QIcon logo(":OpenRGB.png");
setWindowIcon(logo);
/*-----------------------------------------------------*\
| Set up list of devices |
\*-----------------------------------------------------*/
QTabBar *DevicesTabBar = ui->DevicesTabBar->tabBar();
for(int dev_idx = 0; dev_idx < control.size(); dev_idx++)
{
OpenRGBDevicePage *NewPage = new OpenRGBDevicePage(control[dev_idx]);
ui->DevicesTabBar->addTab(NewPage, "");
/*-----------------------------------------------------*\
| Connect the page's Set All button to the Set All slot |
\*-----------------------------------------------------*/
connect(NewPage,
SIGNAL(SetAllDevices(unsigned char, unsigned char, unsigned char)),
this,
SLOT(on_SetAllDevices(unsigned char, unsigned char, unsigned char)));
/*-----------------------------------------------------*\
| Use Qt's HTML capabilities to display both icon and |
| text in the tab label. Choose icon based on device |
| type and append device name string. |
\*-----------------------------------------------------*/
QString NewLabelString = "<html><table><tr><td width='30'><img src='";
switch(control[dev_idx]->type)
{
case DEVICE_TYPE_MOTHERBOARD:
NewLabelString += ":/motherboard.svg";
break;
case DEVICE_TYPE_DRAM:
NewLabelString += ":/ram.svg";
break;
case DEVICE_TYPE_GPU:
NewLabelString += ":/graphics-card.svg";
break;
case DEVICE_TYPE_COOLER:
NewLabelString += ":/fan.svg";
break;
case DEVICE_TYPE_LEDSTRIP:
//break;
case DEVICE_TYPE_KEYBOARD:
//break;
case DEVICE_TYPE_MOUSE:
//break;
case DEVICE_TYPE_HEADSET:
//break;
case DEVICE_TYPE_UNKNOWN:
NewLabelString += ":/keyboard.svg";
break;
}
NewLabelString += "' height='15' width='15'></td><td>" + QString::fromStdString(control[dev_idx]->name) + "</td></tr></table></html>";
QLabel *NewTabLabel = new QLabel();
NewTabLabel->setText(NewLabelString);
NewTabLabel->setIndent(20);
NewTabLabel->setGeometry(0, 0, 200, 20);
DevicesTabBar->setTabButton(dev_idx, QTabBar::LeftSide, NewTabLabel);
}
/*-----------------------------------------------------*\
| Set up list of information |
\*-----------------------------------------------------*/
QTabBar *InformationTabBar = ui->InformationTabBar->tabBar();
for(int dev_idx = 0; dev_idx < control.size(); dev_idx++)
{
OpenRGBDeviceInfoPage *NewPage = new OpenRGBDeviceInfoPage(control[dev_idx]);
ui->InformationTabBar->addTab(NewPage, "");
/*-----------------------------------------------------*\
| Use Qt's HTML capabilities to display both icon and |
| text in the tab label. Choose icon based on device |
| type and append device name string. |
\*-----------------------------------------------------*/
QString NewLabelString = "<html><table><tr><td width='30'><img src='";
switch(control[dev_idx]->type)
{
case DEVICE_TYPE_MOTHERBOARD:
NewLabelString += ":/motherboard.svg";
break;
case DEVICE_TYPE_DRAM:
NewLabelString += ":/ram.svg";
break;
case DEVICE_TYPE_GPU:
NewLabelString += ":/graphics-card.svg";
break;
case DEVICE_TYPE_COOLER:
NewLabelString += ":/fan.svg";
break;
case DEVICE_TYPE_LEDSTRIP:
//break;
case DEVICE_TYPE_KEYBOARD:
//break;
case DEVICE_TYPE_MOUSE:
//break;
case DEVICE_TYPE_HEADSET:
//break;
case DEVICE_TYPE_UNKNOWN:
NewLabelString += ":/keyboard.svg";
break;
}
NewLabelString += "' height='15' width='15'></td><td>" + QString::fromStdString(control[dev_idx]->name) + "</td></tr></table></html>";
QLabel *NewTabLabel = new QLabel();
NewTabLabel->setText(NewLabelString);
NewTabLabel->setIndent(20);
NewTabLabel->setGeometry(0, 0, 200, 20);
InformationTabBar->setTabButton(dev_idx, QTabBar::LeftSide, NewTabLabel);
}
OpenRGBSystemInfoPage *SysInfoPage = new OpenRGBSystemInfoPage(bus);
ui->InformationTabBar->addTab(SysInfoPage, "");
/*-----------------------------------------------------*\
| Use Qt's HTML capabilities to display both icon and |
| text in the tab label. Choose icon based on device |
| type and append device name string. |
\*-----------------------------------------------------*/
QString SystemLabelString = "<html><table><tr><td width='30'><img src='";
SystemLabelString += ":/keyboard.svg";
SystemLabelString += "' height='15' width='15'></td><td>System</td></tr></table></html>";
QLabel *SystemTabLabel = new QLabel();
SystemTabLabel->setText(SystemLabelString);
SystemTabLabel->setIndent(20);
SystemTabLabel->setGeometry(0, 0, 200, 20);
InformationTabBar->setTabButton(control.size(), QTabBar::LeftSide, SystemTabLabel);
}
OpenRGBDialog2::~OpenRGBDialog2()
{
delete ui;
}
void OpenRGBDialog2::show()
{
QMainWindow::show();
}
void OpenRGBDialog2::on_SetAllDevices(unsigned char red, unsigned char green, unsigned char blue)
{
for(int device = 0; device < ui->DevicesTabBar->count(); device++)
{
qobject_cast<OpenRGBDevicePage *>(ui->DevicesTabBar->widget(device))->SetDevice(red, green, blue);
}
}
+42
View File
@@ -0,0 +1,42 @@
#ifndef OPENRGBDIALOG2_H
#define OPENRGBDIALOG2_H
#include "ui_OpenRGBDialog2.h"
#include <vector>
#include "i2c_smbus.h"
#include "RGBController.h"
#include <QMainWindow>
#include <QTimer>
#include <QSystemTrayIcon>
#include <QMenu>
namespace Ui
{
class OpenRGBDialog2;
}
class Ui::OpenRGBDialog2 : public QMainWindow
{
Q_OBJECT
public:
explicit OpenRGBDialog2(std::vector<i2c_smbus_interface *>& bus, std::vector<RGBController *>& control, QWidget *parent = 0);
~OpenRGBDialog2();
void show();
void setMode(unsigned char mode_val);
protected:
std::vector<i2c_smbus_interface *>& busses;
std::vector<RGBController *>& controllers;
private:
Ui::OpenRGBDialog2Ui *ui;
private slots:
void on_SetAllDevices(unsigned char red, unsigned char green, unsigned char blue);
};
#endif // OPENRGBDIALOG2_H
+103
View File
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OpenRGBDialog2Ui</class>
<widget class="QMainWindow" name="OpenRGBDialog2Ui">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>350</height>
</rect>
</property>
<property name="windowTitle">
<string>OpenRGB</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QTabWidget" name="MainTabBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>351</height>
</rect>
</property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<widget class="QWidget" name="TabDevices">
<attribute name="title">
<string>Devices</string>
</attribute>
<widget class="QTabWidget" name="DevicesTabBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>320</height>
</rect>
</property>
<property name="tabPosition">
<enum>QTabWidget::West</enum>
</property>
</widget>
</widget>
<widget class="QWidget" name="TabEffects">
<attribute name="title">
<string>Synchronized Effects</string>
</attribute>
<widget class="QTabWidget" name="EffectsTabBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>321</height>
</rect>
</property>
<property name="tabPosition">
<enum>QTabWidget::West</enum>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</widget>
<widget class="QWidget" name="TabInformation">
<attribute name="title">
<string>Information</string>
</attribute>
<widget class="QTabWidget" name="InformationTabBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>321</height>
</rect>
</property>
<property name="tabPosition">
<enum>QTabWidget::West</enum>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</widget>
</widget>
</widget>
</widget>
<resources/>
<connections/>
</ui>
+51
View File
@@ -0,0 +1,51 @@
#include "OpenRGBSystemInfoPage.h"
#include "i2c_tools.h"
using namespace Ui;
OpenRGBSystemInfoPage::OpenRGBSystemInfoPage(std::vector<i2c_smbus_interface *>& bus, QWidget *parent) :
QFrame(parent),
busses(bus),
ui(new Ui::OpenRGBSystemInfoPageUi)
{
ui->setupUi(this);
/*-----------------------------------------------------*\
| Use a monospace font for the text box |
\*-----------------------------------------------------*/
QFont MonoFont("monospace");
MonoFont.setStyleHint(QFont::Monospace);
ui->SMBusDataText->setFont(MonoFont);
/*-----------------------------------------------------*\
| Fill in the combo boxes with device information |
\*-----------------------------------------------------*/
ui->SMBusAdaptersBox->clear();
for (int i = 0; i < busses.size(); i++)
{
ui->SMBusAdaptersBox->addItem(busses[i]->device_name);
}
ui->SMBusAdaptersBox->setCurrentIndex(0);
}
OpenRGBSystemInfoPage::~OpenRGBSystemInfoPage()
{
delete ui;
}
void Ui::OpenRGBSystemInfoPage::on_DetectButton_clicked()
{
i2c_smbus_interface* bus = busses[ui->SMBusAdaptersBox->currentIndex()];
ui->SMBusDataText->setPlainText(i2c_detect(bus, MODE_QUICK).c_str());
}
void Ui::OpenRGBSystemInfoPage::on_DumpButton_clicked()
{
i2c_smbus_interface* bus = busses[ui->SMBusAdaptersBox->currentIndex()];
unsigned char address = ui->DumpAddressBox->value();
ui->SMBusDataText->setPlainText(i2c_dump(bus, address).c_str());
}
+30
View File
@@ -0,0 +1,30 @@
#ifndef OPENRGBSYSTEMINFOPAGE_H
#define OPENRGBSYSTEMINFOPAGE_H
#include <QFrame>
#include "ui_OpenRGBSystemInfoPage.h"
#include "i2c_smbus.h"
namespace Ui {
class OpenRGBSystemInfoPage;
}
class Ui::OpenRGBSystemInfoPage : public QFrame
{
Q_OBJECT
public:
explicit OpenRGBSystemInfoPage(std::vector<i2c_smbus_interface *>& bus, QWidget *parent = nullptr);
~OpenRGBSystemInfoPage();
private slots:
void on_DetectButton_clicked();
void on_DumpButton_clicked();
private:
Ui::OpenRGBSystemInfoPageUi *ui;
std::vector<i2c_smbus_interface *>& busses;
};
#endif // OPENRGBSYSTEMINFOPAGE_H
+126
View File
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OpenRGBSystemInfoPageUi</class>
<widget class="QFrame" name="OpenRGBSystemInfoPageUi">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>320</height>
</rect>
</property>
<property name="windowTitle">
<string>Frame</string>
</property>
<widget class="QLabel" name="SMBusAdaptersLabel">
<property name="geometry">
<rect>
<x>50</x>
<y>10</y>
<width>100</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>SMBus Adapters:</string>
</property>
</widget>
<widget class="QComboBox" name="SMBusAdaptersBox">
<property name="geometry">
<rect>
<x>160</x>
<y>10</y>
<width>200</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QPlainTextEdit" name="SMBusDataText">
<property name="geometry">
<rect>
<x>50</x>
<y>80</y>
<width>400</width>
<height>210</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="DetectButton">
<property name="geometry">
<rect>
<x>370</x>
<y>10</y>
<width>80</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>Detect Devices</string>
</property>
</widget>
<widget class="QPushButton" name="DumpButton">
<property name="geometry">
<rect>
<x>370</x>
<y>40</y>
<width>80</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>Dump Device</string>
</property>
</widget>
<widget class="QLabel" name="SMBusDumpLabel">
<property name="geometry">
<rect>
<x>50</x>
<y>40</y>
<width>100</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>SMBus Dumper:</string>
</property>
</widget>
<widget class="QLabel" name="DumpAddressLabel">
<property name="geometry">
<rect>
<x>220</x>
<y>40</y>
<width>51</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>Address:</string>
</property>
</widget>
<widget class="QSpinBox" name="DumpAddressBox">
<property name="geometry">
<rect>
<x>280</x>
<y>40</y>
<width>80</width>
<height>22</height>
</rect>
</property>
<property name="suffix">
<string/>
</property>
<property name="prefix">
<string>0x</string>
</property>
<property name="maximum">
<number>255</number>
</property>
<property name="displayIntegerBase">
<number>16</number>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
+1
View File
@@ -0,0 +1 @@
<svg height="512pt" viewBox="0 0 512 512" width="512pt" xmlns="http://www.w3.org/2000/svg"><path d="m462 40c-5.519531 0-10 4.480469-10 10s4.480469 10 10 10 10-4.480469 10-10-4.480469-10-10-10zm0 0"/><path d="m462 452c-5.519531 0-10 4.480469-10 10s4.480469 10 10 10 10-4.480469 10-10-4.480469-10-10-10zm0 0"/><path d="m50 60c5.519531 0 10-4.480469 10-10s-4.480469-10-10-10-10 4.480469-10 10 4.480469 10 10 10zm0 0"/><path d="m50 452c-5.519531 0-10 4.480469-10 10s4.480469 10 10 10 10-4.480469 10-10-4.480469-10-10-10zm0 0"/><path d="m56 266h.25c5.410156-.140625 9.75-4.558594 9.75-10s-4.339844-9.859375-9.75-10c-.078125 0-.171875 0-.25 0-5.519531 0-10 4.480469-10 10s4.480469 10 10 10zm0 0"/><path d="m462 0h-412c-27.570312 0-50 22.429688-50 50v412c0 27.570312 22.429688 50 50 50h412c27.570312 0 50-22.429688 50-50v-412c0-27.570312-22.429688-50-50-50zm30 462c0 16.542969-13.457031 30-30 30h-412c-16.542969 0-30-13.457031-30-30v-412c0-16.542969 13.457031-30 30-30h412c16.542969 0 30 13.457031 30 30zm0 0"/><path d="m256 46c-102.023438 0-186.207031 72.140625-205.839844 168.1875-1.101562 5.410156 2.386719 10.695312 7.796875 11.800781 5.410157 1.101563 10.695313-2.386719 11.800781-7.796875 18.023438-88.183594 96.347657-152.191406 186.242188-152.191406 104.765625 0 190 85.234375 190 190s-85.234375 190-190 190c-90.453125 0-167.050781-62.621094-186.261719-152.285156-1.15625-5.398438-6.476562-8.839844-11.875-7.683594-5.398437 1.15625-8.839843 6.472656-7.683593 11.875 20.566406 95.96875 102.238281 168.09375 205.820312 168.09375 116.34375 0 210-93.570312 210-210 0-115.792969-94.207031-210-210-210zm0 0"/><path d="m366 176c0-49.625-40.375-90-90-90h-20c-5.523438 0-10 4.476562-10 10v83.390625c-16.683594-20.613281-42.121094-33.390625-70-33.390625-49.625 0-90 40.375-90 90v20c0 5.523438 4.476562 9.988281 10 9.988281h83.390625c-20.613281 16.6875-33.390625 42.132813-33.390625 70.011719 0 49.625 40.375 90 90 90h20c5.523438 0 10-4.476562 10-10v-83.390625c16.683594 20.613281 42.121094 33.390625 70 33.390625 49.625 0 90-40.375 90-90v-20c0-5.523438-4.476562-10-10-10h-83.390625c20.613281-16.683594 33.390625-42.121094 33.390625-70zm-90-70c38.597656 0 70 31.402344 70 70 0 28.402344-17.035156 53.550781-42.503906 64.390625-5.566406-16.921875-19.910156-29.785156-37.496094-33.375v-101.015625zm-18.097656 179.9375c-16.96875 1.023438-30.847656-11.925781-31.839844-28.035156-1.054688-17.496094 12.804688-31.902344 29.9375-31.902344 16.417969 0 30 13.316406 30 30 0 15.816406-12.351562 28.96875-28.097656 29.9375zm-151.902344-49.9375c0-38.597656 31.402344-70 70-70 28.402344 0 53.550781 17.035156 64.390625 42.503906-16.921875 5.566406-29.785156 19.910156-33.375 37.496094h-101.015625zm130 170c-38.597656 0-70-31.402344-70-70 0-28.402344 17.035156-53.550781 42.503906-64.390625 5.566406 16.921875 19.910156 29.785156 37.496094 33.375v101.015625zm170-130c0 38.597656-31.402344 70-70 70-28.402344 0-53.550781-17.035156-64.390625-42.503906 16.921875-5.566406 29.785156-19.910156 33.375-37.496094h101.015625zm0 0"/></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.1 KiB

+157
View File
@@ -0,0 +1,157 @@
/*
* RGB <--> HSV conversion in integer arithmetics, to be used on Windows.
* Copyright (c) 2013 Martin Mitas
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#include "hsv.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN3(a,b,c) MIN((a), MIN((b), (c)))
#define MAX3(a,b,c) MAX((a), MAX((b), (c)))
#define RGBGetRValue(rgb) (rgb & 0x000000FF)
#define RGBGetGValue(rgb) ((rgb >> 8) & 0x000000FF)
#define RGBGetBValue(rgb) ((rgb >> 16) & 0x000000FF)
#define ToRGBColor(r, g, b) ((b << 16) | (g << 8) | (r))
void rgb2hsv(unsigned int rgb, hsv_t* hsv)
{
int r = RGBGetRValue(rgb);
int g = RGBGetGValue(rgb);
int b = RGBGetBValue(rgb);
int m = MIN3(r, g, b);
int M = MAX3(r, g, b);
int delta = M - m;
if (delta == 0) {
/* Achromatic case (i.e. grayscale) */
hsv->hue = -1; /* undefined */
hsv->saturation = 0;
}
else {
int h;
if (r == M)
h = ((g - b) * 60 * HUE_DEGREE) / delta;
else if (g == M)
h = ((b - r) * 60 * HUE_DEGREE) / delta + 120 * HUE_DEGREE;
else /*if(b == M)*/
h = ((r - g) * 60 * HUE_DEGREE) / delta + 240 * HUE_DEGREE;
if (h < 0)
h += 360 * HUE_DEGREE;
hsv->hue = h;
/* The constatnt 8 is tuned to statistically cause as little
* tolerated mismatches as possible in RGB -> HSV -> RGB conversion.
* (See the unit test at the bottom of this file.)
*/
hsv->saturation = (256 * delta - 8) / M;
}
hsv->value = M;
}
unsigned int hsv2rgb(hsv_t* hsv)
{
unsigned char r, g, b;
if (hsv->saturation == 0) {
r = g = b = hsv->value;
}
else {
int h = (hsv->hue)%360;
int s = hsv->saturation;
int v = hsv->value;
int i = h / (60 * HUE_DEGREE);
int p = (256 * v - s*v) / 256;
if (i & 1) {
int q = (256 * 60 * HUE_DEGREE*v - h*s*v + 60 * HUE_DEGREE*s*v*i) / (256 * 60 * HUE_DEGREE);
switch (i) {
case 1: r = q; g = v; b = p; break;
case 3: r = p; g = q; b = v; break;
case 5: r = v; g = p; b = q; break;
}
}
else {
int t = (256 * 60 * HUE_DEGREE*v + h*s*v - 60 * HUE_DEGREE*s*v*(i + 1)) / (256 * 60 * HUE_DEGREE);
switch (i) {
case 0: r = v; g = t; b = p; break;
case 2: r = p; g = v; b = t; break;
case 4: r = t; g = p; b = v; break;
}
}
}
return ToRGBColor(r, g, b);
}
#ifdef TEST
#include <stdio.h>
#define DIFF(a,b) ((a) >= (b) ? (a) - (b) : (b) - (a))
int
main(int argc, char** argv)
{
int r0, g0, b0;
hsv_t hsv;
int r1, g1, b1;
int ok = 0, fuzzy = 0, ko = 0, total;
for (r0 = 0; r0 < 256; r0++) {
for (g0 = 0; g0 < 256; g0++) {
for (b0 = 0; b0 < 256; b0++) {
COLORREF tmp;
rgb2hsv(RGB(r0, g0, b0), &hsv);
tmp = hsv2rgb(&hsv);
r1 = GetRValue(tmp);
g1 = GetGValue(tmp);
b1 = GetBValue(tmp);
if (r0 == r1 && b0 == b1 && g0 == g1)
ok++;
else if (DIFF(r0, r1) <= 1 && DIFF(b0, b1) <= 1 && DIFF(g0, g1) <= 1)
fuzzy++;
else
ko++;
}
}
}
total = ok + fuzzy + ko;
printf("Test results:\n");
printf(" * exact matches: %8d (%5.2f%%)\n", ok, (100.0 * ok) / total);
printf(" * fuzzy matches: %8d (%5.2f%%)\n", fuzzy, (100.0 * fuzzy) / total);
printf(" * mismatches: %8d (%5.2f%%)\n", ko, (100.0 * ko) / total);
return (ko == 0 ? 0 : 1);
}
#endif /* TEST */
+42
View File
@@ -0,0 +1,42 @@
/*
* RGB <--> HSV conversion in integer arithmetics, to be used on Windows.
* Copyright (c) 2013 Martin Mitas
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#ifndef HSV_H
#define HSV_H
#define HUE_DEGREE 1
typedef struct hsv_tag hsv_t;
struct hsv_tag {
unsigned int hue; /* 0 ... (360*HUE_DEGREE - 1) */
unsigned char saturation; /* 0 ... 255 */
unsigned char value; /* 0 ... 255 */
};
void rgb2hsv(unsigned int rgb, hsv_t* hsv);
unsigned int hsv2rgb(hsv_t* hsv);
#endif /* HSV_H */
+82
View File
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 463 463" style="enable-background:new 0 0 463 463;" xml:space="preserve">
<g>
<g>
<g>
<path d="M431.5,120h-400C14.131,120,0,134.131,0,151.5v160C0,328.869,14.131,343,31.5,343h400c17.369,0,31.5-14.131,31.5-31.5
v-160C463,134.131,448.869,120,431.5,120z M448,311.5c0,9.099-7.402,16.5-16.5,16.5h-400c-9.098,0-16.5-7.401-16.5-16.5v-160
c0-9.099,7.402-16.5,16.5-16.5h400c9.098,0,16.5,7.401,16.5,16.5V311.5z"/>
<path d="M327.5,280h-192c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h192c4.142,0,7.5-3.357,7.5-7.5S331.642,280,327.5,280z"/>
<path d="M103.5,280h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S107.642,280,103.5,280z"/>
<path d="M55.5,280h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S59.642,280,55.5,280z"/>
<path d="M423.5,280h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S427.642,280,423.5,280z"/>
<path d="M375.5,280h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S379.642,280,375.5,280z"/>
<path d="M423.5,248h-32c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h32c4.142,0,7.5-3.357,7.5-7.5S427.642,248,423.5,248z"/>
<path d="M367,255.5c0-4.143-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16
C363.642,263,367,259.643,367,255.5z"/>
<path d="M295.5,263h16c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5S291.358,263,295.5,263z"/>
<path d="M247.5,263h16c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5S243.358,263,247.5,263z"/>
<path d="M199.5,263h16c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5S195.358,263,199.5,263z"/>
<path d="M151.5,263h16c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5S147.358,263,151.5,263z"/>
<path d="M119.5,248h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S123.642,248,119.5,248z"/>
<path d="M71.5,248h-32c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h32c4.142,0,7.5-3.357,7.5-7.5S75.642,248,71.5,248z"/>
<path d="M423.5,184h-32c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h32c4.142,0,7.5-3.357,7.5-7.5S427.642,184,423.5,184z"/>
<path d="M343.5,199h16c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5S339.358,199,343.5,199z"/>
<path d="M295.5,199h16c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5S291.358,199,295.5,199z"/>
<path d="M247.5,199h16c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5S243.358,199,247.5,199z"/>
<path d="M199.5,199h16c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5S195.358,199,199.5,199z"/>
<path d="M151.5,199h16c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5S147.358,199,151.5,199z"/>
<path d="M103.5,199h16c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5S99.358,199,103.5,199z"/>
<path d="M39.5,199h32c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-32c-4.142,0-7.5,3.357-7.5,7.5S35.358,199,39.5,199z"/>
<path d="M423.5,216h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S427.642,216,423.5,216z"/>
<path d="M375.5,216h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S379.642,216,375.5,216z"/>
<path d="M327.5,216h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S331.642,216,327.5,216z"/>
<path d="M279.5,216h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S283.642,216,279.5,216z"/>
<path d="M231.5,216h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S235.642,216,231.5,216z"/>
<path d="M183.5,216h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S187.642,216,183.5,216z"/>
<path d="M135.5,216h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S139.642,216,135.5,216z"/>
<path d="M39.5,231h48c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-48c-4.142,0-7.5,3.357-7.5,7.5S35.358,231,39.5,231z"/>
<path d="M423.5,152h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S427.642,152,423.5,152z"/>
<path d="M375.5,152h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S379.642,152,375.5,152z"/>
<path d="M327.5,152h-16c-4.142,0-7.5,3.357-7.5,7.5s3.358,7.5,7.5,7.5h16c4.142,0,7.5-3.357,7.5-7.5S331.642,152,327.5,152z"/>
<path d="M263.5,167h16c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5S259.358,167,263.5,167z"/>
<path d="M215.5,167h16c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5S211.358,167,215.5,167z"/>
<path d="M167.5,167h16c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5S163.358,167,167.5,167z"/>
<path d="M119.5,167h16c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-16c-4.142,0-7.5,3.357-7.5,7.5S115.358,167,119.5,167z"/>
<path d="M39.5,167h48c4.142,0,7.5-3.357,7.5-7.5s-3.358-7.5-7.5-7.5h-48c-4.142,0-7.5,3.357-7.5,7.5S35.358,167,39.5,167z"/>
</g>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.4 KiB

+80
View File
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<g>
<g>
<path d="M497,0H15C6.716,0,0,6.716,0,15v482c0,8.284,6.716,15,15,15h482c8.284,0,15-6.716,15-15V15C512,6.716,505.284,0,497,0z
M482,482H30V30h452V482z"/>
</g>
</g>
<g>
<g>
<path d="M216.974,330.026H90c-8.284,0-15,6.716-15,15V432c0,8.284,6.716,15,15,15h126.974c8.284,0,15-6.716,15-15v-86.974
C231.974,336.742,225.258,330.026,216.974,330.026z M138.487,417H105v-56.974h33.487V417z M201.974,417h-33.487v-56.974h33.487
V417z"/>
</g>
</g>
<g>
<g>
<path d="M90,65c-8.284,0-15,6.716-15,15v191c0,8.284,6.716,15,15,15s15-6.716,15-15V80C105,71.716,98.284,65,90,65z"/>
</g>
</g>
<g>
<g>
<path d="M153.487,65c-8.284,0-15,6.716-15,15v191c0,8.284,6.716,15,15,15s15-6.716,15-15V80C168.487,71.716,161.771,65,153.487,65
z"/>
</g>
</g>
<g>
<g>
<path d="M442,181.974h-35V165h35c8.284,0,15-6.716,15-15s-6.716-15-15-15h-35v-5c0-8.284-6.716-15-15-15h-5V80
c0-8.284-6.716-15-15-15s-15,6.716-15,15v35h-16.974V80c0-8.284-6.716-15-15-15s-15,6.716-15,15v35h-5c-8.284,0-15,6.716-15,15v5
h-35c-8.284,0-15,6.716-15,15s6.716,15,15,15h35v16.974h-35c-8.284,0-15,6.716-15,15s6.716,15,15,15h35v5c0,8.284,6.716,15,15,15
h5v35c0,8.284,6.716,15,15,15s15-6.716,15-15v-35H357v35c0,8.284,6.716,15,15,15s15-6.716,15-15v-35h5c8.284,0,15-6.716,15-15v-5
h35c8.284,0,15-6.716,15-15S450.284,181.974,442,181.974z M377,201.974h-56.974V145H377V201.974z"/>
</g>
</g>
<g>
<g>
<path d="M392,330.026h-86.974c-8.284,0-15,6.716-15,15s6.716,15,15,15H392c8.284,0,15-6.716,15-15S400.284,330.026,392,330.026z"
/>
</g>
</g>
<g>
<g>
<path d="M392,393.513h-86.974c-8.284,0-15,6.716-15,15s6.716,15,15,15H392c8.284,0,15-6.716,15-15S400.284,393.513,392,393.513z"
/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

+5
View File
@@ -0,0 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 401.396 401.396" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 401.396 401.396">
<path d="m200.698,0c-68.997,0-125.13,56.133-125.13,125.129v151.137c0,68.997 56.133,125.129 125.13,125.129s125.129-56.133 125.129-125.129v-151.137c0-68.996-56.132-125.129-125.129-125.129zm110.129,125.129v1.973c-32.303,16.982-68.429,26.282-105.133,27.057v-41.835c10.585-2.298 18.539-11.734 18.539-22.997v-31.367c0-11.263-7.954-20.699-18.539-22.997v-19.845c58.416,2.622 105.133,50.961 105.133,110.011zm-110.129-80.705c7.463-7.10543e-15 13.536,6.072 13.536,13.536v31.368c0,7.463-6.072,13.536-13.536,13.536s-13.536-6.072-13.536-13.536v-31.368c0-7.463 6.073-13.536 13.536-13.536zm-5.003-29.305v19.846c-10.581,2.301-18.532,11.735-18.532,22.995v31.368c0,11.26 7.951,20.694 18.532,22.995v41.837c-36.699-0.775-72.823-10.076-105.126-27.059v-1.971c-0.001-59.049 46.714-107.386 105.126-110.011zm5.003,371.277c-60.726-5.68434e-14-110.13-49.404-110.13-110.129v-137.928c34.015,16.958 71.851,25.88 110.126,25.88 38.28,0 76.118-8.921 110.133-25.878v137.925c0,60.726-49.403,110.13-110.129,110.13z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

+1
View File
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.5 KiB

+11
View File
@@ -0,0 +1,11 @@
<RCC>
<qresource prefix="/">
<file>OpenRGB.png</file>
<file>motherboard.svg</file>
<file>ram.svg</file>
<file>graphics-card.svg</file>
<file>fan.svg</file>
<file>keyboard.svg</file>
<file>mouse.svg</file>
</qresource>
</RCC>
-50
View File
@@ -1,50 +0,0 @@
#include "I2CDetectDialog.h"
#include "OpenAuraSDK.h"
IMPLEMENT_DYNAMIC(I2CDetectDialog, CDialogEx)
I2CDetectDialog::I2CDetectDialog(std::vector<i2c_smbus_interface *>& bus, CWnd* pParent)
: CDialogEx(IDD_DIALOG_I2C_DETECT, pParent), busses(bus)
{
}
I2CDetectDialog::~I2CDetectDialog()
{
}
void I2CDetectDialog::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(I2CDetectDialog, CDialogEx)
ON_BN_CLICKED(IDC_BUTTON_I2C_DETECT, &I2CDetectDialog::OnBnClickedButtonI2cDetect)
END_MESSAGE_MAP()
BOOL I2CDetectDialog::OnInitDialog()
{
CComboBox* i2c_bus_box = (CComboBox*)GetDlgItem(IDC_COMBO_I2C_BUS);
for (int i = 0; i < busses.size(); i++)
{
i2c_bus_box->AddString(busses[i]->device_name);
}
i2c_bus_box->SetCurSel(0);
CFont* myFont = new CFont();
myFont->CreateFontA(16, 0, 0, 0, FW_DONTCARE, false, false, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, _T("Consolas"));
CEdit* edit = (CEdit*)GetDlgItem(IDC_EDIT_I2C_DETECT);
edit->SetFont(myFont);
return TRUE;
}
void I2CDetectDialog::OnBnClickedButtonI2cDetect()
{
i2c_smbus_interface* bus = busses[((CComboBox*)GetDlgItem(IDC_COMBO_I2C_BUS))->GetCurSel()];
SetDlgItemText(IDC_EDIT_I2C_DETECT, DetectI2C(bus, MODE_QUICK).c_str());
}
-28
View File
@@ -1,28 +0,0 @@
#ifndef I2CDETECT_DIALOG_H
#define I2CDETECT_DIALOG_H
#include <afxdialogex.h>
#include <vector>
#include "i2c_smbus.h"
#include "resource.h"
class I2CDetectDialog : public CDialogEx
{
DECLARE_DYNAMIC(I2CDetectDialog)
public:
I2CDetectDialog(std::vector<i2c_smbus_interface *>& bus, CWnd* pParent = NULL);
virtual ~I2CDetectDialog();
virtual BOOL OnInitDialog();
private:
protected:
std::vector<i2c_smbus_interface *>& busses;
virtual void DoDataExchange(CDataExchange* pDX);
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedButtonI2cDetect();
};
#endif
-197
View File
@@ -1,197 +0,0 @@
#include "OpenAuraSDKDialog.h"
#include "OpenAuraSDK.h"
#include "I2CDetectDialog.h"
IMPLEMENT_DYNAMIC(OpenAuraSDKDialog, CDialogEx)
OpenAuraSDKDialog::OpenAuraSDKDialog(std::vector<i2c_smbus_interface *>& bus, std::vector<RGBController *>& control, CWnd* pParent)
: CDialogEx(IDD_DIALOG_OPENAURASDK, pParent), busses(bus), controllers (control)
{
}
OpenAuraSDKDialog::~OpenAuraSDKDialog()
{
}
void OpenAuraSDKDialog::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(OpenAuraSDKDialog, CDialogEx)
ON_BN_CLICKED(IDC_BUTTON_OPENAURASDK_I2CDETECT, &OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkI2cdetect)
ON_CBN_CLOSEUP(IDC_COMBO_OPENAURASDK_DEVICE, &OpenAuraSDKDialog::OnCbnCloseupComboOpenaurasdkDevice)
ON_BN_CLICKED(IDC_BUTTON_OPENAURASDK_SET_COLORS_ALL, &OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetColorsAll)
ON_CBN_CLOSEUP(IDC_COMBO_OPENAURASDK_MODE, &OpenAuraSDKDialog::OnCbnCloseupComboOpenaurasdkMode)
ON_BN_CLICKED(IDC_BUTTON_OPENAURASDK_SET_ZONE, &OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetZone)
ON_BN_CLICKED(IDC_BUTTON_OPENAURASDK_SET_COLORS_LED, &OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetColorsLed)
ON_BN_CLICKED(IDC_BUTTON_OPENAURASDK_SET_COLORS_DEVICE, &OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetColorsDevice)
END_MESSAGE_MAP()
BOOL OpenAuraSDKDialog::OnInitDialog()
{
CComboBox* controller_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_DEVICE);
CComboBox* mode_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_MODE);
CComboBox* zone_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_ZONE);
CComboBox* led_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_LED);
for (int i = 0; i < controllers.size(); i++)
{
controller_box->AddString(controllers[i]->name.c_str());
}
controller_box->SetCurSel(0);
if (controllers.size() > 0)
{
for (int i = 0; i < controllers[0]->modes.size(); i++)
{
mode_box->AddString(controllers[0]->modes[i].name.c_str());
}
mode_box->SetCurSel(controllers[0]->GetMode());
for (int i = 0; i < controllers[0]->zones.size(); i++)
{
zone_box->AddString(controllers[0]->zones[i].name.c_str());
}
zone_box->SetCurSel(0);
for (int i = 0; i < controllers[0]->leds.size(); i++)
{
led_box->AddString(controllers[0]->leds[i].name.c_str());
}
led_box->SetCurSel(0);
}
return TRUE;
}
void OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkI2cdetect()
{
I2CDetectDialog dlg(busses);
dlg.DoModal();
}
void OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetColorsAll()
{
RGBColor color = ToRGBColor(
GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_R),
GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_G),
GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_B)
);
for (int i = 0; i < controllers.size(); i++)
{
controllers[i]->SetCustomMode();
controllers[i]->SetAllLEDs(color);
}
}
void OpenAuraSDKDialog::OnCbnCloseupComboOpenaurasdkDevice()
{
CComboBox* controller_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_DEVICE);
CComboBox* mode_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_MODE);
CComboBox* zone_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_ZONE);
CComboBox* led_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_LED);
if (controllers.size() > 0)
{
mode_box->ResetContent();
for (int i = 0; i < controllers[controller_box->GetCurSel()]->modes.size(); i++)
{
mode_box->AddString(controllers[controller_box->GetCurSel()]->modes[i].name.c_str());
}
mode_box->SetCurSel(controllers[controller_box->GetCurSel()]->GetMode());
zone_box->ResetContent();
for (int i = 0; i < controllers[controller_box->GetCurSel()]->zones.size(); i++)
{
zone_box->AddString(controllers[controller_box->GetCurSel()]->zones[i].name.c_str());
}
zone_box->SetCurSel(0);
led_box->ResetContent();
for (int i = 0; i < controllers[controller_box->GetCurSel()]->leds.size(); i++)
{
led_box->AddString(controllers[controller_box->GetCurSel()]->leds[i].name.c_str());
}
led_box->SetCurSel(0);
}
}
void OpenAuraSDKDialog::OnCbnCloseupComboOpenaurasdkMode()
{
CComboBox* controller_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_DEVICE);
CComboBox* mode_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_MODE);
if (controllers.size() > 0)
{
controllers[controller_box->GetCurSel()]->SetMode(mode_box->GetCurSel());
}
}
void OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetZone()
{
CComboBox* controller_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_DEVICE);
CComboBox* zone_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_ZONE);
RGBColor color = ToRGBColor(
GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_R),
GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_G),
GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_B)
);
if (controllers.size() > 0)
{
controllers[controller_box->GetCurSel()]->SetAllZoneLEDs(zone_box->GetCurSel(), color);
}
}
void OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetColorsLed()
{
CComboBox* controller_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_DEVICE);
CComboBox* led_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_LED);
RGBColor color = ToRGBColor(
GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_R),
GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_G),
GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_B)
);
if (controllers.size() > 0)
{
controllers[controller_box->GetCurSel()]->SetLED(led_box->GetCurSel(), color);
}
}
void OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetColorsDevice()
{
CComboBox* controller_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_DEVICE);
RGBColor color = ToRGBColor(
GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_R),
GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_G),
GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_B)
);
if (controllers.size() > 0)
{
controllers[controller_box->GetCurSel()]->SetAllLEDs(color);
}
}
-38
View File
@@ -1,38 +0,0 @@
#ifndef OPENAURASDK_DIALOG_H
#define OPENAURASDK_DIALOG_H
#include <afxdialogex.h>
#include <vector>
#include "i2c_smbus.h"
#include "RGBController.h"
#include "resource.h"
class OpenAuraSDKDialog : public CDialogEx
{
DECLARE_DYNAMIC(OpenAuraSDKDialog)
public:
OpenAuraSDKDialog(std::vector<i2c_smbus_interface *>& bus, std::vector<RGBController *>& control, CWnd* pParent = NULL);
virtual ~OpenAuraSDKDialog();
virtual BOOL OnInitDialog();
private:
void setMode(unsigned char mode_val);
protected:
std::vector<i2c_smbus_interface *>& busses;
std::vector<RGBController *>& controllers;
virtual void DoDataExchange(CDataExchange* pDX);
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedButtonOpenaurasdkI2cdetect();
afx_msg void OnCbnCloseupComboOpenaurasdkDevice();
afx_msg void OnBnClickedButtonOpenaurasdkSetColorsAll();
afx_msg void OnCbnCloseupComboOpenaurasdkMode();
afx_msg void OnBnClickedButtonOpenaurasdkSetZone();
afx_msg void OnBnClickedButtonOpenaurasdkSetColorsLed();
afx_msg void OnBnClickedButtonOpenaurasdkSetColorsDevice();
};
#endif
BIN
View File
Binary file not shown.
-61
View File
@@ -1,61 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Resource.rc
//
#define IDD_DIALOG_I2C_DETECT 101
#define IDD_DIALOG_OPENAURASDK 103
#define IDC_COMBO_I2C_BUS 1001
#define IDC_BUTTON_I2C_DETECT 1002
#define IDC_EDIT_I2C_DETECT 1003
#define IDC_BUTTON_OPENAURASDK_I2CDETECT 1004
#define IDC_RADIO_OPENAURASDK_DIRECT_MODE 1006
#define IDC_RADIO_OPENAURASDK_EFFECT_MODE 1007
#define IDC_RADIO_OPENAURASDK_EFFECT_STATIC 1008
#define IDC_RADIO_OPENAURASDK_EFFECT_OFF 1009
#define IDC_RADIO_OPENAURASDK_EFFECT_BREATHING 1010
#define IDC_RADIO_OPENAURASDK_EFFECT_FLASHING 1011
#define IDC_RADIO_OPENAURASDK_EFFECT_SPECTRUM_CYCLE 1012
#define IDC_RADIO_OPENAURASDK_EFFECT_RAINBOW 1013
#define IDC_RADIO_OPENAURASDK_BREATHING_SPECTRUM 1014
#define IDC_RADIO_OPENAURASDK_EFFECT_CHASE_FADE 1015
#define IDC_EDIT_OPENAURASDK_LED_0_R 1016
#define IDC_EDIT_OPENAURASDK_LED_0_G 1017
#define IDC_EDIT_OPENAURASDK_LED_0_B 1018
#define IDC_BUTTON_OPENAURASDK_SET_COLORS_ALL 1019
#define IDC_COMBO_OPENAURASDK_DEVICE 1020
#define IDC_EDIT_OPENAURASDK_LED_1_R 1021
#define IDC_BUTTON_OPENAURASDK_SET_COLORS_ALL2 1021
#define IDC_BUTTON_OPENAURASDK_SET_COLORS_LED 1021
#define IDC_EDIT_OPENAURASDK_LED_1_G 1022
#define IDC_BUTTON_OPENAURASDK_SET_COLORS_ALL3 1022
#define IDC_BUTTON_OPENAURASDK_SET_COLORS_DEVICE 1022
#define IDC_EDIT_OPENAURASDK_LED_1_B 1023
#define IDC_EDIT_OPENAURASDK_LED_2_R 1024
#define IDC_EDIT_OPENAURASDK_LED_2_G 1025
#define IDC_EDIT_OPENAURASDK_LED_2_B 1026
#define IDC_EDIT_OPENAURASDK_LED_3_R 1027
#define IDC_EDIT_OPENAURASDK_LED_3_G 1028
#define IDC_EDIT_OPENAURASDK_LED_3_B 1029
#define IDC_EDIT_OPENAURASDK_LED_4_R 1030
#define IDC_EDIT_OPENAURASDK_LED_4_G 1031
#define IDC_EDIT_OPENAURASDK_LED_4_B 1032
#define IDC_BUTTON1 1033
#define IDC_BUTTON_OPENAURASDK_DUMP 1033
#define IDC_BUTTON_OPENAURASDK_SET_COLORS2 1034
#define IDC_BUTTON_OPENAURASDK_SET_COLORS 1034
#define IDC_BUTTON_OPENAURASDK_SET_ZONE 1034
#define IDC_COMBO_OPENAURASDK_DEVICE2 1035
#define IDC_COMBO_OPENAURASDK_MODE 1035
#define IDC_COMBO_OPENAURASDK_ZONE 1036
#define IDC_COMBO_OPENAURASDK_LED 1037
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 105
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1034
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif