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

This commit is contained in:
Adam Honse committed 2026-05-07 17:24:45 -05:00
1 parent f6f317d487
commit 52f0049025
196 files changed
+4467 -4302

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