mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-25 23:47:56 -05:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user