Gin
Loading...
Searching...
No Matches
AnimatedBase Class Referenceabstract

The non-template part of Animated and Crossfade: the owner, the property name, the running transition and the registration with the shared AnimationDriver. More...

#include <gin_animated.h>

Inheritance diagram for AnimatedBase:

Public Member Functions

 AnimatedBase (juce::Component &owner, const juce::String &property)
virtual ~AnimatedBase ()
bool isAnimating () const
 True while a transition runs.
juce::Component * getOwner () const
 The owning component, nullptr once it was deleted.
const juce::String & getProperty () const
 The name the layout's "transition" entries know this value by.
Transition getTransition () const
 The transition setTarget (value) uses: the owner's for the property, see Transition::forProperty.

Public Attributes

std::function< void()> onChange
 Called on every change of the current value (each animation step, and jumps), after the owner was asked to repaint.

Protected Member Functions

bool start (const Transition &t)
 Returns false when the change has to apply at once: an instant transition or an owner not on screen.
void stop ()
void changed ()
virtual void update (float progress)=0
 Moves the current value to the eased progress between start and target.
virtual void valueChanged ()
 For subclasses that apply the value somewhere: called on every change, before onChange.
float getLastProgress () const
 The eased progress of the latest step of the running transition.

Detailed Description

The non-template part of Animated and Crossfade: the owner, the property name, the running transition and the registration with the shared AnimationDriver.

Constructor & Destructor Documentation

◆ AnimatedBase()

AnimatedBase::AnimatedBase ( juce::Component & owner,
const juce::String & property )

Referenced by AnimationDriver.

◆ ~AnimatedBase()

virtual AnimatedBase::~AnimatedBase ( )
virtual

Member Function Documentation

◆ isAnimating()

bool AnimatedBase::isAnimating ( ) const

◆ getOwner()

juce::Component * AnimatedBase::getOwner ( ) const

The owning component, nullptr once it was deleted.

Referenced by Animated< T >::followTarget(), Animated< T >::setTarget(), and Crossfade< T >::setTarget().

◆ getProperty()

const juce::String & AnimatedBase::getProperty ( ) const

The name the layout's "transition" entries know this value by.

◆ getTransition()

Transition AnimatedBase::getTransition ( ) const

The transition setTarget (value) uses: the owner's for the property, see Transition::forProperty.

Referenced by Animated< T >::followTarget(), Animated< T >::setTarget(), and Crossfade< T >::setTarget().

◆ start()

bool AnimatedBase::start ( const Transition & t)
protected

Returns false when the change has to apply at once: an instant transition or an owner not on screen.

Referenced by Animated< T >::setTarget(), and Crossfade< T >::setTarget().

◆ stop()

void AnimatedBase::stop ( )
protected

◆ changed()

◆ update()

virtual void AnimatedBase::update ( float progress)
protectedpure virtual

Moves the current value to the eased progress between start and target.

◆ valueChanged()

virtual void AnimatedBase::valueChanged ( )
protectedvirtual

For subclasses that apply the value somewhere: called on every change, before onChange.

◆ getLastProgress()

float AnimatedBase::getLastProgress ( ) const
protected

The eased progress of the latest step of the running transition.

Referenced by Animated< T >::updateTarget().

Member Data Documentation

◆ onChange

std::function<void()> AnimatedBase::onChange

Called on every change of the current value (each animation step, and jumps), after the owner was asked to repaint.

Use it for anything beyond a repaint, e.g. moving child components. When a transition ends, isAnimating() is already false here.


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