mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-21 21:47:54 -05:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "DetectionManager.h"
|
||||
#include "AlienwareController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_Alienware.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
@@ -22,17 +22,22 @@
|
||||
#define ALIENWARE_G_SERIES_PID1 0x0550
|
||||
#define ALIENWARE_G_SERIES_PID2 0x0551
|
||||
|
||||
void DetectAlienwareControllers(hid_device_info* info, const std::string& name)
|
||||
DetectedControllers DetectAlienwareControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AlienwareController* controller = new AlienwareController(dev, *info, name);
|
||||
RGBController_Alienware* rgb_controller = new RGBController_Alienware(controller);
|
||||
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR("Dell G Series LED Controller", DetectAlienwareControllers, ALIENWARE_VID, ALIENWARE_G_SERIES_PID1);
|
||||
|
||||
Reference in New Issue
Block a user