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

Lightweight, embeddable value animator for widget members. More...

#include <animation.hpp>

Public Member Functions

 ValueAnimation ()=default
 ValueAnimation (float initial)
void animate_to (float target, float duration, EasingFunction ease=easing::ease_out_quad)
 Set a new target.
void set (float value)
 Snap to value immediately (no animation).
bool advance (float dt)
 Advance by dt. Returns true if still animating.
float value () const
float target () const
bool animating () const
void cancel ()
 Cancel in-flight animation, keep current value.

Detailed Description

Lightweight, embeddable value animator for widget members.

No heap allocation. Designed to be a member variable.

Constructor & Destructor Documentation

◆ ValueAnimation() [1/2]

pulp::view::ValueAnimation::ValueAnimation ( )
default

◆ ValueAnimation() [2/2]

pulp::view::ValueAnimation::ValueAnimation ( float initial)
inlineexplicit

Member Function Documentation

◆ advance()

bool pulp::view::ValueAnimation::advance ( float dt)
inline

Advance by dt. Returns true if still animating.

◆ animate_to()

void pulp::view::ValueAnimation::animate_to ( float target,
float duration,
EasingFunction ease = easing::ease_out_quad )
inline

Set a new target.

Starts animating from current value.

Honors MotionPreferences::current() at start:

  • Full → animate over duration.
  • Reduced → scale duration by duration_scale.
  • Off → jump straight to target; no intermediate values.

◆ animating()

bool pulp::view::ValueAnimation::animating ( ) const
inline

◆ cancel()

void pulp::view::ValueAnimation::cancel ( )
inline

Cancel in-flight animation, keep current value.

◆ set()

void pulp::view::ValueAnimation::set ( float value)
inline

Snap to value immediately (no animation).

◆ target()

float pulp::view::ValueAnimation::target ( ) const
inline

◆ value()

float pulp::view::ValueAnimation::value ( ) const
inline

The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/view/include/pulp/view/animation.hpp