Interrupt effect on timeout (#1181)

Fixes #1013
This commit is contained in:
Vincent Tavernier
2021-02-23 20:38:26 +01:00
committed by GitHub
parent 45bd23ca5c
commit 9475b93d9f
4 changed files with 38 additions and 36 deletions

View File

@@ -47,6 +47,25 @@ Effect::~Effect()
_imageStack.clear();
}
bool Effect::isInterruptionRequested()
{
return _interupt || getRemaining() < 0;
}
int Effect::getRemaining()
{
// determine the timeout
int timeout = _timeout;
if (timeout > 0)
{
timeout = _endTime - QDateTime::currentMSecsSinceEpoch();
return timeout;
}
return timeout;
}
void Effect::setModuleParameters()
{
// import the buildtin Hyperion module