Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions

This commit is contained in:
Adam Honse
2026-01-12 19:05:21 -06:00
parent 04123aa969
commit 03f0977205
196 changed files with 4471 additions and 4333 deletions

View File

@@ -9,29 +9,35 @@
#include <hidapi.h>
#include "CreativeSoundBlasterXG6Controller.h"
#include "RGBController_CreativeSoundBlasterXG6.h"
#include "DetectionManager.h"
#include "RGBController_CreativeSoundBlasterXG6.h"
/*-----------------------------------------------------*\
| Creative vendor ID |
\*-----------------------------------------------------*/
/*---------------------------------------------------------*\
| Creative vendor ID |
\*---------------------------------------------------------*/
#define CREATIVE_VID 0x041E
/*-----------------------------------------------------*\
| SoundCards |
\*-----------------------------------------------------*/
/*---------------------------------------------------------*\
| SoundCards |
\*---------------------------------------------------------*/
#define CREATIVE_SOUNDBLASTERX_G6_PID 0x3256
void DetectCreativeDevice(hid_device_info* info, const std::string& name)
DetectedControllers DetectCreativeDevice(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)
{
CreativeSoundBlasterXG6Controller* controller = new CreativeSoundBlasterXG6Controller(dev, info->path, name);
RGBController_CreativeSoundBlasterXG6* rgb_controller = new RGBController_CreativeSoundBlasterXG6(controller);
DetectionManager::get()->RegisterRGBController(rgb_controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
/*-------------------------------------------------------------------------------------------------------------------------------------------------*\