mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-06-04 20:14:33 -04:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -186,38 +186,40 @@ static const MSILaptopModel* GetMSILaptopModelDMI()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void DetectMSILaptop(hid_device_info* info, const std::string& name)
|
||||
DetectedControllers DetectMSILaptop(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
const MSILaptopModel* model = GetMSILaptopModelDMI();
|
||||
if(!model)
|
||||
DetectedControllers detected_controllers;
|
||||
const MSILaptopModel* model = GetMSILaptopModelDMI();
|
||||
|
||||
if(model)
|
||||
{
|
||||
return;
|
||||
msi_laptop_device device_type;
|
||||
|
||||
if(info->product_id == STEELSERIES_MSI_RAIDER_A18_KLC_PID)
|
||||
{
|
||||
device_type = MSI_LAPTOP_KLC;
|
||||
}
|
||||
else if(info->product_id == STEELSERIES_MSI_RAIDER_A18_ALC_PID)
|
||||
{
|
||||
device_type = MSI_LAPTOP_ALC;
|
||||
}
|
||||
else
|
||||
{
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
MSILaptopController* controller = new MSILaptopController(dev, info->path, name, device_type);
|
||||
RGBController_MSILaptop* rgb_controller = new RGBController_MSILaptop(controller, model);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
msi_laptop_device device_type;
|
||||
|
||||
if(info->product_id == STEELSERIES_MSI_RAIDER_A18_KLC_PID)
|
||||
{
|
||||
device_type = MSI_LAPTOP_KLC;
|
||||
}
|
||||
else if(info->product_id == STEELSERIES_MSI_RAIDER_A18_ALC_PID)
|
||||
{
|
||||
device_type = MSI_LAPTOP_ALC;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
MSILaptopController* controller = new MSILaptopController(dev, info->path, name, device_type);
|
||||
RGBController_MSILaptop* rgb_controller = new RGBController_MSILaptop(controller, model);
|
||||
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_I("MSI Laptop Keyboard", DetectMSILaptop, STEELSERIES_VID, STEELSERIES_MSI_RAIDER_A18_KLC_PID, 0);
|
||||
|
||||
Reference in New Issue
Block a user