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

This commit is contained in:
Adam Honse committed 2026-07-07 01:35:34 -05:00
1 parent 464ef419e7
commit fe4ca34528
203 files changed
+4754 -4576

No files matched your search

@@ -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);