mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-24 14:35:01 -04:00
Get active mode and last color set from EVGA v1 cards
Improve the user experience by allowing the UI to be initialized with the settings that are currently active on the hardware.
This commit is contained in:
@@ -30,6 +30,11 @@ std::string EVGAGPUv1Controller::GetDeviceLocation()
|
||||
return("I2C: " + return_string);
|
||||
}
|
||||
|
||||
unsigned char EVGAGPUv1Controller::GetMode()
|
||||
{
|
||||
return(bus->i2c_smbus_read_byte_data(dev, EVGA_GPU_V1_REG_MODE));
|
||||
}
|
||||
|
||||
unsigned char EVGAGPUv1Controller::GetRed()
|
||||
{
|
||||
return(bus->i2c_smbus_read_byte_data(dev, EVGA_GPU_V1_REG_RED));
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
|
||||
unsigned char GetMode();
|
||||
unsigned char GetRed();
|
||||
unsigned char GetGreen();
|
||||
unsigned char GetBlue();
|
||||
|
||||
@@ -49,8 +49,26 @@ RGBController_EVGAGPUv1::RGBController_EVGAGPUv1(EVGAGPUv1Controller* evga_ptr)
|
||||
|
||||
SetupZones();
|
||||
|
||||
// Initialize active mode
|
||||
// Initialize active mode and stored color
|
||||
|
||||
unsigned char raw_active_mode = evga->GetMode();
|
||||
|
||||
active_mode = 0;
|
||||
for(unsigned int i = 0; i < modes.size(); i++)
|
||||
{
|
||||
if (modes[i].value == raw_active_mode)
|
||||
{
|
||||
active_mode = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char r = evga->GetRed();
|
||||
unsigned char g = evga->GetGreen();
|
||||
unsigned char b = evga->GetBlue();
|
||||
|
||||
RGBColor color = ToRGBColor(r, g, b);
|
||||
colors[0] = color;
|
||||
}
|
||||
|
||||
void RGBController_EVGAGPUv1::SetupZones()
|
||||
|
||||
Reference in New Issue
Block a user