19#define MIN_ZOOM (0.1F)
20#define MAX_ZOOM (20.0F)
31 virtual void Start(
bool forwards,
float speed = 1.0);
67 void Start(
bool forwards =
true,
float speed = 1.0)
override;
68 void Pulse()
override;
69 void Set(
const QVariant& from,
const QVariant& to,
70 std::chrono::milliseconds duration = 500ms,
71 const QEasingCurve& curve = QEasingCurve::InOutCubic,
96 void Start(
bool forwards,
float speed = 1.0) override
101 void Clear()
override;
115 void Pulse()
override;
116 void Start(
bool forwards,
float speed = 1.0)
override;
117 void SetSpeed(
float speed)
override;
133 void Pulse()
override;
134 void Start(
bool forwards,
float speed = 1.0)
override;
135 void SetSpeed(
float speed)
override;
164 bool LoadSlide(
const ImagePtrK& im,
int direction = 0,
bool notifyCompletion =
false);
166 void Zoom(
int percentage);
168 void Pan(QPoint offset);
176 void Pulse()
override;
244 void Flush(
Slide *slide,
const QString& reason);
Base animation class that is driven by a Myth pulse and implements variable speed.
virtual void Finished()
To be called when animation completes.
void finished()
Signals animation has finished.
virtual void SetSpeed(float speed)
virtual void Start(bool forwards, float speed=1.0)
Initialise & start base animation.
float m_speed
Real-time = 1.0, Double-speed = 2.0.
AbstractAnimation()=default
bool m_forwards
Play direction.
bool m_running
True whilst animation is active.
A single animation controlling alpha, zoom, rotation and position.
std::chrono::milliseconds m_lastUpdate
UIEffects::Centre m_centre
void updateCurrentValue(const QVariant &value) override
Update animated value.
Animation(Slide *image, Type type=Alpha)
Create simple animation.
void Start(bool forwards=true, float speed=1.0) override
Start a single animation.
Slide * m_parent
Image to be animated.
void Pulse() override
Progress single animation.
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.
std::chrono::milliseconds m_elapsed
Current millisec position within animation, 0..duration.
Abstract class for groups of animations.
void SetSpeed(float speed) override
~GroupAnimation() override
QList< AbstractAnimation * > m_group
void Clear() override
Delete all child animations.
void Start(bool forwards, float speed=1.0) override
Initialise & start base animation.
virtual void Add(AbstractAnimation *child)
Add child animation to group.
Image widget, displays a single image or multiple images in sequence.
The base class on which all widgets and screens are based.
Specialised animation for panning slideshow images (MythUI doesn't support panning)
void updateCurrentValue(const QVariant &value) override
Update pan value.
PanAnimation(Slide *image)
A group of animations to be played simultaneously.
void SetSpeed(float speed) override
Change speed of group and all child animations.
void Finished() override
A child animation has completed.
void Start(bool forwards, float speed=1.0) override
Start parallel group. All children play simultaneously.
int m_finished
Count of child animations that have finished.
void Pulse() override
Progress parallel animations.
ParallelAnimation()=default
A group of animations to be played sequentially.
void Start(bool forwards, float speed=1.0) override
Start sequential animation.
void Finished() override
A child animation has completed.
SequentialAnimation()=default
void Pulse() override
Progress sequential animation.
int m_current
Index of child currently playing.
void SetSpeed(float speed) override
Change speed of current child animation and all subsequent ones.
Provides a queue/pool of slides.
QString BufferState()
Determines buffer state for debug logging.
void Flush(Slide *slide, const QString &reason)
Signal if any slides are waiting to be displayed.
void ReleaseCurrent()
Move head slide to back of queue and flush waiting slides.
void Initialise(MythUIImage &image)
Construct buffer.
int m_nextLoad
Index of first spare slide, (or last slide if none spare)
bool Load(const ImagePtrK &im, int direction)
Assign an image to next available slide, start loading and signal when done.
void Preload(const ImagePtrK &im)
Load an image in next available slide.
QRecursiveMutex m_mutexQ
Queue protection.
QQueue< Slide * > m_queue
Queue of slides.
void SlideReady(int count)
Signals that buffer has (count) loaded slides awaiting display.
A specialised image for slideshows.
int m_direction
Navigation that created this image, -1 = Prev, 0 = Update, 1 = Next.
QChar GetDebugState() const
Return debug status.
float m_zoom
Current zoom, 1.0 = fullsize.
void Pan(QPoint offset)
Initiate pan.
QPoint m_pan
Pan position (0,0) = no pan.
void ImageLoaded(Slide *)
Generated when the last requested image has loaded.
PanAnimation * m_panAnimation
Dedicated animation for panning, if supported.
void Zoom(int percentage)
Initiate slide zoom.
Animation * m_zoomAnimation
Dedicated animation for zoom, if supported.
ImagePtrK GetImageData() const
ImagePtrK m_data
The image currently loading/loaded.
SlideState m_state
Slide validity.
void SetZoom(float zoom)
Sets slide zoom.
bool LoadSlide(const ImagePtrK &im, int direction=0, bool notifyCompletion=false)
Load slide with an image.
void SetPan(QPoint pos)
Sets slide pan.
void Pulse() override
Update pan & zoom animations.
void SlideLoaded()
An image has completed loading.
void Clear()
Reset slide to unused state.
~Slide() override
Destructor.
ImagePtrK m_waitingFor
The most recently requested image. Null for preloads. Differs from m_data when skipping.
Slide(MythUIType *parent, const QString &name, MythUIImage *image)
Clone slide from a theme MythUIImage.
Common types used by Gallery.
QSharedPointer< ImageItemK > ImagePtrK
std::chrono::milliseconds currentMSecsSinceEpochAsDuration(void)