Store name in CoolerMasterControllers to avoid setting it in detectors

This commit is contained in:
Adam Honse 2025-08-15 16:16:06 -05:00
parent ddc8bc5885
commit 5db766cfa0
16 changed files with 78 additions and 59 deletions

View file

@ -14,10 +14,11 @@
#include "CMARGBGen2A1Controller.h" #include "CMARGBGen2A1Controller.h"
#include "StringUtils.h" #include "StringUtils.h"
CMARGBGen2A1controller::CMARGBGen2A1controller(hid_device* dev_handle, const hid_device_info& info) CMARGBGen2A1controller::CMARGBGen2A1controller(hid_device* dev_handle, const hid_device_info& info, std::string dev_name)
{ {
dev = dev_handle; dev = dev_handle;
location = info.path; location = info.path;
name = dev_name;
/*---------------------------------------------*\ /*---------------------------------------------*\
| Setup direct mode on start | | Setup direct mode on start |
@ -35,6 +36,11 @@ std::string CMARGBGen2A1controller::GetDeviceLocation()
return("HID: " + location); return("HID: " + location);
} }
std::string CMARGBGen2A1controller::GetNameString()
{
return(name);
}
std::string CMARGBGen2A1controller::GetSerialString() std::string CMARGBGen2A1controller::GetSerialString()
{ {
wchar_t serial_string[128]; wchar_t serial_string[128];

View file

@ -86,11 +86,12 @@ enum
class CMARGBGen2A1controller class CMARGBGen2A1controller
{ {
public: public:
CMARGBGen2A1controller(hid_device* dev_handle, const hid_device_info& info); CMARGBGen2A1controller(hid_device* dev_handle, const hid_device_info& info, std::string dev_name);
~CMARGBGen2A1controller(); ~CMARGBGen2A1controller();
std::string GetSerialString();
std::string GetDeviceLocation(); std::string GetDeviceLocation();
std::string GetNameString();
std::string GetSerialString();
void SendChannelColors(unsigned int zone_id, unsigned int subchannel_id, std::vector<RGBColor> colors); void SendChannelColors(unsigned int zone_id, unsigned int subchannel_id, std::vector<RGBColor> colors);
void SetupZoneSize(unsigned int zone_id, unsigned int size); void SetupZoneSize(unsigned int zone_id, unsigned int size);
@ -101,6 +102,7 @@ public:
private: private:
std::string location; std::string location;
std::string name;
bool software_mode_activated = false; bool software_mode_activated = false;
hid_device* dev; hid_device* dev;

View file

@ -35,13 +35,13 @@
RGBController_CMARGBGen2A1Controller::RGBController_CMARGBGen2A1Controller(CMARGBGen2A1controller* controller_ptr) RGBController_CMARGBGen2A1Controller::RGBController_CMARGBGen2A1Controller(CMARGBGen2A1controller* controller_ptr)
{ {
controller = controller_ptr; controller = controller_ptr;
name = "CoolerMaster LED Controller A1";
name = controller->GetNameString();
vendor = "CoolerMaster"; vendor = "CoolerMaster";
type = DEVICE_TYPE_LEDSTRIP; type = DEVICE_TYPE_LEDSTRIP;
description = name; description = "CoolerMaster LED Controller A1 Device";
location = controller->GetDeviceLocation(); location = controller->GetDeviceLocation();
serial = controller->GetSerialString(); serial = controller->GetSerialString();
version = "";
mode Direct; mode Direct;
Direct.name = "Direct"; Direct.name = "Direct";
@ -155,16 +155,16 @@ RGBController_CMARGBGen2A1Controller::RGBController_CMARGBGen2A1Controller(CMARG
modes.push_back(FillFlow); modes.push_back(FillFlow);
mode Rainbow; mode Rainbow;
Rainbow.name = "Rainbow"; Rainbow.name = "Rainbow";
Rainbow.value = CM_ARGB_GEN2_A1_RAINBOW_MODE; Rainbow.value = CM_ARGB_GEN2_A1_RAINBOW_MODE;
Rainbow.flags = MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE;; Rainbow.flags = MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE;;
Rainbow.color_mode = MODE_COLORS_NONE; Rainbow.color_mode = MODE_COLORS_NONE;
Rainbow.brightness = CM_ARGB_GEN2_A1_BRIGHTNESS_MAX; Rainbow.brightness = CM_ARGB_GEN2_A1_BRIGHTNESS_MAX;
Rainbow.brightness_min = CM_ARGB_GEN2_A1_BRIGHTNESS_MIN; Rainbow.brightness_min = CM_ARGB_GEN2_A1_BRIGHTNESS_MIN;
Rainbow.brightness_max = CM_ARGB_GEN2_A1_BRIGHTNESS_MAX; Rainbow.brightness_max = CM_ARGB_GEN2_A1_BRIGHTNESS_MAX;
Rainbow.speed = CM_ARGB_GEN2_A1_SPEED_MAX/2; Rainbow.speed = CM_ARGB_GEN2_A1_SPEED_MAX/2;
Rainbow.speed_min = CM_ARGB_GEN2_A1_SPEED_MIN; Rainbow.speed_min = CM_ARGB_GEN2_A1_SPEED_MIN;
Rainbow.speed_max = CM_ARGB_GEN2_A1_SPEED_MAX; Rainbow.speed_max = CM_ARGB_GEN2_A1_SPEED_MAX;
modes.push_back(Rainbow); modes.push_back(Rainbow);
mode Custom; mode Custom;

View file

@ -12,20 +12,20 @@
#include "CMKeyboardAbstractController.h" #include "CMKeyboardAbstractController.h"
#include "StringUtils.h" #include "StringUtils.h"
CMKeyboardAbstractController::CMKeyboardAbstractController(hid_device* dev_handle, hid_device_info* dev_info) CMKeyboardAbstractController::CMKeyboardAbstractController(hid_device* dev_handle, hid_device_info* dev_info, std::string dev_name)
{ {
wchar_t tmp[HID_MAX_STR]; wchar_t tmp[HID_MAX_STR];
m_pDev = dev_handle; m_pDev = dev_handle;
m_productId = dev_info->product_id; m_productId = dev_info->product_id;
m_sLocation = dev_info->path; m_sLocation = dev_info->path;
m_deviceName = dev_name;
hid_get_manufacturer_string(m_pDev, tmp, HID_MAX_STR); hid_get_manufacturer_string(m_pDev, tmp, HID_MAX_STR);
m_vendorName = StringUtils::wstring_to_string(tmp); m_vendorName = StringUtils::wstring_to_string(tmp);
hid_get_product_string(m_pDev, tmp, HID_MAX_STR); hid_get_product_string(m_pDev, tmp, HID_MAX_STR);
m_deviceName = StringUtils::wstring_to_string(tmp); m_serialNumber = StringUtils::wstring_to_string(tmp);
m_serialNumber = m_deviceName;
bool bNotFound = true; bool bNotFound = true;
@ -55,11 +55,6 @@ std::string CMKeyboardAbstractController::GetDeviceName()
return(m_deviceName); return(m_deviceName);
} }
void CMKeyboardAbstractController::SetDeviceName(std::string name)
{
m_deviceName = name;
}
std::string CMKeyboardAbstractController::GetDeviceVendor() std::string CMKeyboardAbstractController::GetDeviceVendor()
{ {
return(m_vendorName); return(m_vendorName);

View file

@ -56,7 +56,7 @@ enum cm_keyboard_control_mode
class CMKeyboardAbstractController class CMKeyboardAbstractController
{ {
public: public:
CMKeyboardAbstractController(hid_device* dev_handle, hid_device_info* dev_info); CMKeyboardAbstractController(hid_device* dev_handle, hid_device_info* dev_info, std::string dev_name);
virtual ~CMKeyboardAbstractController(); virtual ~CMKeyboardAbstractController();
/*---------------------------------------------------------*\ /*---------------------------------------------------------*\
@ -64,7 +64,6 @@ public:
\*---------------------------------------------------------*/ \*---------------------------------------------------------*/
int GetProductID(); int GetProductID();
std::string GetDeviceName(); std::string GetDeviceName();
void SetDeviceName(std::string name);
std::string GetDeviceVendor(); std::string GetDeviceVendor();
std::string GetDeviceSerial(); std::string GetDeviceSerial();
std::string GetLocation(); std::string GetLocation();

View file

@ -13,7 +13,7 @@
#include "CMKeyboardV1Controller.h" #include "CMKeyboardV1Controller.h"
#include "LogManager.h" #include "LogManager.h"
CMKeyboardV1Controller::CMKeyboardV1Controller(hid_device* dev_handle, hid_device_info* dev_info) : CMKeyboardAbstractController(dev_handle, dev_info) CMKeyboardV1Controller::CMKeyboardV1Controller(hid_device* dev_handle, hid_device_info* dev_info, std::string dev_name) : CMKeyboardAbstractController(dev_handle, dev_info, dev_name)
{ {
m_sFirmwareVersion = _GetFirmwareVersion(); m_sFirmwareVersion = _GetFirmwareVersion();
} }

View file

@ -16,7 +16,7 @@
class CMKeyboardV1Controller : public CMKeyboardAbstractController class CMKeyboardV1Controller : public CMKeyboardAbstractController
{ {
public: public:
CMKeyboardV1Controller(hid_device* dev_handle, hid_device_info* dev_info); CMKeyboardV1Controller(hid_device* dev_handle, hid_device_info* dev_info, std::string dev_name);
~CMKeyboardV1Controller(); ~CMKeyboardV1Controller();
/*---------------------------------------------------------*\ /*---------------------------------------------------------*\

View file

@ -16,7 +16,7 @@
#include "LogManager.h" #include "LogManager.h"
#include "StringUtils.h" #include "StringUtils.h"
CMKeyboardV2Controller::CMKeyboardV2Controller(hid_device* dev_handle, hid_device_info* dev_info) : CMKeyboardAbstractController(dev_handle, dev_info) CMKeyboardV2Controller::CMKeyboardV2Controller(hid_device* dev_handle, hid_device_info* dev_info, std::string dev_name) : CMKeyboardAbstractController(dev_handle, dev_info, dev_name)
{ {
m_sFirmwareVersion = _GetFirmwareVersion(); m_sFirmwareVersion = _GetFirmwareVersion();
m_bMoreFFs = false; m_bMoreFFs = false;

View file

@ -30,7 +30,7 @@ struct stCMKeyboardV2_mode
class CMKeyboardV2Controller : public CMKeyboardAbstractController class CMKeyboardV2Controller : public CMKeyboardAbstractController
{ {
public: public:
CMKeyboardV2Controller(hid_device* dev_handle, hid_device_info* dev_info); CMKeyboardV2Controller(hid_device* dev_handle, hid_device_info* dev_info, std::string dev_name);
~CMKeyboardV2Controller(); ~CMKeyboardV2Controller();
/*---------------------------------------------------------*\ /*---------------------------------------------------------*\

View file

@ -14,11 +14,13 @@
#include "CMMMController.h" #include "CMMMController.h"
#include "StringUtils.h" #include "StringUtils.h"
CMMMController::CMMMController(hid_device* dev_handle, char *_path, uint16_t pid) : product_id(pid) CMMMController::CMMMController(hid_device* dev_handle, char *_path, uint16_t pid, std::string dev_name)
{ {
dev = dev_handle; dev = dev_handle;
location = _path; location = _path;
name = dev_name;
current_speed = CM_MM_SPEED_3; current_speed = CM_MM_SPEED_3;
product_id = pid;
if(product_id == CM_MM530_PID || product_id == CM_MM531_PID) if(product_id == CM_MM530_PID || product_id == CM_MM531_PID)
{ {
@ -144,6 +146,11 @@ std::string CMMMController::GetLocation()
return("HID: " + location); return("HID: " + location);
} }
std::string CMMMController::GetName()
{
return(name);
}
uint16_t CMMMController::GetProductID() uint16_t CMMMController::GetProductID()
{ {
return product_id; return product_id;

View file

@ -89,12 +89,13 @@ enum
class CMMMController class CMMMController
{ {
public: public:
CMMMController(hid_device* dev_handle, char *_path, uint16_t pid); CMMMController(hid_device* dev_handle, char *_path, uint16_t pid, std::string dev_name);
~CMMMController(); ~CMMMController();
std::string GetDeviceVendor(); std::string GetDeviceVendor();
std::string GetSerial(); std::string GetSerial();
std::string GetLocation(); std::string GetLocation();
std::string GetName();
uint16_t GetProductID(); uint16_t GetProductID();

View file

@ -29,10 +29,10 @@ RGBController_CMMMController::RGBController_CMMMController(CMMMController* contr
{ {
controller = controller_ptr; controller = controller_ptr;
name = "Cooler Master MasterMouse"; name = controller->GetName();
vendor = controller->GetDeviceVendor(); vendor = controller->GetDeviceVendor();
type = DEVICE_TYPE_MOUSE; type = DEVICE_TYPE_MOUSE;
description = "Cooler Master MasterMouse"; description = "Cooler Master MasterMouse Device";
serial = controller->GetSerial(); serial = controller->GetSerial();
location = controller->GetLocation(); location = controller->GetLocation();

View file

@ -15,10 +15,11 @@
using namespace std::chrono_literals; using namespace std::chrono_literals;
CMMonitorController::CMMonitorController(hid_device* dev_handle, const hid_device_info& info) CMMonitorController::CMMonitorController(hid_device* dev_handle, const hid_device_info& info, std::string dev_name)
{ {
dev = dev_handle; dev = dev_handle;
location = info.path; location = info.path;
name = dev_name;
} }
CMMonitorController::~CMMonitorController() CMMonitorController::~CMMonitorController()
@ -31,6 +32,11 @@ std::string CMMonitorController::GetDeviceLocation()
return("HID: " + location); return("HID: " + location);
} }
std::string CMMonitorController::GetNameString()
{
return(name);
}
std::string CMMonitorController::GetSerialString() std::string CMMonitorController::GetSerialString()
{ {
wchar_t serial_string[128]; wchar_t serial_string[128];

View file

@ -41,17 +41,20 @@ enum
class CMMonitorController class CMMonitorController
{ {
public: public:
CMMonitorController(hid_device* dev_handle, const hid_device_info& info); CMMonitorController(hid_device* dev_handle, const hid_device_info& info, std::string dev_name);
~CMMonitorController(); ~CMMonitorController();
std::string GetSerialString();
std::string GetDeviceLocation(); std::string GetDeviceLocation();
std::string GetNameString();
std::string GetSerialString();
void SendDirect(const std::vector<RGBColor>& colors); void SendDirect(const std::vector<RGBColor>& colors);
void SetMode(uint8_t mode_value, const RGBColor& color, uint8_t speed, uint8_t brightness); void SetMode(uint8_t mode_value, const RGBColor& color, uint8_t speed, uint8_t brightness);
void SetCustomMode(const std::vector<RGBColor>& colors, uint8_t brightnesss); void SetCustomMode(const std::vector<RGBColor>& colors, uint8_t brightnesss);
private: private:
std::string location; std::string location;
std::string name;
hid_device* dev; hid_device* dev;
bool software_mode_enabled = false; bool software_mode_enabled = false;
void SetSoftwareModeEnabled(bool value); void SetSoftwareModeEnabled(bool value);

View file

@ -27,13 +27,13 @@
RGBController_CMMonitorController::RGBController_CMMonitorController(CMMonitorController* controller_ptr) RGBController_CMMonitorController::RGBController_CMMonitorController(CMMonitorController* controller_ptr)
{ {
controller = controller_ptr; controller = controller_ptr;
name = "CoolerMaster LED Controller A1";
name = controller->GetNameString();
vendor = "CoolerMaster"; vendor = "CoolerMaster";
type = DEVICE_TYPE_MONITOR; type = DEVICE_TYPE_MONITOR;
description = name; description = "CoolerMaster Monitor Device";
location = controller->GetDeviceLocation(); location = controller->GetDeviceLocation();
serial = controller->GetSerialString(); serial = controller->GetSerialString();
version = "";
mode Direct; mode Direct;
Direct.name = "Direct"; Direct.name = "Direct";

View file

@ -100,7 +100,7 @@ void DetectCoolerMasterARGB(hid_device_info* info, const std::string&)
{ {
CMARGBController* controller = new CMARGBController(dev, info->path, i, cm_mutex); CMARGBController* controller = new CMARGBController(dev, info->path, i, cm_mutex);
RGBController_CMARGBController* rgb_controller = new RGBController_CMARGBController(controller); RGBController_CMARGBController* rgb_controller = new RGBController_CMARGBController(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller); ResourceManager::get()->RegisterRGBController(rgb_controller);
} }
} }
@ -112,9 +112,9 @@ void DetectCoolerMasterARGBGen2A1(hid_device_info* info, const std::string& name
if(dev) if(dev)
{ {
CMARGBGen2A1controller* controller = new CMARGBGen2A1controller(dev, *info); CMARGBGen2A1controller* controller = new CMARGBGen2A1controller(dev, *info, name);
RGBController_CMARGBGen2A1Controller* rgb_controller = new RGBController_CMARGBGen2A1Controller(controller); RGBController_CMARGBGen2A1Controller* rgb_controller = new RGBController_CMARGBGen2A1Controller(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller); ResourceManager::get()->RegisterRGBController(rgb_controller);
} }
} }
@ -127,7 +127,7 @@ void DetectCoolerMasterGPU(hid_device_info* info, const std::string&)
{ {
CMR6000Controller* controller = new CMR6000Controller(dev, info->path, info->product_id); CMR6000Controller* controller = new CMR6000Controller(dev, info->path, info->product_id);
RGBController_CMR6000Controller* rgb_controller = new RGBController_CMR6000Controller(controller); RGBController_CMR6000Controller* rgb_controller = new RGBController_CMR6000Controller(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller); ResourceManager::get()->RegisterRGBController(rgb_controller);
} }
} }
@ -144,9 +144,9 @@ void DetectCoolerMasterV1Keyboards(hid_device_info* info, const std::string& nam
case COOLERMASTER_KEYBOARD_PRO_L_WHITE_PID: case COOLERMASTER_KEYBOARD_PRO_L_WHITE_PID:
case COOLERMASTER_KEYBOARD_PRO_S_PID: case COOLERMASTER_KEYBOARD_PRO_S_PID:
{ {
CMKeyboardV1Controller* controller = new CMKeyboardV1Controller(dev, info); CMKeyboardV1Controller* controller = new CMKeyboardV1Controller(dev, info, name);
controller->SetDeviceName(name);
RGBController_CMKeyboardController* rgb_controller = new RGBController_CMKeyboardController(controller); RGBController_CMKeyboardController* rgb_controller = new RGBController_CMKeyboardController(controller);
ResourceManager::get()->RegisterRGBController(rgb_controller); ResourceManager::get()->RegisterRGBController(rgb_controller);
} }
break; break;
@ -170,9 +170,9 @@ void DetectCoolerMasterV2Keyboards(hid_device_info* info, const std::string& nam
case COOLERMASTER_KEYBOARD_PRO_L_WHITE_PID: case COOLERMASTER_KEYBOARD_PRO_L_WHITE_PID:
case COOLERMASTER_KEYBOARD_PRO_S_PID: case COOLERMASTER_KEYBOARD_PRO_S_PID:
{ {
CMKeyboardV1Controller* controller = new CMKeyboardV1Controller(dev, info); CMKeyboardV1Controller* controller = new CMKeyboardV1Controller(dev, info, name);
controller->SetDeviceName(name);
RGBController_CMKeyboardController* rgb_controller = new RGBController_CMKeyboardController(controller); RGBController_CMKeyboardController* rgb_controller = new RGBController_CMKeyboardController(controller);
ResourceManager::get()->RegisterRGBController(rgb_controller); ResourceManager::get()->RegisterRGBController(rgb_controller);
} }
break; break;
@ -190,9 +190,9 @@ void DetectCoolerMasterV2Keyboards(hid_device_info* info, const std::string& nam
case COOLERMASTER_KEYBOARD_MK730_PID: case COOLERMASTER_KEYBOARD_MK730_PID:
case COOLERMASTER_KEYBOARD_MK750_PID: case COOLERMASTER_KEYBOARD_MK750_PID:
{ {
CMKeyboardV2Controller* controller = new CMKeyboardV2Controller(dev, info); CMKeyboardV2Controller* controller = new CMKeyboardV2Controller(dev, info, name);
controller->SetDeviceName(name);
RGBController_CMKeyboardController* rgb_controller = new RGBController_CMKeyboardController(controller); RGBController_CMKeyboardController* rgb_controller = new RGBController_CMKeyboardController(controller);
ResourceManager::get()->RegisterRGBController(rgb_controller); ResourceManager::get()->RegisterRGBController(rgb_controller);
} }
break; break;
@ -210,9 +210,9 @@ void DetectCoolerMasterMouse(hid_device_info* info, const std::string& name)
if(dev) if(dev)
{ {
CMMMController* controller = new CMMMController(dev, info->path, info->product_id); CMMMController* controller = new CMMMController(dev, info->path, info->product_id, name);
RGBController_CMMMController* rgb_controller = new RGBController_CMMMController(controller); RGBController_CMMMController* rgb_controller = new RGBController_CMMMController(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller); ResourceManager::get()->RegisterRGBController(rgb_controller);
} }
} }
@ -225,7 +225,7 @@ void DetectCoolerMasterMouse711(hid_device_info* info, const std::string& /*name
{ {
CMMM711Controller* controller = new CMMM711Controller(dev, info->path); CMMM711Controller* controller = new CMMM711Controller(dev, info->path);
RGBController_CMMM711Controller* rgb_controller = new RGBController_CMMM711Controller(controller); RGBController_CMMM711Controller* rgb_controller = new RGBController_CMMM711Controller(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller); ResourceManager::get()->RegisterRGBController(rgb_controller);
} }
} }
@ -238,7 +238,7 @@ void DetectCoolerMasterMouse712(hid_device_info* info, const std::string& /*name
{ {
CMMM712Controller* controller = new CMMM712Controller(dev, info->path); CMMM712Controller* controller = new CMMM712Controller(dev, info->path);
RGBController_CMMM712Controller* rgb_controller = new RGBController_CMMM712Controller(controller); RGBController_CMMM712Controller* rgb_controller = new RGBController_CMMM712Controller(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller); ResourceManager::get()->RegisterRGBController(rgb_controller);
} }
} }
@ -251,7 +251,7 @@ void DetectCoolerMasterMousemats(hid_device_info* info, const std::string& /*nam
{ {
CMMP750Controller* controller = new CMMP750Controller(dev, info->path); CMMP750Controller* controller = new CMMP750Controller(dev, info->path);
RGBController_CMMP750Controller* rgb_controller = new RGBController_CMMP750Controller(controller); RGBController_CMMP750Controller* rgb_controller = new RGBController_CMMP750Controller(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller); ResourceManager::get()->RegisterRGBController(rgb_controller);
} }
} }
@ -264,7 +264,7 @@ void DetectCoolerMasterRGB(hid_device_info* info, const std::string& /*name*/)
{ {
CMRGBController* controller = new CMRGBController(dev, info->path); CMRGBController* controller = new CMRGBController(dev, info->path);
RGBController_CMRGBController* rgb_controller = new RGBController_CMRGBController(controller); RGBController_CMRGBController* rgb_controller = new RGBController_CMRGBController(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller); ResourceManager::get()->RegisterRGBController(rgb_controller);
} }
} }
@ -277,7 +277,7 @@ void DetectCoolerMasterSmallARGB(hid_device_info* info, const std::string& /*nam
{ {
CMSmallARGBController* controller = new CMSmallARGBController(dev, info->path, 0); CMSmallARGBController* controller = new CMSmallARGBController(dev, info->path, 0);
RGBController_CMSmallARGBController* rgb_controller = new RGBController_CMSmallARGBController(controller); RGBController_CMSmallARGBController* rgb_controller = new RGBController_CMSmallARGBController(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller); ResourceManager::get()->RegisterRGBController(rgb_controller);
} }
} }
@ -288,9 +288,9 @@ void DetectCoolerMasterMonitor(hid_device_info* info, const std::string& name)
if(dev) if(dev)
{ {
CMMonitorController* controller = new CMMonitorController(dev, *info); CMMonitorController* controller = new CMMonitorController(dev, *info, name);
RGBController_CMMonitorController* rgb_controller = new RGBController_CMMonitorController(controller); RGBController_CMMonitorController* rgb_controller = new RGBController_CMMonitorController(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller); ResourceManager::get()->RegisterRGBController(rgb_controller);
} }
} }