34 lines
No EOL
1.2 KiB
C++
34 lines
No EOL
1.2 KiB
C++
/*******************************************************************************
|
|
Copyright © 2017 Philips Lighting Holding B.V.
|
|
All Rights Reserved.
|
|
********************************************************************************/
|
|
|
|
#include <huestream/effect/animation/data/Playables/PlayableConstant.h>
|
|
#include <huestream/effect/animation/data/Playables/PlayableSequence.h>
|
|
#include <huestream/effect/animation/data/Playables/PlayableTween.h>
|
|
#include "BrightnessSawEffect.h"
|
|
namespace huestream {
|
|
|
|
BrightnessSawEffect::BrightnessSawEffect(const string &name, unsigned int priority) : AreaEffect(name, priority) {}
|
|
|
|
void BrightnessSawEffect::PrepareEffect(std::shared_ptr<PlayableConstant> speedAnimation, std::shared_ptr<PlayableConstant> alphaAnimation) {
|
|
|
|
auto r = std::make_shared<PlayableSequence>(INF);
|
|
|
|
auto rampUp = std::make_shared<PlayableTween>(0, 1, 4000, TweenType::Linear);
|
|
r->Append(rampUp, "Up");
|
|
|
|
auto rampDown = std::make_shared<PlayableTween>(1, 0, 4000, TweenType::Linear);
|
|
r->Append(rampDown, "Down");
|
|
|
|
auto g = std::make_shared<PlayableConstant>(0);
|
|
auto b = std::make_shared<PlayableConstant>(0);
|
|
|
|
SetColorAnimation(r, g, b);
|
|
SetOpacityAnimation(alphaAnimation);
|
|
SetSpeedAnimation(speedAnimation);
|
|
|
|
AddArea(Area::FrontHalf);
|
|
}
|
|
|
|
} |