mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2025-12-27 17:27:52 -05:00
Commit amended to undo change to device list management, still working through that merge request. Want to work this one in first. Changes by Adam Honse <calcprogrammer1@gmail.com>
34 lines
1.6 KiB
C++
34 lines
1.6 KiB
C++
#include "Detector.h"
|
|
#include "NZXTKrakenController.h"
|
|
#include "RGBController.h"
|
|
#include "RGBController_NZXTKraken.h"
|
|
#include <vector>
|
|
#include <hidapi/hidapi.h>
|
|
|
|
#define NZXT_KRAKEN_VID 0x1E71
|
|
#define NZXT_KRAKEN_X2_PID 0x170E
|
|
#define NZXT_KRAKEN_M2_PID 0x1715
|
|
|
|
/******************************************************************************************\
|
|
* *
|
|
* DetectNZXTKrakenControllers *
|
|
* *
|
|
* Detect devices supported by the NZXTKraken driver *
|
|
* *
|
|
\******************************************************************************************/
|
|
|
|
void DetectNZXTKrakenControllers(hid_device_info* info, const std::string& name)
|
|
{
|
|
hid_device* dev = hid_open_path(info->path);
|
|
if( dev )
|
|
{
|
|
NZXTKrakenController* controller = new NZXTKrakenController(dev, info->path);
|
|
RGBController_NZXTKraken* rgb_controller = new RGBController_NZXTKraken(controller);
|
|
rgb_controller->name = name;
|
|
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
|
}
|
|
} /* DetectNZXTKrakenControllers() */
|
|
|
|
REGISTER_HID_DETECTOR("NZXT Kraken X2", DetectNZXTKrakenControllers, NZXT_KRAKEN_VID, NZXT_KRAKEN_X2_PID);
|
|
REGISTER_HID_DETECTOR("NZXT Kraken M2", DetectNZXTKrakenControllers, NZXT_KRAKEN_VID, NZXT_KRAKEN_M2_PID);
|