mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Clear channel after a effect stopped by itself
Former-commit-id: 98be2adfb9a6b2029fc2fe4dad4999b7c44a0aad
This commit is contained in:
parent
ae1bd7d254
commit
47eaf25904
@ -80,6 +80,11 @@ int Effect::getPriority() const
|
||||
return _priority;
|
||||
}
|
||||
|
||||
bool Effect::isAbortRequested() const
|
||||
{
|
||||
return _abortRequested;
|
||||
}
|
||||
|
||||
void Effect::abort()
|
||||
{
|
||||
_abortRequested = true;
|
||||
|
@ -21,6 +21,8 @@ public:
|
||||
|
||||
int getPriority() const;
|
||||
|
||||
bool isAbortRequested() const;
|
||||
|
||||
public slots:
|
||||
void abort();
|
||||
|
||||
|
@ -80,7 +80,6 @@ int EffectEngine::runEffect(const std::string &effectName, int priority, int tim
|
||||
|
||||
void EffectEngine::channelCleared(int priority)
|
||||
{
|
||||
std::cout << "clear effect on channel " << priority << std::endl;
|
||||
for (Effect * effect : _activeEffects)
|
||||
{
|
||||
if (effect->getPriority() == priority)
|
||||
@ -92,7 +91,6 @@ void EffectEngine::channelCleared(int priority)
|
||||
|
||||
void EffectEngine::allChannelsCleared()
|
||||
{
|
||||
std::cout << "clear effect on every channel" << std::endl;
|
||||
for (Effect * effect : _activeEffects)
|
||||
{
|
||||
effect->abort();
|
||||
@ -101,6 +99,12 @@ void EffectEngine::allChannelsCleared()
|
||||
|
||||
void EffectEngine::effectFinished(Effect *effect)
|
||||
{
|
||||
if (!effect->isAbortRequested())
|
||||
{
|
||||
// effect stopped by itself. Clear the channel
|
||||
_hyperion->clear(effect->getPriority());
|
||||
}
|
||||
|
||||
std::cout << "effect finished" << std::endl;
|
||||
for (auto effectIt = _activeEffects.begin(); effectIt != _activeEffects.end(); ++effectIt)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user