One placement-fade ramp a flattened leaf sits under, in clip-relative frames. More...
#include <audio_renderer.hpp>
Public Attributes | |
| double | silent_frame = 0.0 |
| double | open_frame = 0.0 |
| timeline::ClipFadeShape | shape = timeline::ClipFadeShape::Linear |
One placement-fade ramp a flattened leaf sits under, in clip-relative frames.
The ends name what the ramp reads rather than which way it points: silent_frame is where its gain is zero and open_frame where it is unity, so a fade in and a fade out are one shape with the ends exchanged. Progress is (position - silent_frame) / (open_frame - silent_frame) clamped to the unit interval, and the authored shape reparameterizes that progress.
Storing the progress window rather than a pair of endpoint gains is the point. A leaf covers a sub-interval of the ramp, and a shape is a reparameterization of progress, so re-applying the shape to the progress the leaf actually spans is the only reading that agrees with the unflattened envelope. Ramping between two endpoint gains lands both edges and bends the wrong way everywhere between them.
Either end may fall outside the leaf. Flattening cuts a nested window at clip boundaries and never at a ramp edge, so carrying the whole ramp and evaluating the position is what makes two neighbouring leaves read the same gain at the frame they share.
| double pulp::playback::ClipPlacementFadeSegment::open_frame = 0.0 |
| timeline::ClipFadeShape pulp::playback::ClipPlacementFadeSegment::shape = timeline::ClipFadeShape::Linear |
| double pulp::playback::ClipPlacementFadeSegment::silent_frame = 0.0 |