MythTV master
galleryslideview.h
Go to the documentation of this file.
1
3
4#ifndef GALLERYWIDGET_H
5#define GALLERYWIDGET_H
6
8#include "galleryinfo.h"
9
10
11class MythMenu;
12class FlatView;
13
15enum ImageSlideShowType : std::uint8_t {
19};
20
21
24{
25 Q_OBJECT
26public:
27 GallerySlideView(MythScreenStack *parent, const char *name, bool editsAllowed);
28 ~GallerySlideView() override;
29 bool Create() override; // MythScreenType
30
31public slots:
32 void Start(ImageSlideShowType type, int parentId, int selectedId = 0);
33 void Close() override; // MythScreenType
34 void Pulse() override; // MythScreenType
35
36signals:
37 void ImageSelected(int);
38
39private:
40 bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
41 void customEvent(QEvent *event) override; // MythUIType
42 void MenuMain();
43 void MenuTransforms(MythMenu &mainMenu);
44 void Suspend();
45 void Release();
46 void Transform(ImageFileTransform state);
47 void Zoom(int increment = 0);
48 void Pan(QPoint offset = QPoint(0, 0));
49 void SetStatus(QString msg, bool delay = false);
50 void ClearStatus(const Slide &slide);
51
52private slots:
53 void ShowPrevSlide(int inc = 1);
54 void ShowNextSlide(int inc, bool useTransition = true);
55 void ShowNextSlide();
56 void SlideAvailable(int count);
57 void TransitionComplete();
58 void ShowSlide(int direction = 0);
59 void Stop();
60 void Play(bool useTransition);
61 void Play() { Play(true); };
62 static void RepeatOn(int on);
63 static void RepeatOn() { RepeatOn(1); }
64 static void RepeatOff() { RepeatOn(0); }
65 void ShowInfo();
66 void HideInfo();
67 void ShowCaptions();
68 void HideCaptions();
69 void PlayVideo();
70 void ShowStatus();
71
72private:
73 // Theme widgets
79
81 FlatView *m_view {nullptr};
82
87
90 std::chrono::milliseconds m_slideShowTime {3s};
91 QTimer m_timer;
92 QTimer m_delay;
93 QString m_statusText;
94 bool m_playing {false};
95 bool m_suspended {false};
96 bool m_showCaptions {true};
97 bool m_transitioning {false};
98 bool m_editsAllowed {false};
99};
100
101#endif // GALLERYWIDGET_H
A datastore of images for display by a screen.
Definition: galleryviews.h:102
Slideshow screen.
void ClearStatus(const Slide &slide)
QString m_statusText
Text to display as status.
MythUIText * m_uiSlideCount
QTimer m_timer
Slide duration timer.
TransitionRegistry m_availableTransitions
Transitions available.
static void RepeatOn()
MythUIText * m_uiHideCaptions
ImageManagerFe & m_mgr
Manages the images.
bool m_showCaptions
If true, captions are shown.
void ShowInfo()
Show exif info list.
void HideCaptions()
Hide text widgets.
~GallerySlideView() override
Destructor.
void PlayVideo()
Starts internal player for video.
void Release()
Unpause transition timer.
FlatView * m_view
List of images comprising the slideshow.
void customEvent(QEvent *event) override
Handle custom events.
void ImageSelected(int)
void HideInfo()
Hide exif info list.
SlideBuffer m_slides
A queue of slides used to display images.
bool Create() override
Initialises the graphical elements.
static void RepeatOff()
bool m_editsAllowed
True when edits are enabled.
bool m_transitioning
True when a transition is in progress.
void ShowCaptions()
Show text widgets.
TransitionNone m_updateTransition
Instant transition that is always used for start-up & image updates.
void Start(ImageSlideShowType type, int parentId, int selectedId=0)
Start slideshow.
void TransitionComplete()
Transition to new slide has finished.
QTimer m_delay
Status delay timer.
void SetStatus(QString msg, bool delay=false)
Displays status text (Loading, Paused etc.)
void Close() override
void Pan(QPoint offset=QPoint(0, 0))
Pan current slide.
MythUIText * m_uiCaptionText
void MenuTransforms(MythMenu &mainMenu)
Add Transforms submenu.
InfoList m_infoList
Image details overlay.
void MenuMain()
Shows the popup menu.
GallerySlideView(MythScreenStack *parent, const char *name, bool editsAllowed)
Constructor.
void Stop()
Stop a playing slideshow.
void Zoom(int increment=0)
Zoom current slide.
bool m_playing
True when slideshow is running.
void Pulse() override
Update transition.
void Suspend()
Pause transition timer temporarily.
bool m_suspended
True when transition is running or video playing.
MythUIImage * m_uiImage
void SlideAvailable(int count)
Start transition.
Transition & m_transition
Selected transition.
bool keyPressEvent(QKeyEvent *event) override
Handle keypresses.
void ShowPrevSlide(int inc=1)
Display the previous slide in the sequence.
std::chrono::milliseconds m_slideShowTime
Time to display a slide in a slideshow.
void Transform(ImageFileTransform state)
Action transform request.
MythUIText * m_uiStatus
void ShowSlide(int direction=0)
Display slide.
The image manager for use by Frontends.
Definition: imagemanager.h:456
The image info/details buttonlist overlay that displays exif tags.
Definition: galleryinfo.h:24
Screen in which all other widgets are contained and rendered.
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:98
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
Provides a queue/pool of slides.
Definition: galleryslide.h:216
A specialised image for slideshows.
Definition: galleryslide.h:157
Switches images instantly with no effects.
Manages transitions available to s psinter.
Base class of an animated transition that can be accelerated & reversed.
The info/details overlay that shows image metadata.
ImageSlideShowType
Type of slide show.
@ kNormalSlideShow
@ kRecursiveSlideShow
@ kBrowseSlides
Provides transitions for slideshows.
ImageFileTransform
Image transformations.
Definition: imagemetadata.h:46