Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::CssAnimation Struct Reference

One running animation. More...

#include <css_animation.hpp>

Public Member Functions

void apply_motion_policy ()
 Apply the current MotionPolicy to spec.duration_seconds (and start_value under Off, by forcing an immediate end).
float tick (float dt)
 Advance by dt seconds.
void publish (std::string view_name, std::string metric_name, motion::PublishOptions opts={}) const
 Publish the current eased value through the motion publish channel, stamping spec.motion_provenance() (source_kind= "css-transition", source_id=<property name>, file/line from the CSS parser) onto the emitted event.

Public Attributes

AnimatableProperty property = AnimatableProperty::none
TransitionSpec spec {}
float start_value = 0.0f
 Start + end values are property-typed; supported properties reduce to a float scalar after component decomposition (color channels are tweened separately by the color-typed dispatcher).
float end_value = 0.0f
float elapsed_seconds = 0.0f
bool active = true
bool motion_policy_applied_ = false
 Internal: have we applied the current MotionPolicy to this animation's effective duration yet?

Detailed Description

One running animation.

Lifecycle: created when a property changes and a TransitionSpec matches; ticks each frame via tick(); finishes when elapsed >= delay + duration. The dispatcher applies the tweened scalar to the target property.

Member Function Documentation

◆ apply_motion_policy()

void pulp::view::CssAnimation::apply_motion_policy ( )
inline

Apply the current MotionPolicy to spec.duration_seconds (and start_value under Off, by forcing an immediate end).

Idempotent — repeated calls are no-ops after the first.

◆ publish()

void pulp::view::CssAnimation::publish ( std::string view_name,
std::string metric_name,
motion::PublishOptions opts = {} ) const
inline

Publish the current eased value through the motion publish channel, stamping spec.motion_provenance() (source_kind= "css-transition", source_id=<property name>, file/line from the CSS parser) onto the emitted event.

◆ tick()

float pulp::view::CssAnimation::tick ( float dt)
inline

Advance by dt seconds.

Returns the current eased value. When active flips to false the caller should commit end_value and clean up.

Honors MotionPreferences::current() on the first tick:

  • Off → completes immediately with end_value.
  • Reduced → effective duration is spec.duration_seconds * duration_scale (captured on first tick).
  • Full → no change to the configured spec.

Member Data Documentation

◆ active

bool pulp::view::CssAnimation::active = true

◆ elapsed_seconds

float pulp::view::CssAnimation::elapsed_seconds = 0.0f

◆ end_value

float pulp::view::CssAnimation::end_value = 0.0f

◆ motion_policy_applied_

bool pulp::view::CssAnimation::motion_policy_applied_ = false

Internal: have we applied the current MotionPolicy to this animation's effective duration yet?

Lazy on the first tick() so callers don't need to remember to call a setup step. The policy snapshot taken here is what governs the animation's behavior for its lifetime.

◆ property

AnimatableProperty pulp::view::CssAnimation::property = AnimatableProperty::none

◆ spec

TransitionSpec pulp::view::CssAnimation::spec {}

◆ start_value

float pulp::view::CssAnimation::start_value = 0.0f

Start + end values are property-typed; supported properties reduce to a float scalar after component decomposition (color channels are tweened separately by the color-typed dispatcher).


The documentation for this struct was generated from the following file: