Store name in InstantMouseController to avoid setting it in detector
This commit is contained in:
parent
d5f8e2cac9
commit
0bdf600409
4 changed files with 15 additions and 15 deletions
|
|
@ -13,12 +13,12 @@
|
|||
#include "InstantMouseController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
InstantMouseController::InstantMouseController(hid_device* dev_handle, const hid_device_info& info)
|
||||
InstantMouseController::InstantMouseController(hid_device* dev_handle, const hid_device_info& info, std::string dev_name)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = info.path;
|
||||
pid = info.product_id;
|
||||
version = "";
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
InstantMouseController::~InstantMouseController()
|
||||
|
|
@ -31,6 +31,11 @@ std::string InstantMouseController::GetDeviceLocation()
|
|||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string InstantMouseController::GetNameString()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string InstantMouseController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
|
@ -49,11 +54,6 @@ uint16_t InstantMouseController::GetPID()
|
|||
return pid;
|
||||
}
|
||||
|
||||
std::string InstantMouseController::GetFirmwareVersion()
|
||||
{
|
||||
return(version);
|
||||
}
|
||||
|
||||
void InstantMouseController::SendColor(RGBColor color)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
|
|
|
|||
|
|
@ -49,13 +49,13 @@ enum
|
|||
class InstantMouseController
|
||||
{
|
||||
public:
|
||||
InstantMouseController(hid_device* dev_handle, const hid_device_info& info);
|
||||
InstantMouseController(hid_device* dev_handle, const hid_device_info& info, std::string dev_name);
|
||||
~InstantMouseController();
|
||||
|
||||
std::string GetNameString();
|
||||
std::string GetSerialString();
|
||||
std::string GetDeviceLocation();
|
||||
uint16_t GetPID();
|
||||
std::string GetFirmwareVersion();
|
||||
|
||||
void SetMode(uint8_t mode_value, uint8_t speed, uint8_t brightness, uint8_t direction);
|
||||
void SendColor(RGBColor color);
|
||||
|
|
@ -63,6 +63,6 @@ public:
|
|||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string version;
|
||||
uint16_t pid;
|
||||
std::string name;
|
||||
uint16_t pid;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ void DetectInstantMouseControllers(hid_device_info* info, const std::string& nam
|
|||
|
||||
if(dev)
|
||||
{
|
||||
InstantMouseController* controller = new InstantMouseController(dev, *info);
|
||||
InstantMouseController* controller = new InstantMouseController(dev, *info, name);
|
||||
RGBController_InstantMouse* rgb_controller = new RGBController_InstantMouse(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,12 +29,12 @@
|
|||
RGBController_InstantMouse::RGBController_InstantMouse(InstantMouseController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
vendor = "Instant Microelectronics";
|
||||
|
||||
vendor = controller->GetNameString();
|
||||
type = DEVICE_TYPE_MOUSE;
|
||||
description = "Instant USB Gaming Mouse";
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
version = controller->GetFirmwareVersion();
|
||||
|
||||
mode direct;
|
||||
direct.name = "Direct";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue