Store name in ZalmanZSyncController to avoid setting it in detector
This commit is contained in:
parent
84c24e70c0
commit
4e96056ac4
4 changed files with 116 additions and 109 deletions
|
|
@ -26,7 +26,7 @@ RGBController_ZalmanZSync::RGBController_ZalmanZSync(ZalmanZSyncController* cont
|
|||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "Zalman Z Sync Device";
|
||||
name = controller->GetNameString();
|
||||
vendor = "Zalman";
|
||||
description = "Zalman Z Sync Device";
|
||||
type = DEVICE_TYPE_LEDSTRIP;
|
||||
|
|
|
|||
|
|
@ -22,10 +22,11 @@
|
|||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
ZalmanZSyncController::ZalmanZSyncController(hid_device* dev_handle, const char* path)
|
||||
ZalmanZSyncController::ZalmanZSyncController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
|
||||
SendFirmwareRequest();
|
||||
|
||||
|
|
@ -70,6 +71,11 @@ std::string ZalmanZSyncController::GetLocationString()
|
|||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string ZalmanZSyncController::GetNameString()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string ZalmanZSyncController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
|
|
|||
|
|
@ -94,11 +94,12 @@ enum
|
|||
class ZalmanZSyncController
|
||||
{
|
||||
public:
|
||||
ZalmanZSyncController(hid_device* dev_handle, const char* path);
|
||||
ZalmanZSyncController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
~ZalmanZSyncController();
|
||||
|
||||
std::string GetFirmwareString();
|
||||
std::string GetLocationString();
|
||||
std::string GetNameString();
|
||||
std::string GetSerialString();
|
||||
|
||||
unsigned int GetStripsOnChannel(unsigned int channel);
|
||||
|
|
@ -128,6 +129,7 @@ private:
|
|||
hid_device* dev;
|
||||
std::string firmware_version;
|
||||
std::string location;
|
||||
std::string name;
|
||||
std::thread* keepalive_thread;
|
||||
std::atomic<bool> keepalive_thread_run;
|
||||
std::chrono::time_point<std::chrono::steady_clock> last_commit_time;
|
||||
|
|
|
|||
|
|
@ -31,9 +31,8 @@ void DetectZalmanZSyncControllers(hid_device_info* info, const std::string& name
|
|||
|
||||
if(dev)
|
||||
{
|
||||
ZalmanZSyncController* controller = new ZalmanZSyncController(dev, info->path);
|
||||
ZalmanZSyncController* controller = new ZalmanZSyncController(dev, info->path, name);
|
||||
RGBController_ZalmanZSync* rgb_controller = new RGBController_ZalmanZSync(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue