-
Notifications
You must be signed in to change notification settings - Fork 0
/
transition_fade.hpp
43 lines (30 loc) · 1.16 KB
/
transition_fade.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef SCHLAZICONTROL_TRANSITION_FADE_HPP
#define SCHLAZICONTROL_TRANSITION_FADE_HPP
#include <cstddef>
#include <chrono>
#include <string>
#include "forward.hpp"
#include "transition.hpp"
namespace sc {
struct FadeTransitionState;
/**
* class FadeTransition
*/
class FadeTransition final
: public Transition
{
public:
FadeTransition( std::string&& id, Manager& manager, PropertyNode const& properties );
virtual std::unique_ptr< TransitionInstance > instantiate() const override;
bool acceptsChannels( std::size_t channels ) const { return true; }
std::size_t emitsChannels( std::size_t channels ) const { return channels; }
void transform( FadeTransitionState& state, Connection& connection, ChannelBuffer& values ) const;
void poll( FadeTransitionState& state, Connection& connection, double factor ) const;
private:
bool calculateDeltas( FadeTransitionState& state ) const;
bool calculateOutput( FadeTransitionState& state ) const;
Manager& manager_;
double deltaPerNs_;
};
} // namespace sc
#endif // SCHLAZICONTROL_TRANSITION_FADE_HPP