diff --git a/Controllers/CreativeController/CreativeControllerDetect.cpp b/Controllers/CreativeController/CreativeControllerDetect.cpp index b0f82f24..26bdbd18 100644 --- a/Controllers/CreativeController/CreativeControllerDetect.cpp +++ b/Controllers/CreativeController/CreativeControllerDetect.cpp @@ -27,9 +27,9 @@ void DetectCreativeDevice(hid_device_info* info, const std::string& name) if(dev) { - CreativeSoundBlasterXG6Controller* controller = new CreativeSoundBlasterXG6Controller(dev, info->path); + CreativeSoundBlasterXG6Controller* controller = new CreativeSoundBlasterXG6Controller(dev, info->path, name); RGBController_CreativeSoundBlasterXG6* rgb_controller = new RGBController_CreativeSoundBlasterXG6(controller); - rgb_controller->name = name; + ResourceManager::get()->RegisterRGBController(rgb_controller); } } diff --git a/Controllers/CreativeController/CreativeSoundBlasterXG6Controller.cpp b/Controllers/CreativeController/CreativeSoundBlasterXG6Controller.cpp index 9cb449c7..6db11fbb 100644 --- a/Controllers/CreativeController/CreativeSoundBlasterXG6Controller.cpp +++ b/Controllers/CreativeController/CreativeSoundBlasterXG6Controller.cpp @@ -9,10 +9,11 @@ #include "CreativeSoundBlasterXG6Controller.h" -CreativeSoundBlasterXG6Controller::CreativeSoundBlasterXG6Controller(hid_device* dev_handle, const char* path) +CreativeSoundBlasterXG6Controller::CreativeSoundBlasterXG6Controller(hid_device* dev_handle, const char* path, std::string dev_name) { dev = dev_handle; location = path; + name = dev_name; } CreativeSoundBlasterXG6Controller::~CreativeSoundBlasterXG6Controller() @@ -25,6 +26,11 @@ std::string CreativeSoundBlasterXG6Controller::GetDeviceLocation() return("HID " + location); } +std::string CreativeSoundBlasterXG6Controller::GetDeviceName() +{ + return(name); +} + void CreativeSoundBlasterXG6Controller::SetLedColor (unsigned char red, unsigned char green, unsigned char blue, diff --git a/Controllers/CreativeController/CreativeSoundBlasterXG6Controller.h b/Controllers/CreativeController/CreativeSoundBlasterXG6Controller.h index 07f5c07a..b3b7db84 100644 --- a/Controllers/CreativeController/CreativeSoundBlasterXG6Controller.h +++ b/Controllers/CreativeController/CreativeSoundBlasterXG6Controller.h @@ -16,7 +16,7 @@ class CreativeSoundBlasterXG6Controller { public: - CreativeSoundBlasterXG6Controller(hid_device* dev_handle, const char* path); + CreativeSoundBlasterXG6Controller(hid_device* dev_handle, const char* path, std::string dev_name); ~CreativeSoundBlasterXG6Controller(); void SetLedColor(unsigned char red, @@ -25,9 +25,11 @@ public: unsigned char brightness); std::string GetDeviceLocation(); + std::string GetDeviceName(); std::string GetSerialString(); private: hid_device* dev; std::string location; + std::string name; }; diff --git a/Controllers/CreativeController/RGBController_CreativeSoundBlasterXG6.cpp b/Controllers/CreativeController/RGBController_CreativeSoundBlasterXG6.cpp index e18b2338..8a4ab5c8 100644 --- a/Controllers/CreativeController/RGBController_CreativeSoundBlasterXG6.cpp +++ b/Controllers/CreativeController/RGBController_CreativeSoundBlasterXG6.cpp @@ -24,7 +24,7 @@ RGBController_CreativeSoundBlasterXG6::RGBController_CreativeSoundBlasterXG6(Cre { controller = controller_ptr; - name = "Creative SoundBlasterX G6 Device"; + name = controller->GetDeviceName(); vendor = "Creative"; type = DEVICE_TYPE_HEADSET; description = "Creative SoundBlasterX G6 Device";