MythTV  master
Public Types | Public Member Functions | Protected Attributes | List of all members
Animation Class Reference

A single animation controlling alpha, zoom, rotation and position. More...

#include <galleryslide.h>

Inheritance diagram for Animation:
Inheritance graph
[legend]
Collaboration diagram for Animation:
Collaboration graph
[legend]

Public Types

enum  Type {
  None, Alpha, Position, Zoom,
  HorizontalZoom, VerticalZoom, Angle
}
 Supported effects. More...
 

Public Member Functions

 Animation (Slide *image, Type type=Alpha)
 Create simple animation. More...
 
void Start (bool forwards=true, float speed=1.0) override
 Start a single animation. More...
 
void Pulse () override
 Progress single animation. More...
 
void Set (const QVariant &from, const QVariant &to, std::chrono::milliseconds duration=500ms, const QEasingCurve &curve=QEasingCurve::InOutCubic, UIEffects::Centre centre=UIEffects::Middle)
 Initialises an animation. More...
 
void updateCurrentValue (const QVariant &value) override
 Update animated value. More...
 
- Public Member Functions inherited from AbstractAnimation
 AbstractAnimation ()=default
 
virtual void Stop ()
 
virtual void SetSpeed (float speed)
 
virtual void Clear ()
 

Protected Attributes

Slidem_parent {nullptr}
 Image to be animated. More...
 
Type m_type
 
UIEffects::Centre m_centre {UIEffects::Middle}
 
std::chrono::milliseconds m_elapsed {0ms}
 Current millisec position within animation, 0..duration. More...
 
std::chrono::milliseconds m_lastUpdate { MythDate::currentMSecsSinceEpochAsDuration() }
 
- Protected Attributes inherited from AbstractAnimation
bool m_forwards {true}
 Play direction. More...
 
bool m_running {false}
 True whilst animation is active. More...
 
float m_speed {0.0F}
 Real-time = 1.0, Double-speed = 2.0. More...
 

Additional Inherited Members

- Signals inherited from AbstractAnimation
void finished ()
 Signals animation has finished. More...
 
- Protected Slots inherited from AbstractAnimation
virtual void Finished ()
 To be called when animation completes. More...
 

Detailed Description

A single animation controlling alpha, zoom, rotation and position.

Note
This is almost compatible with MythUIAnimation (they could be merged)

Definition at line 54 of file galleryslide.h.

Member Enumeration Documentation

◆ Type

Supported effects.

Enumerator
None 
Alpha 
Position 
Zoom 
HorizontalZoom 
VerticalZoom 
Angle 

Definition at line 58 of file galleryslide.h.

Constructor & Destructor Documentation

◆ Animation()

Animation::Animation ( Slide image,
Type  type = Alpha 
)
inlineexplicit

Create simple animation.

Parameters
imageImage to be animated
typeEffect to be animated

Definition at line 65 of file galleryslide.h.

Member Function Documentation

◆ Start()

void Animation::Start ( bool  forwards = true,
float  speed = 1.0 
)
overridevirtual

Start a single animation.

Parameters
forwardsDirection
speedSpeed factor, 1x, 2x etc

Reimplemented from AbstractAnimation.

Definition at line 66 of file galleryslide.cpp.

Referenced by Slide::Pan(), and Slide::Zoom().

◆ Pulse()

void Animation::Pulse ( )
overridevirtual

Progress single animation.

Implements AbstractAnimation.

Definition at line 81 of file galleryslide.cpp.

Referenced by Slide::Pulse().

◆ Set()

void Animation::Set ( const QVariant &  from,
const QVariant &  to,
std::chrono::milliseconds  duration = 500ms,
const QEasingCurve &  curve = QEasingCurve::InOutCubic,
UIEffects::Centre  centre = UIEffects::Middle 
)

Initialises an animation.

Parameters
fromStart value
toEnd value
durationAnimation duration
curveEasing curve governing animation
centreZoom centre

Definition at line 49 of file galleryslide.cpp.

Referenced by Slide::Pan(), and Slide::Zoom().

◆ updateCurrentValue()

void Animation::updateCurrentValue ( const QVariant &  value)
override

Update animated value.

Parameters
valueLatest value, derived from animation time & easing curve

Definition at line 102 of file galleryslide.cpp.

Member Data Documentation

◆ m_parent

Slide* Animation::m_parent {nullptr}
protected

Image to be animated.

Definition at line 79 of file galleryslide.h.

Referenced by updateCurrentValue(), and PanAnimation::updateCurrentValue().

◆ m_type

Type Animation::m_type
protected

Definition at line 80 of file galleryslide.h.

Referenced by updateCurrentValue().

◆ m_centre

UIEffects::Centre Animation::m_centre {UIEffects::Middle}
protected

Definition at line 81 of file galleryslide.h.

Referenced by Set(), and updateCurrentValue().

◆ m_elapsed

std::chrono::milliseconds Animation::m_elapsed {0ms}
protected

Current millisec position within animation, 0..duration.

Decreases duration..0 when playing backwards

Definition at line 84 of file galleryslide.h.

Referenced by Pulse(), and Start().

◆ m_lastUpdate

std::chrono::milliseconds Animation::m_lastUpdate { MythDate::currentMSecsSinceEpochAsDuration() }
protected

Definition at line 85 of file galleryslide.h.

Referenced by Pulse().


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