mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-15 01:54:39 -04:00
Added ElgatoLightStrip Support
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#include "Detector.h"
|
||||
#include "ElgatoLightStripController.h"
|
||||
#include "RGBController_ElgatoLightStrip.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* Detect Elgato LightStrip devices *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectElgatoLightStripControllers()
|
||||
{
|
||||
json elgato_lightstrip_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get LightStrip settings from settings manager |
|
||||
\*-------------------------------------------------*/
|
||||
elgato_lightstrip_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("ElgatoLightStripDevices");
|
||||
|
||||
/*------------------------------------------------------------*\
|
||||
| If the Elgato Light Strip settings contains devices, process |
|
||||
\*------------------------------------------------------------*/
|
||||
if(elgato_lightstrip_settings.contains("devices"))
|
||||
{
|
||||
for(unsigned int device_idx = 0; device_idx < elgato_lightstrip_settings["devices"].size(); device_idx++)
|
||||
{
|
||||
if(elgato_lightstrip_settings["devices"][device_idx].contains("ip"))
|
||||
{
|
||||
std::string elgato_lightstrip_ip = elgato_lightstrip_settings["devices"][device_idx]["ip"];
|
||||
|
||||
ElgatoLightStripController* controller = new ElgatoLightStripController(elgato_lightstrip_ip);
|
||||
RGBController_ElgatoLightStrip* rgb_controller = new RGBController_ElgatoLightStrip(controller);
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
REGISTER_DETECTOR("Elgato Light Strip", DetectElgatoLightStripControllers);
|
||||
Reference in New Issue
Block a user