MythTV  master
galleryslideview.h
Go to the documentation of this file.
1 
4 #ifndef GALLERYWIDGET_H
5 #define GALLERYWIDGET_H
6 
7 #include "gallerytransitions.h"
8 #include "galleryinfo.h"
9 
10 
11 class MythMenu;
12 class FlatView;
13 
19 };
20 
21 
24 {
25  Q_OBJECT
26 public:
27  GallerySlideView(MythScreenStack *parent, const char *name, bool editsAllowed);
28  ~GallerySlideView() override;
29  bool Create() override; // MythScreenType
30 
31 public slots:
32  void Start(ImageSlideShowType type, int parentId, int selectedId = 0);
33  void Close() override; // MythScreenType
34  void Pulse() override; // MythScreenType
35 
36 signals:
37  void ImageSelected(int);
38 
39 private:
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 
52 private 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) { gCoreContext->SaveSetting("GalleryRepeat", 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 
72 private:
73  // Theme widgets
74  MythUIImage *m_uiImage {nullptr};
75  MythUIText *m_uiStatus {nullptr};
79 
81  FlatView *m_view {nullptr};
82 
87 
90  int m_slideShowTime {3000};
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
Slide
A specialised image for slideshows.
Definition: galleryslide.h:157
MythUIImage
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:98
ImageSlideShowType
ImageSlideShowType
Type of slide show.
Definition: galleryslideview.h:15
GallerySlideView::m_showCaptions
bool m_showCaptions
If true, captions are shown.
Definition: galleryslideview.h:96
GallerySlideView::Transform
void Transform(ImageFileTransform state)
Action transform request.
Definition: galleryslideview.cpp:470
GallerySlideView::m_uiSlideCount
MythUIText * m_uiSlideCount
Definition: galleryslideview.h:76
GallerySlideView::m_editsAllowed
bool m_editsAllowed
True when edits are enabled.
Definition: galleryslideview.h:98
GallerySlideView::m_mgr
ImageManagerFe & m_mgr
Manages the images.
Definition: galleryslideview.h:80
kBrowseSlides
@ kBrowseSlides
Definition: galleryslideview.h:16
MythScreenStack
Definition: mythscreenstack.h:16
GallerySlideView::m_infoList
InfoList m_infoList
Image details overlay.
Definition: galleryslideview.h:89
GallerySlideView::customEvent
void customEvent(QEvent *event) override
Handle custom events.
Definition: galleryslideview.cpp:216
GallerySlideView::Start
void Start(ImageSlideShowType type, int parentId, int selectedId=0)
Start slideshow.
Definition: galleryslideview.cpp:359
GallerySlideView::m_transitioning
bool m_transitioning
True when a transition is in progress.
Definition: galleryslideview.h:97
GallerySlideView::m_uiHideCaptions
MythUIText * m_uiHideCaptions
Definition: galleryslideview.h:78
FlatView
A datastore of images for display by a screen.
Definition: galleryviews.h:99
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
GallerySlideView::TransitionComplete
void TransitionComplete()
Transition to new slide has finished.
Definition: galleryslideview.cpp:620
GallerySlideView::Suspend
void Suspend()
Pause transition timer temporarily.
Definition: galleryslideview.cpp:448
Transition
Base class of an animated transition that can be accelerated & reversed.
Definition: gallerytransitions.h:29
GallerySlideView::m_uiImage
MythUIImage * m_uiImage
Definition: galleryslideview.h:74
GallerySlideView::m_slides
SlideBuffer m_slides
A queue of slides used to display images.
Definition: galleryslideview.h:88
GallerySlideView::Stop
void Stop()
Stop a playing slideshow.
Definition: galleryslideview.cpp:421
GallerySlideView::m_slideShowTime
int m_slideShowTime
Time to display a slide in a slideshow.
Definition: galleryslideview.h:90
GallerySlideView::SlideAvailable
void SlideAvailable(int count)
Start transition.
Definition: galleryslideview.cpp:572
GallerySlideView::GallerySlideView
GallerySlideView(MythScreenStack *parent, const char *name, bool editsAllowed)
Constructor.
Definition: galleryslideview.cpp:21
GallerySlideView::PlayVideo
void PlayVideo()
Starts internal player for video.
Definition: galleryslideview.cpp:729
GallerySlideView::m_updateTransition
TransitionNone m_updateTransition
Instant transition that is always used for start-up & image updates.
Definition: galleryslideview.h:86
GallerySlideView::HideCaptions
void HideCaptions()
Hide text widgets.
Definition: galleryslideview.cpp:537
ImageFileTransform
ImageFileTransform
Image transformations.
Definition: imagemetadata.h:46
GallerySlideView::RepeatOn
static void RepeatOn()
Definition: galleryslideview.h:63
gallerytransitions.h
Provides transitions for slideshows.
GallerySlideView::ShowPrevSlide
void ShowPrevSlide(int inc=1)
Display the previous slide in the sequence.
Definition: galleryslideview.cpp:672
GallerySlideView::m_view
FlatView * m_view
List of images comprising the slideshow.
Definition: galleryslideview.h:81
GallerySlideView
Slideshow screen.
Definition: galleryslideview.h:24
GallerySlideView::ClearStatus
void ClearStatus(const Slide &slide)
Definition: galleryslideview.cpp:766
GallerySlideView::Close
void Close() override
Definition: galleryslideview.cpp:402
GallerySlideView::m_delay
QTimer m_delay
Status delay timer.
Definition: galleryslideview.h:92
kNormalSlideShow
@ kNormalSlideShow
Definition: galleryslideview.h:17
GallerySlideView::m_transition
Transition & m_transition
Selected transition.
Definition: galleryslideview.h:84
GallerySlideView::Zoom
void Zoom(int increment=0)
Zoom current slide.
Definition: galleryslideview.cpp:488
GallerySlideView::m_uiStatus
MythUIText * m_uiStatus
Definition: galleryslideview.h:75
TransitionNone
Switches images instantly with no effects.
Definition: gallerytransitions.h:74
GallerySlideView::ShowNextSlide
void ShowNextSlide()
Definition: galleryslideview.cpp:720
GallerySlideView::Play
void Play()
Definition: galleryslideview.h:61
galleryinfo.h
The info/details overlay that shows image metadata.
SlideBuffer
Provides a queue/pool of slides.
Definition: galleryslide.h:216
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
GallerySlideView::m_playing
bool m_playing
True when slideshow is running.
Definition: galleryslideview.h:94
GallerySlideView::Create
bool Create() override
Initialises the graphical elements.
Definition: galleryslideview.cpp:73
GallerySlideView::ShowSlide
void ShowSlide(int direction=0)
Display slide.
Definition: galleryslideview.cpp:548
GallerySlideView::m_statusText
QString m_statusText
Text to display as status.
Definition: galleryslideview.h:93
TransitionRegistry
Manages transitions available to s psinter.
Definition: gallerytransitions.h:185
GallerySlideView::ShowCaptions
void ShowCaptions()
Show text widgets.
Definition: galleryslideview.cpp:527
GallerySlideView::m_uiCaptionText
MythUIText * m_uiCaptionText
Definition: galleryslideview.h:77
MythMenu
Definition: mythdialogbox.h:100
GallerySlideView::RepeatOn
static void RepeatOn(int on)
Definition: galleryslideview.h:62
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
GallerySlideView::ImageSelected
void ImageSelected(int)
GallerySlideView::SetStatus
void SetStatus(QString msg, bool delay=false)
Displays status text (Loading, Paused etc.)
Definition: galleryslideview.cpp:746
ImageManagerFe
The image manager for use by Frontends.
Definition: imagemanager.h:457
GallerySlideView::m_suspended
bool m_suspended
True when transition is running or video playing.
Definition: galleryslideview.h:95
GallerySlideView::~GallerySlideView
~GallerySlideView() override
Destructor.
Definition: galleryslideview.cpp:62
InfoList
The image info/details buttonlist overlay that displays exif tags.
Definition: galleryinfo.h:23
GallerySlideView::MenuTransforms
void MenuTransforms(MythMenu &mainMenu)
Add Transforms submenu.
Definition: galleryslideview.cpp:324
GallerySlideView::ShowStatus
void ShowStatus()
Definition: galleryslideview.cpp:759
GallerySlideView::HideInfo
void HideInfo()
Hide exif info list.
Definition: galleryslideview.cpp:518
GallerySlideView::Release
void Release()
Unpause transition timer.
Definition: galleryslideview.cpp:458
GallerySlideView::ShowInfo
void ShowInfo()
Show exif info list.
Definition: galleryslideview.cpp:509
GallerySlideView::Pan
void Pan(QPoint offset=QPoint(0, 0))
Pan current slide.
Definition: galleryslideview.cpp:499
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:902
GallerySlideView::m_timer
QTimer m_timer
Slide duration timer.
Definition: galleryslideview.h:91
kRecursiveSlideShow
@ kRecursiveSlideShow
Definition: galleryslideview.h:18
GallerySlideView::Pulse
void Pulse() override
Update transition.
Definition: galleryslideview.cpp:120
GallerySlideView::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Handle keypresses.
Definition: galleryslideview.cpp:134
GallerySlideView::m_availableTransitions
TransitionRegistry m_availableTransitions
Transitions available.
Definition: galleryslideview.h:83
GallerySlideView::MenuMain
void MenuMain()
Shows the popup menu.
Definition: galleryslideview.cpp:269
GallerySlideView::RepeatOff
static void RepeatOff()
Definition: galleryslideview.h:64