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