mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Implemented JSON serialization Implemented pipe transmission Made sure both x86 and x64 compile
34 lines
482 B
C++
34 lines
482 B
C++
#include "LightFxDevice.h"
|
|
using json = nlohmann::json;
|
|
|
|
|
|
LightFxDevice::LightFxDevice()
|
|
{
|
|
for (int i = 0; i < 6; i++)
|
|
{
|
|
Lights[i] = new LightFxLight();
|
|
}
|
|
}
|
|
|
|
|
|
LightFxDevice::~LightFxDevice()
|
|
{
|
|
}
|
|
|
|
void LightFxDevice::SetLightFromInt(int lightIndex, const unsigned colorVal)
|
|
{
|
|
Lights[lightIndex]->FromInt(colorVal);
|
|
}
|
|
|
|
json LightFxDevice::GetJson()
|
|
{
|
|
json j;
|
|
j["lights"] = {};
|
|
for (LightFxLight* light : Lights)
|
|
{
|
|
j["lights"].push_back(light->GetJson());
|
|
}
|
|
|
|
return j;
|
|
}
|