Compare commits
30
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe37c261a2 | ||
|
|
cbdbb71d79 | ||
|
|
5f786e649a | ||
|
|
f76bf34d8d | ||
|
|
e799574730 | ||
|
|
1a5b12c7a0 | ||
|
|
d2acc75ba8 | ||
|
|
74bcfbd940 | ||
|
|
1db45f2cf2 | ||
|
|
6e467fe8cd | ||
|
|
441c462e59 | ||
|
|
89b4716012 | ||
|
|
e51e9a71a0 | ||
|
|
02273a3601 | ||
|
|
e0018b23aa | ||
|
|
b06f384350 | ||
|
|
7dddb9d111 | ||
|
|
0d38154134 | ||
|
|
7dd84c7ac8 | ||
|
|
ffd0088378 | ||
|
|
f0c486c30d | ||
|
|
010ab1182d | ||
|
|
7e64ca1f83 | ||
|
|
2fcff92523 | ||
|
|
8beeb5f7b2 | ||
|
|
7d2b5f285f | ||
|
|
b8eb4e9bcb | ||
|
|
733b904ec4 | ||
|
|
59a3b41480 | ||
|
|
28b41451f8 |
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() */
|
||||
|
||||
@@ -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() */
|
||||
+4
-80
@@ -16,7 +16,6 @@
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
#include <tchar.h>
|
||||
#include <regex>
|
||||
#include "i2c_smbus_piix4.h"
|
||||
#include "i2c_smbus_i801.h"
|
||||
@@ -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,7 +357,9 @@ 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);
|
||||
@@ -457,9 +380,10 @@ 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
|
||||
|
||||
@@ -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
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -2,12 +2,12 @@ QT += core gui
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
TARGET = OpenAuraSDK.bin
|
||||
TARGET = OpenRGB
|
||||
TEMPLATE = app
|
||||
|
||||
INCLUDEPATH += \
|
||||
dependencies/libe131/src/ \
|
||||
i2c_smbus/ \
|
||||
i2c_tools/ \
|
||||
net_port/ \
|
||||
serial_port/ \
|
||||
Controllers/AuraController/ \
|
||||
@@ -16,17 +16,22 @@ INCLUDEPATH += \
|
||||
Controllers/HuePlusController/ \
|
||||
Controllers/HyperXController/ \
|
||||
Controllers/LEDStripController/ \
|
||||
Controllers/RGBFusionController/ \
|
||||
RGBController/ \
|
||||
qt/
|
||||
|
||||
SOURCES += \
|
||||
dependencies/libe131/src/e131.c \
|
||||
main.cpp \
|
||||
OpenAuraSDK.cpp \
|
||||
qt/OpenAuraSDKQtDialog.cpp \
|
||||
qt/OpenRGBDeviceInfoPage.cpp \
|
||||
qt/OpenRGBDevicePage.cpp \
|
||||
qt/OpenRGBDialog.cpp \
|
||||
i2c_smbus/i2c_smbus.cpp \
|
||||
i2c_smbus/i2c_smbus_linux.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 \
|
||||
@@ -40,22 +45,26 @@ SOURCES += \
|
||||
Controllers/HyperXController/HyperXControllerDetect.cpp \
|
||||
Controllers/LEDStripController/LEDStripController.cpp \
|
||||
Controllers/LEDStripController/LEDStripControllerDetect.cpp \
|
||||
RGBController/OpenRazerDetect.cpp \
|
||||
RGBController/E131ControllerDetect.cpp \
|
||||
Controllers/RGBFusionController/RGBFusionController.cpp \
|
||||
Controllers/RGBFusionController/RGBFusionControllerDetect.cpp \
|
||||
RGBController/RGBController_Aura.cpp \
|
||||
RGBController/RGBController_Corsair.cpp \
|
||||
RGBController/RGBController_CorsairPro.cpp \
|
||||
RGBController/RGBController_E131.cpp \
|
||||
RGBController/RGBController_HuePlus.cpp \
|
||||
RGBController/RGBController_HyperX.cpp \
|
||||
RGBController/RGBController_LEDStrip.cpp \
|
||||
RGBController/RGBController_OpenRazer.cpp
|
||||
RGBController/RGBController_RGBFusion.cpp
|
||||
|
||||
HEADERS += \
|
||||
qt/OpenAuraSDKQtDialog.h \
|
||||
HEADERS += \
|
||||
Controllers/RGBFusionController/RGBFusionController.h \
|
||||
qt/OpenRGBDeviceInfoPage.h \
|
||||
qt/OpenRGBDevicePage.h \
|
||||
qt/OpenRGBDialog.h \
|
||||
i2c_smbus/i2c_smbus.h \
|
||||
i2c_smbus/i2c_smbus_linux.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 \
|
||||
@@ -67,13 +76,72 @@ HEADERS += \
|
||||
RGBController/RGBController_Aura.h \
|
||||
RGBController/RGBController_Corsair.h \
|
||||
RGBController/RGBController_CorsairPro.h \
|
||||
RGBController/RGBController_E131.h \
|
||||
RGBController/RGBController_HuePlus.h \
|
||||
RGBController/RGBController_HyperX.h \
|
||||
RGBController/RGBController_OpenRazer.h
|
||||
RGBController/RGBController_RGBFusion.h
|
||||
|
||||
RESOURCES += \
|
||||
qt/resources.qrc
|
||||
|
||||
FORMS += \
|
||||
qt/openaurasdk.ui
|
||||
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 \
|
||||
@@ -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**
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,4 +26,4 @@ public:
|
||||
|
||||
private:
|
||||
CorsairController* corsair;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -24,5 +24,7 @@ public:
|
||||
void UpdateLEDs();
|
||||
|
||||
private:
|
||||
HuePlusController* strip;
|
||||
HuePlusController* hueplus;
|
||||
std::vector<unsigned int> leds_channel;
|
||||
std::vector<unsigned int> zones_channel;
|
||||
};
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,7 +92,7 @@ void RGBController_OpenRazer::SetCustomMode()
|
||||
|
||||
void RGBController_OpenRazer::UpdateLEDs()
|
||||
{
|
||||
switch(type)
|
||||
switch(matrix_type)
|
||||
{
|
||||
case RAZER_TYPE_MATRIX_FRAME:
|
||||
case RAZER_TYPE_MATRIX_NOFRAME:
|
||||
@@ -106,7 +106,7 @@ void RGBController_OpenRazer::UpdateLEDs()
|
||||
unsigned int output_offset;
|
||||
unsigned int row_offset = (row * matrix_cols);
|
||||
|
||||
if(type == RAZER_TYPE_MATRIX_FRAME)
|
||||
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
|
||||
{
|
||||
output_array_size = 3 + (matrix_cols* 3);
|
||||
output_offset = 3;
|
||||
@@ -119,7 +119,7 @@ void RGBController_OpenRazer::UpdateLEDs()
|
||||
|
||||
char output_array[output_array_size];
|
||||
|
||||
if(type == RAZER_TYPE_MATRIX_FRAME)
|
||||
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
|
||||
{
|
||||
output_array[0] = row;
|
||||
output_array[1] = 0;
|
||||
@@ -134,12 +134,12 @@ void RGBController_OpenRazer::UpdateLEDs()
|
||||
output_array[(col * 3) + 2 + output_offset] = (char)RGBGetBValue(colors[color_idx]);
|
||||
}
|
||||
|
||||
if(type == RAZER_TYPE_MATRIX_FRAME)
|
||||
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
|
||||
{
|
||||
matrix_custom_frame.write(output_array, output_array_size);
|
||||
matrix_custom_frame.flush();
|
||||
}
|
||||
else if(type == RAZER_TYPE_MATRIX_NOFRAME)
|
||||
else if(matrix_type == RAZER_TYPE_MATRIX_NOFRAME)
|
||||
{
|
||||
matrix_effect_custom.write(output_array, output_array_size);
|
||||
matrix_effect_custom.flush();
|
||||
@@ -151,7 +151,7 @@ void RGBController_OpenRazer::UpdateLEDs()
|
||||
}
|
||||
}
|
||||
|
||||
if(type == RAZER_TYPE_MATRIX_FRAME)
|
||||
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
|
||||
{
|
||||
matrix_effect_custom.write(&update_value, 1);
|
||||
matrix_effect_custom.flush();
|
||||
@@ -231,6 +231,34 @@ static std::string GetDeviceTypeString(std::string dev_path)
|
||||
return(ret_str);
|
||||
}
|
||||
|
||||
static std::string GetFirmwareVersionString(std::string dev_path)
|
||||
{
|
||||
// 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;
|
||||
|
||||
firm_ver_file.open(firm_ver_path);
|
||||
std::getline(firm_ver_file, ret_str);
|
||||
firm_ver_file.close();
|
||||
|
||||
return(ret_str);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
ser_num_file.open(ser_num_path);
|
||||
std::getline(ser_num_file, ret_str);
|
||||
ser_num_file.close();
|
||||
|
||||
return(ret_str);
|
||||
}
|
||||
|
||||
void RGBController_OpenRazer::SetupMatrixDevice(std::string dev_path, unsigned int rows, unsigned int cols)
|
||||
{
|
||||
matrix_custom_frame.open(dev_path + "/matrix_custom_frame");
|
||||
@@ -246,11 +274,11 @@ void RGBController_OpenRazer::SetupMatrixDevice(std::string dev_path, unsigned i
|
||||
{
|
||||
if(!matrix_effect_custom)
|
||||
{
|
||||
type = RAZER_TYPE_MATRIX_STATIC;
|
||||
matrix_type = RAZER_TYPE_MATRIX_STATIC;
|
||||
}
|
||||
else
|
||||
{
|
||||
type = RAZER_TYPE_MATRIX_NOFRAME;
|
||||
matrix_type = RAZER_TYPE_MATRIX_NOFRAME;
|
||||
}
|
||||
|
||||
matrix_rows = 1;
|
||||
@@ -258,7 +286,7 @@ void RGBController_OpenRazer::SetupMatrixDevice(std::string dev_path, unsigned i
|
||||
}
|
||||
else
|
||||
{
|
||||
type = RAZER_TYPE_MATRIX_FRAME;
|
||||
matrix_type = RAZER_TYPE_MATRIX_FRAME;
|
||||
|
||||
matrix_rows = rows;
|
||||
matrix_cols = cols;
|
||||
@@ -272,7 +300,7 @@ 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)
|
||||
@@ -289,6 +317,26 @@ RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
|
||||
\*-----------------------------------------------------------------*/
|
||||
name = GetDeviceTypeString(dev_path);
|
||||
|
||||
/*-----------------------------------------------------------------*\
|
||||
| Set the description to indicate this is an OpenRazer device |
|
||||
\*-----------------------------------------------------------------*/
|
||||
description = "OpenRazer Device";
|
||||
|
||||
/*-----------------------------------------------------------------*\
|
||||
| Set the device path as the location |
|
||||
\*-----------------------------------------------------------------*/
|
||||
location = dev_path;
|
||||
|
||||
/*-----------------------------------------------------------------*\
|
||||
| Get the serial number from the dev path |
|
||||
\*-----------------------------------------------------------------*/
|
||||
serial = GetSerialNumberString(dev_path);
|
||||
|
||||
/*-----------------------------------------------------------------*\
|
||||
| Get the firmware version from the dev path |
|
||||
\*-----------------------------------------------------------------*/
|
||||
version = GetFirmwareVersionString(dev_path);
|
||||
|
||||
/*-----------------------------------------------------------------*\
|
||||
| Loop through all known devices to look for a name match |
|
||||
\*-----------------------------------------------------------------*/
|
||||
@@ -301,6 +349,11 @@ RGBController_OpenRazer::RGBController_OpenRazer(std::string dev_path)
|
||||
\*---------------------------------------------------------*/
|
||||
device = i;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Set device type |
|
||||
\*---------------------------------------------------------*/
|
||||
type = device_list[i]->type;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Initialize modes |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
@@ -25,6 +25,7 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
std::string name;
|
||||
device_type type;
|
||||
bool matrix_type;
|
||||
unsigned int rows;
|
||||
unsigned int cols;
|
||||
@@ -53,6 +54,7 @@ static const razer_zone blackwidow_chroma_zone =
|
||||
static const razer_device blackwidow_chroma_device =
|
||||
{
|
||||
"Razer BlackWidow Chroma",
|
||||
DEVICE_TYPE_KEYBOARD,
|
||||
true,
|
||||
6,
|
||||
22,
|
||||
@@ -84,6 +86,7 @@ static const razer_zone blackwidow_chroma_te_zone =
|
||||
static const razer_device blackwidow_chroma_te_device =
|
||||
{
|
||||
"Razer BlackWidow Chroma Tournament Edition",
|
||||
DEVICE_TYPE_KEYBOARD,
|
||||
true,
|
||||
6,
|
||||
22,
|
||||
@@ -115,6 +118,7 @@ static const razer_zone ornata_chroma_zone =
|
||||
static const razer_device ornata_chroma_device =
|
||||
{
|
||||
"Razer Ornata Chroma",
|
||||
DEVICE_TYPE_KEYBOARD,
|
||||
true,
|
||||
6,
|
||||
22,
|
||||
@@ -146,6 +150,7 @@ static const razer_zone deathstalker_chroma_zone =
|
||||
static const razer_device deathstalker_chroma_device =
|
||||
{
|
||||
"Razer DeathStalker Chroma",
|
||||
DEVICE_TYPE_KEYBOARD,
|
||||
true,
|
||||
1,
|
||||
12,
|
||||
@@ -181,6 +186,7 @@ static const razer_zone blade_stealth_zone =
|
||||
static const razer_device blade_stealth_device =
|
||||
{
|
||||
"Razer Blade Stealth",
|
||||
DEVICE_TYPE_KEYBOARD,
|
||||
true,
|
||||
6,
|
||||
16,
|
||||
@@ -212,6 +218,7 @@ static const razer_zone blade_pro_late_2016_zone =
|
||||
static const razer_device blade_pro_late_2016_device =
|
||||
{
|
||||
"Razer Blade Pro (Late 2016)",
|
||||
DEVICE_TYPE_KEYBOARD,
|
||||
true,
|
||||
6,
|
||||
25,
|
||||
@@ -243,6 +250,7 @@ static const razer_zone blade_pro_2017_zone =
|
||||
static const razer_device blade_pro_2017_device =
|
||||
{
|
||||
"Razer Blade Pro (2017)",
|
||||
DEVICE_TYPE_KEYBOARD,
|
||||
true,
|
||||
6,
|
||||
25,
|
||||
@@ -314,6 +322,7 @@ static const razer_zone mamba_te_scroll_wheel_zone =
|
||||
static const razer_device mamba_te_device =
|
||||
{
|
||||
"Razer Mamba Tournament Edition",
|
||||
DEVICE_TYPE_MOUSE,
|
||||
true,
|
||||
1,
|
||||
16,
|
||||
@@ -393,6 +402,7 @@ static const razer_zone diamondback_chroma_scroll_wheel_zone =
|
||||
static const razer_device diamondback_chroma_device =
|
||||
{
|
||||
"Razer Diamondback Chroma",
|
||||
DEVICE_TYPE_MOUSE,
|
||||
true,
|
||||
1,
|
||||
21,
|
||||
@@ -436,6 +446,7 @@ static const razer_zone deathadder_chroma_scroll_wheel_zone =
|
||||
static const razer_device deathadder_chroma_device =
|
||||
{
|
||||
"Razer DeathAdder Chroma",
|
||||
DEVICE_TYPE_MOUSE,
|
||||
false,
|
||||
1,
|
||||
2,
|
||||
@@ -491,6 +502,7 @@ static const razer_zone naga_chroma_numpad_zone =
|
||||
static const razer_device naga_chroma_device =
|
||||
{
|
||||
"Razer Naga Chroma",
|
||||
DEVICE_TYPE_MOUSE,
|
||||
false,
|
||||
1,
|
||||
3,
|
||||
@@ -526,6 +538,7 @@ static const razer_zone orbweaver_chroma_zone =
|
||||
static const razer_device orbweaver_chroma_device =
|
||||
{
|
||||
"Razer Orbweaver Chroma",
|
||||
DEVICE_TYPE_KEYBOARD,
|
||||
true,
|
||||
6,
|
||||
25,
|
||||
@@ -557,6 +570,7 @@ static const razer_zone tartarus_chroma_zone =
|
||||
static const razer_device tartarus_chroma_device =
|
||||
{
|
||||
"Razer Tartarus Chroma",
|
||||
DEVICE_TYPE_KEYBOARD,
|
||||
true,
|
||||
1,
|
||||
1,
|
||||
@@ -592,6 +606,7 @@ static const razer_zone firefly_zone =
|
||||
static const razer_device firefly_device =
|
||||
{
|
||||
"Razer Firefly",
|
||||
DEVICE_TYPE_MOUSEMAT,
|
||||
true,
|
||||
1,
|
||||
15,
|
||||
@@ -623,6 +638,7 @@ static const razer_zone goliathus_extended_zone =
|
||||
static const razer_device goliathus_extended_device =
|
||||
{
|
||||
"Razer Goliathus Extended",
|
||||
DEVICE_TYPE_MOUSEMAT,
|
||||
true,
|
||||
1,
|
||||
1,
|
||||
@@ -658,6 +674,7 @@ static const razer_zone kraken_chroma_zone =
|
||||
static const razer_device kraken_chroma_device =
|
||||
{
|
||||
"Razer Kraken 7.1 Chroma",
|
||||
DEVICE_TYPE_HEADSET,
|
||||
true,
|
||||
1,
|
||||
1,
|
||||
@@ -689,6 +706,7 @@ static const razer_zone kraken_v2_zone =
|
||||
static const razer_device kraken_v2_device =
|
||||
{
|
||||
"Razer Kraken 7.1 V2",
|
||||
DEVICE_TYPE_HEADSET,
|
||||
true,
|
||||
1,
|
||||
1,
|
||||
@@ -736,6 +754,7 @@ static const razer_zone core_led_strip_zone =
|
||||
static const razer_device core_device =
|
||||
{
|
||||
"Razer Core",
|
||||
DEVICE_TYPE_UNKNOWN,
|
||||
true,
|
||||
1,
|
||||
9,
|
||||
@@ -767,6 +786,7 @@ static const razer_zone mug_holder_zone =
|
||||
static const razer_device mug_holder_device =
|
||||
{
|
||||
"Razer Chroma Mug Holder",
|
||||
DEVICE_TYPE_UNKNOWN,
|
||||
true,
|
||||
1,
|
||||
15,
|
||||
@@ -810,6 +830,7 @@ static const razer_zone chromahdk_zone =
|
||||
static const razer_device chromahdk_device =
|
||||
{
|
||||
"Razer Chroma HDK",
|
||||
DEVICE_TYPE_LEDSTRIP,
|
||||
true,
|
||||
4,
|
||||
16,
|
||||
@@ -913,7 +934,7 @@ private:
|
||||
void SetupMatrixDevice(std::string dev_path, unsigned int rows, unsigned int cols);
|
||||
void SetupNonMatrixDevice(std::string dev_path);
|
||||
|
||||
unsigned int type;
|
||||
unsigned int matrix_type;
|
||||
unsigned int matrix_rows;
|
||||
unsigned int matrix_cols;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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() */
|
||||
@@ -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);
|
||||
@@ -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
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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
|
||||
@@ -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>
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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
|
||||
@@ -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,9 +1,9 @@
|
||||
#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);
|
||||
|
||||
@@ -63,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(),
|
||||
@@ -130,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(),
|
||||
@@ -141,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(),
|
||||
@@ -152,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(),
|
||||
@@ -163,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();
|
||||
|
||||
@@ -193,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
|
||||
@@ -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">
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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>
|
||||
@@ -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());
|
||||
}
|
||||
@@ -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
|
||||
@@ -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>
|
||||
@@ -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
@@ -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 */
|
||||
@@ -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 */
|
||||
@@ -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 |
@@ -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 |
@@ -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 |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 6.5 KiB |
+10
-4
@@ -1,5 +1,11 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>OpenRGB.png</file>
|
||||
</qresource>
|
||||
<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>
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
@@ -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
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
Binary file not shown.
@@ -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
|
||||
Reference in New Issue
Block a user