diff --git a/Controllers/AlienwareMonitorController/AlienwareMonitorController.cpp b/Controllers/AlienwareMonitorController/AlienwareMonitorController.cpp index dea8e6ae..77984588 100644 --- a/Controllers/AlienwareMonitorController/AlienwareMonitorController.cpp +++ b/Controllers/AlienwareMonitorController/AlienwareMonitorController.cpp @@ -15,10 +15,11 @@ #include "AlienwareMonitorController.h" -AlienwareMonitorController::AlienwareMonitorController(hid_device *dev_handle, const char *path) +AlienwareMonitorController::AlienwareMonitorController(hid_device *dev_handle, const char *path, std::string dev_name) { dev = dev_handle; location = path; + name = dev_name; Initialize(); } @@ -33,6 +34,11 @@ std::string AlienwareMonitorController::GetLocation() return("HID: " + location); } +std::string AlienwareMonitorController::GetName() +{ + return(name); +} + std::string AlienwareMonitorController::GetSerialString() { return(""); diff --git a/Controllers/AlienwareMonitorController/AlienwareMonitorController.h b/Controllers/AlienwareMonitorController/AlienwareMonitorController.h index 4d1924e5..bb52d61c 100644 --- a/Controllers/AlienwareMonitorController/AlienwareMonitorController.h +++ b/Controllers/AlienwareMonitorController/AlienwareMonitorController.h @@ -18,16 +18,18 @@ class AlienwareMonitorController { public: -AlienwareMonitorController(hid_device* dev_handle, const char* path); +AlienwareMonitorController(hid_device* dev_handle, const char* path, std::string dev_name); ~AlienwareMonitorController(); std::string GetLocation(); + std::string GetName(); std::string GetSerialString(); void SendColor(unsigned char led_id, unsigned char r, unsigned char g, unsigned char b); private: hid_device* dev; std::string location; + std::string name; void Initialize(); }; diff --git a/Controllers/AlienwareMonitorController/AlienwareMonitorControllerDetect.cpp b/Controllers/AlienwareMonitorController/AlienwareMonitorControllerDetect.cpp index d6783103..64d04afa 100644 --- a/Controllers/AlienwareMonitorController/AlienwareMonitorControllerDetect.cpp +++ b/Controllers/AlienwareMonitorController/AlienwareMonitorControllerDetect.cpp @@ -42,8 +42,9 @@ void DetectAlienwareAW3423DWFControllers(hid_device_info* info, const std::strin hid_device* dev = hid_open_path(info->path); if(dev) { - AlienwareAW3423DWFController* controller = new AlienwareAW3423DWFController(dev, info->path); + AlienwareAW3423DWFController* controller = new AlienwareAW3423DWFController(dev, info->path); RGBController_AlienwareAW3423DWF* rgb_controller = new RGBController_AlienwareAW3423DWF(controller); + ResourceManager::get()->RegisterRGBController(rgb_controller); } } @@ -54,9 +55,8 @@ void DetectAlienwareMonitorControllers(hid_device_info* info, const std::string& if(dev) { - AlienwareMonitorController* controller = new AlienwareMonitorController(dev, info->path); + AlienwareMonitorController* controller = new AlienwareMonitorController(dev, info->path, name); RGBController_AlienwareMonitor* rgb_controller = new RGBController_AlienwareMonitor(controller); - rgb_controller->name = name; ResourceManager::get()->RegisterRGBController(rgb_controller); } diff --git a/Controllers/AlienwareMonitorController/RGBController_AlienwareMonitor.cpp b/Controllers/AlienwareMonitorController/RGBController_AlienwareMonitor.cpp index 041a729c..7add26d3 100644 --- a/Controllers/AlienwareMonitorController/RGBController_AlienwareMonitor.cpp +++ b/Controllers/AlienwareMonitorController/RGBController_AlienwareMonitor.cpp @@ -26,7 +26,7 @@ RGBController_AlienwareMonitor::RGBController_AlienwareMonitor(AlienwareMonitorC { controller = controller_ptr; - name = "Alienware Monitor"; + name = controller->GetName(); description = "Alienware Monitor"; vendor = "Alienware"; type = DEVICE_TYPE_MONITOR;