Store name in CreativeSoundBlasterXG6Controller to avoid setting it in detector
This commit is contained in:
parent
31ec06b576
commit
dc0103a155
4 changed files with 13 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue