hyperion.ng/libsrc/bootsequence/BootSequenceFactory.cpp
johan 0537fdc741 Moved effect configurations from the config file to effect directory
Former-commit-id: b8db13f25b93a0007adf613f0310a1cfbb6b8224
2013-12-11 21:58:59 +01:00

29 lines
798 B
C++

// stl includes
#include <cctype>
#include <algorithm>
// Bootsequence includes
#include <bootsequence/BootSequenceFactory.h>
// Effect engine includes
#include <effectengine/EffectEngine.h>
// Local Bootsequence includes
#include "EffectBootSequence.h"
BootSequence * BootSequenceFactory::createBootSequence(Hyperion * hyperion, const Json::Value & jsonConfig)
{
const std::string path = jsonConfig["path"].asString();
const std::string effectFile = jsonConfig["effect"].asString();
const unsigned duration = jsonConfig["duration_ms"].asUInt();
EffectDefinition effect;
if (EffectEngine::loadEffectDefinition(path, effectFile, effect))
{
return new EffectBootSequence(hyperion, effect, duration);
}
std::cerr << "Boot sequence could not be loaded" << std::endl;
return nullptr;
}