mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Merge pull request #100 from MarcDahlem/master
Added ability to define effect arguments for the bootsequence Former-commit-id: afc8e8ea4e7f02039092bfca698e5e3e491604c2
This commit is contained in:
commit
2d16d369a3
@ -113,13 +113,30 @@ 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 (hyperion.setEffect(effectName, priority, duration_ms) == 0)
|
if (effectConfig.isMember("args"))
|
||||||
{
|
{
|
||||||
std::cout << "Boot sequence(" << effectName << ") created and started" << std::endl;
|
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
|
else
|
||||||
{
|
{
|
||||||
std::cout << "Failed to start boot sequence: " << effectName << std::endl;
|
|
||||||
|
if (hyperion.setEffect(effectName, priority, duration_ms) == 0)
|
||||||
|
{
|
||||||
|
std::cout << "Boot sequence(" << effectName << ") created and started" << std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cout << "Failed to start boot sequence: " << effectName << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user