mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-16 11:56:56 -04:00
Store name in ZotacTuringGPUController to avoid setting it in detector
This commit is contained in:
@@ -24,19 +24,19 @@
|
||||
|
||||
RGBController_ZotacTuringGPU::RGBController_ZotacTuringGPU(ZotacTuringGPUController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "ZOTAC GPU";
|
||||
vendor = "ZOTAC";
|
||||
description = "ZOTAC Turing-based RGB GPU Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
type = DEVICE_TYPE_GPU;
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "ZOTAC";
|
||||
description = "ZOTAC Turing-based RGB GPU Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
type = DEVICE_TYPE_GPU;
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = ZOTAC_GPU_MODE_STATIC;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = ZOTAC_GPU_MODE_STATIC;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Flashing;
|
||||
@@ -50,33 +50,33 @@ RGBController_ZotacTuringGPU::RGBController_ZotacTuringGPU(ZotacTuringGPUControl
|
||||
modes.push_back(Flashing);
|
||||
|
||||
mode Wave;
|
||||
Wave.name = "Rainbow Wave";
|
||||
Wave.value = ZOTAC_GPU_MODE_WAVE;
|
||||
Wave.flags = MODE_FLAG_HAS_SPEED;
|
||||
Wave.speed_min = ZOTAC_GPU_SPEED_SLOWEST;
|
||||
Wave.speed_max = ZOTAC_GPU_SPEED_FASTEST;
|
||||
Wave.speed = ZOTAC_GPU_SPEED_NORMAL;
|
||||
Wave.color_mode = MODE_COLORS_NONE;
|
||||
Wave.name = "Rainbow Wave";
|
||||
Wave.value = ZOTAC_GPU_MODE_WAVE;
|
||||
Wave.flags = MODE_FLAG_HAS_SPEED;
|
||||
Wave.speed_min = ZOTAC_GPU_SPEED_SLOWEST;
|
||||
Wave.speed_max = ZOTAC_GPU_SPEED_FASTEST;
|
||||
Wave.speed = ZOTAC_GPU_SPEED_NORMAL;
|
||||
Wave.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Wave);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = ZOTAC_GPU_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Breathing.speed_min = ZOTAC_GPU_SPEED_SLOWEST;
|
||||
Breathing.speed_max = ZOTAC_GPU_SPEED_FASTEST;
|
||||
Breathing.speed = ZOTAC_GPU_SPEED_NORMAL;
|
||||
Breathing.color_mode = MODE_COLORS_PER_LED;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = ZOTAC_GPU_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Breathing.speed_min = ZOTAC_GPU_SPEED_SLOWEST;
|
||||
Breathing.speed_max = ZOTAC_GPU_SPEED_FASTEST;
|
||||
Breathing.speed = ZOTAC_GPU_SPEED_NORMAL;
|
||||
Breathing.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode ColorCycle;
|
||||
ColorCycle.name = "Spectrum Cycle";
|
||||
ColorCycle.value = ZOTAC_GPU_MODE_COLOR_CYCLE;
|
||||
ColorCycle.flags = MODE_FLAG_HAS_SPEED;
|
||||
ColorCycle.speed_min = ZOTAC_GPU_SPEED_SLOWEST;
|
||||
ColorCycle.speed_max = ZOTAC_GPU_SPEED_FASTEST;
|
||||
ColorCycle.speed = ZOTAC_GPU_SPEED_NORMAL;
|
||||
ColorCycle.color_mode = MODE_COLORS_NONE;
|
||||
ColorCycle.name = "Spectrum Cycle";
|
||||
ColorCycle.value = ZOTAC_GPU_MODE_COLOR_CYCLE;
|
||||
ColorCycle.flags = MODE_FLAG_HAS_SPEED;
|
||||
ColorCycle.speed_min = ZOTAC_GPU_SPEED_SLOWEST;
|
||||
ColorCycle.speed_max = ZOTAC_GPU_SPEED_FASTEST;
|
||||
ColorCycle.speed = ZOTAC_GPU_SPEED_NORMAL;
|
||||
ColorCycle.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(ColorCycle);
|
||||
|
||||
SetupZones();
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
|
||||
#include "ZotacTuringGPUController.h"
|
||||
|
||||
ZotacTuringGPUController::ZotacTuringGPUController(i2c_smbus_interface* bus, u8 dev)
|
||||
ZotacTuringGPUController::ZotacTuringGPUController(i2c_smbus_interface* bus, u8 dev, std::string dev_name)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->name = dev_name;
|
||||
}
|
||||
|
||||
ZotacTuringGPUController::~ZotacTuringGPUController()
|
||||
@@ -31,6 +32,11 @@ std::string ZotacTuringGPUController::GetDeviceLocation()
|
||||
return("I2C: " + return_string);
|
||||
}
|
||||
|
||||
std::string ZotacTuringGPUController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
void ZotacTuringGPUController::GetMode(RGBColor& color, int& mode, unsigned int& speed)
|
||||
{
|
||||
u8 rdata_pkt[I2C_SMBUS_BLOCK_MAX] = { 0x00 };
|
||||
|
||||
@@ -39,16 +39,18 @@ enum
|
||||
class ZotacTuringGPUController
|
||||
{
|
||||
public:
|
||||
ZotacTuringGPUController(i2c_smbus_interface* bus, u8 dev);
|
||||
ZotacTuringGPUController(i2c_smbus_interface* bus, u8 dev, std::string dev_name);
|
||||
~ZotacTuringGPUController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
|
||||
void GetMode(RGBColor& color, int& mode, unsigned int& speed);
|
||||
void SetMode(RGBColor color, int mode, unsigned int speed);
|
||||
void GetMode(RGBColor& color, int& mode, unsigned int& speed);
|
||||
void SetMode(RGBColor color, int mode, unsigned int speed);
|
||||
|
||||
private:
|
||||
i2c_smbus_interface* bus;
|
||||
u8 dev;
|
||||
i2c_smbus_interface* bus;
|
||||
u8 dev;
|
||||
std::string name;
|
||||
|
||||
};
|
||||
|
||||
@@ -51,9 +51,8 @@ void DetectZotacTuringGPUControllers(i2c_smbus_interface* bus, u8 i2c_addr, cons
|
||||
{
|
||||
if(TestForZotacTuringGPUController(bus, i2c_addr))
|
||||
{
|
||||
ZotacTuringGPUController* controller = new ZotacTuringGPUController(bus, i2c_addr);
|
||||
ZotacTuringGPUController* controller = new ZotacTuringGPUController(bus, i2c_addr, name);
|
||||
RGBController_ZotacTuringGPU* rgb_controller = new RGBController_ZotacTuringGPU(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user