Added ability to define effect arguments for the bootsequence

Former-commit-id: b9827bb7af6c2cfdd8b1b0388d16541612b360d4
This commit is contained in:
Marc Dahlem 2014-05-06 18:36:34 +02:00
parent ef6aa76409
commit 106257181b
1 changed files with 21 additions and 4 deletions

View File

@ -113,6 +113,22 @@ int main(int argc, char** argv)
const unsigned duration_ms = effectConfig["duration_ms"].asUInt(); const unsigned duration_ms = effectConfig["duration_ms"].asUInt();
const int priority = 0; const int priority = 0;
if (effectConfig.isMember("args"))
{
const Json::Value effectConfigArgs = effectConfig["args"];
if (hyperion.setEffect(effectName, effectConfigArgs, priority, duration_ms) == 0)
{
std::cout << "Boot sequence(" << effectName << ") with user-defined arguments created and started" << std::endl;
}
else
{
std::cout << "Failed to start boot sequence: " << effectName << " with user-defined arguments" << std::endl;
}
}
else
{
if (hyperion.setEffect(effectName, priority, duration_ms) == 0) if (hyperion.setEffect(effectName, priority, duration_ms) == 0)
{ {
std::cout << "Boot sequence(" << effectName << ") created and started" << std::endl; std::cout << "Boot sequence(" << effectName << ") created and started" << std::endl;
@ -122,6 +138,7 @@ int main(int argc, char** argv)
std::cout << "Failed to start boot sequence: " << effectName << std::endl; std::cout << "Failed to start boot sequence: " << effectName << std::endl;
} }
} }
}
// create XBMC video checker if the configuration is present // create XBMC video checker if the configuration is present
XBMCVideoChecker * xbmcVideoChecker = nullptr; XBMCVideoChecker * xbmcVideoChecker = nullptr;