1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
Artemis/Artemis/LightFX2Artemis/LightFxDevice.cpp
SpoinkyNL 3e9a86d893 Finalized LightFX C++ project
Implemented JSON serialization
Implemented pipe transmission
Made sure both x86 and x64 compile
2016-12-21 00:45:48 +01:00

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