2013-10-16 18:13:31 +02:00
|
|
|
// stl includes
|
|
|
|
#include <cctype>
|
|
|
|
#include <algorithm>
|
2013-08-25 16:20:19 +00:00
|
|
|
|
|
|
|
// Bootsequence includes
|
|
|
|
#include <bootsequence/BootSequenceFactory.h>
|
|
|
|
|
2013-12-11 21:58:59 +01:00
|
|
|
// Effect engine includes
|
|
|
|
#include <effectengine/EffectEngine.h>
|
|
|
|
|
2013-08-25 16:20:19 +00:00
|
|
|
// Local Bootsequence includes
|
2013-12-01 16:35:45 +01:00
|
|
|
#include "EffectBootSequence.h"
|
2013-08-25 16:20:19 +00:00
|
|
|
|
|
|
|
BootSequence * BootSequenceFactory::createBootSequence(Hyperion * hyperion, const Json::Value & jsonConfig)
|
|
|
|
{
|
2013-12-11 21:58:59 +01:00
|
|
|
const std::string path = jsonConfig["path"].asString();
|
|
|
|
const std::string effectFile = jsonConfig["effect"].asString();
|
2013-12-01 16:35:45 +01:00
|
|
|
const unsigned duration = jsonConfig["duration_ms"].asUInt();
|
2013-12-11 21:58:59 +01:00
|
|
|
|
|
|
|
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;
|
2013-08-25 16:20:19 +00:00
|
|
|
}
|