Store name in NZXTKrakenController to avoid setting it in detector
This commit is contained in:
parent
d8c40cab6d
commit
3ab1519e25
4 changed files with 122 additions and 114 deletions
|
|
@ -32,10 +32,11 @@ static RGBColor ToLogoColor(RGBColor rgb)
|
|||
return ToRGBColor(RGBGetGValue(rgb), RGBGetRValue(rgb), RGBGetBValue(rgb));
|
||||
}
|
||||
|
||||
NZXTKrakenController::NZXTKrakenController(hid_device* dev_handle, const char* path)
|
||||
NZXTKrakenController::NZXTKrakenController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Get the firmware version |
|
||||
|
|
@ -58,6 +59,11 @@ std::string NZXTKrakenController::GetLocation()
|
|||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string NZXTKrakenController::GetName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string NZXTKrakenController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
|
|
|||
|
|
@ -51,11 +51,12 @@ enum
|
|||
class NZXTKrakenController
|
||||
{
|
||||
public:
|
||||
NZXTKrakenController(hid_device* dev_handle, const char* path);
|
||||
NZXTKrakenController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
~NZXTKrakenController();
|
||||
|
||||
std::string GetFirmwareVersion();
|
||||
std::string GetLocation();
|
||||
std::string GetName();
|
||||
std::string GetSerialString();
|
||||
|
||||
void UpdateEffect
|
||||
|
|
@ -89,6 +90,7 @@ private:
|
|||
std::string firmware_version;
|
||||
double liquid_temperature;
|
||||
std::string location;
|
||||
std::string name;
|
||||
unsigned int fan_speed;
|
||||
unsigned int pump_speed;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,11 +29,12 @@
|
|||
void DetectNZXTKrakenControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
if( dev )
|
||||
|
||||
if(dev)
|
||||
{
|
||||
NZXTKrakenController* controller = new NZXTKrakenController(dev, info->path);
|
||||
NZXTKrakenController* controller = new NZXTKrakenController(dev, info->path, name);
|
||||
RGBController_NZXTKraken* rgb_controller = new RGBController_NZXTKraken(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
} /* DetectNZXTKrakenControllers() */
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ RGBController_NZXTKraken::RGBController_NZXTKraken(NZXTKrakenController* control
|
|||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "NZXT Kraken X/M";
|
||||
name = controller->GetName();
|
||||
vendor = "NZXT";
|
||||
type = DEVICE_TYPE_COOLER;
|
||||
description = "NZXT Kraken X42/X52/X62/X72/M22";
|
||||
|
|
@ -197,7 +197,6 @@ RGBController_NZXTKraken::RGBController_NZXTKraken(NZXTKrakenController* control
|
|||
NZXT_KRAKEN_MODE_PULSE
|
||||
};
|
||||
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue