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 1ccaadd5d0
commit 9bb2a4e693
197 changed files with 4481 additions and 4332 deletions

View File

@@ -13,21 +13,27 @@
#include "ElgatoStreamDeckController.h"
#include "RGBController_ElgatoStreamDeck.h"
#define ELGATO_VID 0x0FD9
#define STREAMDECK_MK2_PID 0x0080
#define ELGATO_VID 0x0FD9
#define STREAMDECK_MK2_PID 0x0080
void DetectElgatoStreamDeckControllers(hid_device_info* info, const std::string&)
DetectedControllers DetectElgatoStreamDeckControllers(hid_device_info* info, const std::string&)
{
DetectedControllers detected_controllers;
if(info->interface_number == 0)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
ElgatoStreamDeckController* controller = new ElgatoStreamDeckController(dev, info->path);
ElgatoStreamDeckController* controller = new ElgatoStreamDeckController(dev, info->path);
RGBController_ElgatoStreamDeck* rgb_controller = new RGBController_ElgatoStreamDeck(controller);
DetectionManager::get()->RegisterRGBController(rgb_controller);
detected_controllers.push_back(rgb_controller);
}
}
return(detected_controllers);
}
REGISTER_HID_DETECTOR("Elgato Stream Deck MK.2", DetectElgatoStreamDeckControllers, ELGATO_VID, STREAMDECK_MK2_PID);