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 (int interval) override
 Progress single animation. More...
 
void Set (const QVariant &from, const QVariant &to, int duration=500, 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}
 
int m_elapsed {0}
 Current millisec position within animation, 0..duration. More...
 
- 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 55 of file galleryslide.h.

Member Enumeration Documentation

◆ Type

Supported effects.

Enumerator
None 
Alpha 
Position 
Zoom 
HorizontalZoom 
VerticalZoom 
Angle 

Definition at line 59 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 66 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 61 of file galleryslide.cpp.

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

◆ Pulse()

void Animation::Pulse ( int  interval)
overridevirtual

Progress single animation.

Parameters
intervalMillisecs since last update

Implements AbstractAnimation.

Definition at line 77 of file galleryslide.cpp.

Referenced by Slide::Pulse().

◆ Set()

void Animation::Set ( const QVariant &  from,
const QVariant &  to,
int  duration = 500,
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 45 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 97 of file galleryslide.cpp.

Member Data Documentation

◆ m_parent

Slide* Animation::m_parent {nullptr}
protected

Image to be animated.

Definition at line 80 of file galleryslide.h.

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

◆ m_type

Type Animation::m_type
protected

Definition at line 81 of file galleryslide.h.

Referenced by updateCurrentValue().

◆ m_centre

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

Definition at line 82 of file galleryslide.h.

Referenced by Set(), and updateCurrentValue().

◆ m_elapsed

int Animation::m_elapsed {0}
protected

Current millisec position within animation, 0..duration.

Decreases duration..0 when playing backwards

Definition at line 85 of file galleryslide.h.

Referenced by Pulse(), and Start().


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