2013-08-25 18:20:19 +02:00
|
|
|
|
|
|
|
// Bootsequence includes
|
|
|
|
#include <bootsequence/BootSequenceFactory.h>
|
|
|
|
|
|
|
|
// Local Bootsequence includes
|
|
|
|
#include "RainbowBootSequence.h"
|
2013-09-12 20:42:16 +02:00
|
|
|
#include "KittBootSequence.h"
|
2013-08-25 18:20:19 +02:00
|
|
|
|
|
|
|
BootSequence * BootSequenceFactory::createBootSequence(Hyperion * hyperion, const Json::Value & jsonConfig)
|
|
|
|
{
|
|
|
|
const std::string type = jsonConfig["type"].asString();
|
|
|
|
|
|
|
|
if (type == "none")
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
else if (type == "rainbow")
|
|
|
|
{
|
|
|
|
const unsigned duration_ms = jsonConfig["duration_ms"].asUInt();
|
|
|
|
return new RainbowBootSequence(hyperion, duration_ms);
|
|
|
|
}
|
|
|
|
else if (type == "knightrider")
|
|
|
|
{
|
2013-09-12 20:42:16 +02:00
|
|
|
const unsigned duration_ms = jsonConfig["duration_ms"].asUInt();
|
|
|
|
return new KittBootSequence(hyperion, duration_ms);
|
2013-08-25 18:20:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
std::cerr << "Unknown boot-sequence selected; boot-sequence disabled." << std::endl;
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|