MythTV  master
galleryslideview.cpp
Go to the documentation of this file.
1 #include "galleryslideview.h"
2 
3 #include <utility>
4 
5 #include "mythmainwindow.h"
6 #include "mythuitext.h"
7 #include "mythdialogbox.h"
8 
9 #include "galleryviews.h"
10 
11 #define LOC QString("Slideview: ")
12 
13 
22  bool editsAllowed)
23  : MythScreenType(parent, name),
24  m_mgr(ImageManagerFe::getInstance()),
25  m_availableTransitions(GetMythPainter()->SupportsAnimation()),
26  m_transition(m_availableTransitions.Select(
27  gCoreContext->GetNumSetting("GalleryTransitionType",
29  m_infoList(*this),
30  m_slideShowTime(gCoreContext->GetNumSetting("GallerySlideShowTime", 3000)),
31  m_showCaptions(gCoreContext->GetBoolSetting("GalleryShowSlideCaptions", true)),
32  m_editsAllowed(editsAllowed)
33 {
34  // Detect when transitions finish. Queued signal to allow redraw/pulse to
35  // complete before handling event.
36  connect(&m_transition, SIGNAL(finished()),
37  this, SLOT(TransitionComplete()), Qt::QueuedConnection);
38  connect(&m_updateTransition, SIGNAL(finished()),
39  this, SLOT(TransitionComplete()), Qt::QueuedConnection);
40 
41 #if QT_VERSION < QT_VERSION_CHECK(5,10,0)
42  // Seed random generator for random transitions
43  qsrand(QTime::currentTime().msec());
44 #endif
45 
46  // Initialise slideshow timer
47  m_timer.setSingleShot(true);
48  m_timer.setInterval(m_slideShowTime);
49  connect(&m_timer, SIGNAL(timeout()), this, SLOT(ShowNextSlide()));
50 
51  // Initialise status delay timer
52  m_delay.setSingleShot(true);
53  m_delay.setInterval(gCoreContext->GetNumSetting("GalleryStatusDelay", 0));
54  connect(&m_delay, SIGNAL(timeout()), this, SLOT(ShowStatus()));
55 }
56 
57 
62 {
63  delete m_view;
64  LOG(VB_GUI, LOG_DEBUG, "Deleted Slideview");
65 }
66 
67 
73 {
74  if (!LoadWindowFromXML("image-ui.xml", "slideshow", this))
75  return false;
76 
77  // Get widgets from XML
78  bool err = false;
79  UIUtilE::Assign(this, m_uiImage, "image", &err);
80  UIUtilW::Assign(this, m_uiStatus, "status");
81  UIUtilW::Assign(this, m_uiSlideCount, "slidecount");
82  UIUtilW::Assign(this, m_uiCaptionText, "caption");
83  UIUtilW::Assign(this, m_uiHideCaptions, "hidecaptions");
84 
85  if (err)
86  {
87  LOG(VB_GENERAL, LOG_ERR, LOC + "Cannot load screen 'Slideshow'");
88  return false;
89  }
90 
91  // Initialise details list
92  if (!m_infoList.Create(true))
93  {
94  LOG(VB_GENERAL, LOG_ERR, LOC + "Cannot load 'Info buttonlist'");
95  return false;
96  }
97 
98  // Create display buffer
100 
101  if (m_uiHideCaptions)
102  m_uiHideCaptions->SetText(m_showCaptions ? "" : tr("Hide"));
103 
104  BuildFocusList();
106 
107  // Detect when slides are available for display.
108  // Queue so that keypress events always complete before transition starts
109  connect(&m_slides, SIGNAL(SlideReady(int)),
110  this, SLOT(SlideAvailable(int)), Qt::QueuedConnection);
111 
112  return true;
113 }
114 
115 
120 {
121  // Update transition animations
122  m_transition.Pulse(GetMythMainWindow()->GetDrawInterval());
123 
125 }
126 
127 
133 bool GallerySlideView::keyPressEvent(QKeyEvent *event)
134 {
135  if (GetFocusWidget()->keyPressEvent(event))
136  return true;
137 
138  QStringList actions;
139  bool handled = GetMythMainWindow()->TranslateKeyPress("Images", event, actions);
140 
141  for (int i = 0; i < actions.size() && !handled; i++)
142  {
143  QString action = actions[i];
144  handled = true;
145 
146  if (action == "LEFT")
147  ShowPrevSlide(1);
148  else if (action == "RIGHT")
149  ShowNextSlide(1);
150  else if (action == "UP")
151  ShowPrevSlide(10);
152  else if (action == "DOWN")
153  ShowNextSlide(10);
154  else if (action == "INFO")
155  ShowInfo();
156  else if (action == "MENU")
157  MenuMain();
158  else if (action == "PLAY")
159  {
160  if (m_playing)
161  Stop();
162  else
163  Play();
164  }
165  else if (action == "SELECT")
166  PlayVideo();
167  else if (action == "STOP")
168  Stop();
169  else if (action == "ROTRIGHT")
171  else if (action == "ROTLEFT")
173  else if (action == "FLIPHORIZONTAL")
175  else if (action == "FLIPVERTICAL")
177  else if (action == "ZOOMIN")
178  Zoom(10);
179  else if (action == "ZOOMOUT")
180  Zoom(-10);
181  else if (action == "FULLSIZE")
182  Zoom();
183  else if (action == "SCROLLUP")
184  Pan(QPoint(0, 100));
185  else if (action == "SCROLLDOWN")
186  Pan(QPoint(0, -100));
187  else if (action == "SCROLLLEFT")
188  Pan(QPoint(-120, 0));
189  else if (action == "SCROLLRIGHT")
190  Pan(QPoint(120, 0));
191  else if (action == "RECENTER")
192  Pan();
193  else if (action == "ESCAPE" && !GetMythMainWindow()->IsExitingToMain())
194  {
195  // Exit info details, if shown
196  handled = m_infoList.Hide();
197  }
198  else
199  {
200  handled = false;
201  }
202  }
203 
204  if (!handled)
205  handled = MythScreenType::keyPressEvent(event);
206 
207  return handled;
208 }
209 
210 
215 void GallerySlideView::customEvent(QEvent *event)
216 {
217  if (event->type() == MythEvent::MythEventMessage)
218  {
219  auto *me = dynamic_cast<MythEvent *>(event);
220  if (me == nullptr)
221  return;
222 
223  const QString& message = me->Message();
224 
225  QStringList extra = me->ExtraDataList();
226 
227  if (message == "IMAGE_METADATA" && !extra.isEmpty())
228  {
229  int id = extra[0].toInt();
230  ImagePtrK selected = m_view->GetSelected();
231 
232  if (selected && selected->m_id == id)
233  m_infoList.Display(*selected, extra.mid(1));
234  }
235  else if (message == "THUMB_AVAILABLE")
236  {
237  if (!extra.isEmpty() && m_view->Update(extra[0].toInt()))
238  ShowSlide(0);
239  }
240  }
241  else if (event->type() == DialogCompletionEvent::kEventType)
242  {
243  auto *dce = (DialogCompletionEvent *)(event);
244 
245  QString resultid = dce->GetId();
246  int buttonnum = dce->GetResult();
247 
248  if (resultid == "metadatamenu")
249  {
250  switch (buttonnum)
251  {
252  case 0: Transform(kRotateCW); break;
253  case 1: Transform(kRotateCCW); break;
254  case 2: Transform(kFlipHorizontal); break;
255  case 3: Transform(kFlipVertical); break;
256  case 4: Transform(kResetToExif); break;
257  case 5: Zoom(10); break;
258  case 6: Zoom(-10); break;
259  }
260  }
261  }
262 }
263 
264 
269 {
270  // Create the main menu that will contain the submenus above
271  auto *menu = new MythMenu(tr("Slideshow Options"), this, "mainmenu");
272 
274  if (im && im->m_type == kVideoFile)
275  menu->AddItem(tr("Play Video"), SLOT(PlayVideo()));
276 
277  if (m_playing)
278  menu->AddItem(tr("Stop"), SLOT(Stop()));
279  else
280  menu->AddItem(tr("Start SlideShow"), SLOT(Play()));
281 
282  if (gCoreContext->GetBoolSetting("GalleryRepeat", false))
283  menu->AddItem(tr("Turn Repeat Off"), SLOT(RepeatOff()));
284  else
285  menu->AddItem(tr("Turn Repeat On"), SLOT(RepeatOn()));
286 
288 
289  if (m_uiHideCaptions)
290  {
291  if (m_showCaptions)
292  menu->AddItem(tr("Hide Captions"), SLOT(HideCaptions()));
293  else
294  menu->AddItem(tr("Show Captions"), SLOT(ShowCaptions()));
295  }
296 
297  QString details;
298  switch (m_infoList.GetState())
299  {
300  case kBasicInfo: details = tr("More Details"); break;
301  case kFullInfo: details = tr("Less Details"); break;
302  default:
303  case kNoInfo: details = tr("Show Details"); break;
304  }
305  menu->AddItem(details, SLOT(ShowInfo()));
306 
307  if (m_infoList.GetState() != kNoInfo)
308  menu->AddItem(tr("Hide Details"), SLOT(HideInfo()));
309 
310  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
311  auto *menuPopup = new MythDialogBox(menu, popupStack, "menuPopup");
312  if (menuPopup->Create())
313  popupStack->AddScreen(menuPopup);
314  else
315  delete menuPopup;
316 }
317 
318 
324 {
326  if (im && !m_playing)
327  {
328  auto *menu = new MythMenu(tr("Transform Options"),
329  this, "metadatamenu");
330  if (m_editsAllowed)
331  {
332  menu->AddItem(tr("Rotate CW"));
333  menu->AddItem(tr("Rotate CCW"));
334  menu->AddItem(tr("Flip Horizontal"));
335  menu->AddItem(tr("Flip Vertical"));
336  menu->AddItem(tr("Reset to Exif"));
337  }
338 
339  if (m_slides.GetCurrent().CanZoomIn())
340  menu->AddItem(tr("Zoom In"));
341 
343  menu->AddItem(tr("Zoom Out"));
344 
345  mainMenu.AddItem(tr("Transforms"), nullptr, menu);
346  }
347 }
348 
349 
358 void GallerySlideView::Start(ImageSlideShowType type, int parentId, int selectedId)
359 {
360  gCoreContext->addListener(this);
361 
362  if (type == kBrowseSlides)
363  {
364  // Browsing views a single ordered directory
365  m_view = new FlatView(kOrdered);
366 
367  // Load db images
368  m_view->LoadFromDb(parentId);
369 
370  // Display current selection, falling back to first
371  m_view->Select(selectedId);
372 
373  // Display slide immediately
374  ShowSlide();
375  }
376  else
377  {
378  int orderInt = gCoreContext->GetNumSetting("GallerySlideOrder", kOrdered);
379 
380  SlideOrderType order = (orderInt < kOrdered) || (orderInt > kSeasonal)
381  ? kOrdered
382  : static_cast<SlideOrderType>(orderInt);
383 
384  // Recursive uses a view of a directory subtree; Normal views a single directory
385  m_view = (type == kRecursiveSlideShow) ? new TreeView(order)
386  : new FlatView(order);
387  // Load db images
388  m_view->LoadFromDb(parentId);
389 
390  // Ordered views start from selected image
391  if (order == kOrdered)
392  // Adjust view so that slideshows show count rather than position
393  m_view->Rotate(selectedId);
394 
395  // No transition for first image
396  Play(false);
397  }
398 }
399 
400 
402 {
404 
405  // Stop further loads
406  m_slides.Teardown();
407 
408  // Update gallerythumbview selection
409  ImagePtrK im = m_view->GetSelected();
410  if (im)
411  emit ImageSelected(im->m_id);
412 
414 }
415 
416 
421 {
422  m_playing = false;
423  m_timer.stop();
424  SetStatus(tr("Stopped"));
425 }
426 
427 
432 void GallerySlideView::Play(bool useTransition)
433 {
434  // Start from next slide
435  ShowNextSlide(1, useTransition);
436 
437  m_playing = true;
438  if (!m_suspended)
439  m_timer.start();
440  SetStatus(tr("Playing"), true);
441 }
442 
443 
448 {
449  m_timer.stop();
450  m_suspended = true;
451 }
452 
453 
458 {
459  m_suspended = false;
460  if (m_playing)
461  m_timer.start();
462 }
463 
464 
470 {
471  ImagePtrK im = m_view->GetSelected();
472  if (im && !m_playing)
473  {
474  ImageIdList list;
475  list.append(im->m_id);
476  QString err = m_mgr.ChangeOrientation(state, list);
477  if (!err.isEmpty())
478  ShowOkPopup(err);
479  }
480 }
481 
482 
487 void GallerySlideView::Zoom(int increment)
488 {
489  if (!m_playing)
490  m_slides.GetCurrent().Zoom(increment);
491 }
492 
493 
498 void GallerySlideView::Pan(QPoint offset)
499 {
500  if (!m_playing)
501  m_slides.GetCurrent().Pan(offset);
502 }
503 
504 
509 {
511 }
512 
513 
518 {
519  m_infoList.Hide();
520 }
521 
522 
527 {
528  m_showCaptions = true;
530 }
531 
532 
537 {
538  m_showCaptions = false;
539  m_uiHideCaptions->SetText(tr("Hide"));
540 }
541 
542 
547 void GallerySlideView::ShowSlide(int direction)
548 {
549  ImagePtrK im = m_view->GetSelected();
550  if (!im)
551  // Reached view limits
552  return;
553 
554  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Selected %1").arg(im->m_filePath));
555 
556  // Suspend the timer until the transition has finished
557  Suspend();
558 
559  // Load image from file
560  if (!m_slides.Load(im, direction))
561  // Image not yet available: show loading status
562  SetStatus(tr("Loading"), true);
563 }
564 
565 
572 {
573  // Transition speed = 0.5x for every slide waiting. Min = 1x, Max = Half buffer size
574  float speed = 0.5 + count / 2.0;
575 
576  // Are we transitioning ?
577  if (m_transitioning)
578  {
579  // More slides waiting for display: accelerate current transition
580  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Changing speed to %1").arg(speed));
581  m_transition.SetSpeed(speed);
582  return;
583  }
584 
585  // We've been waiting for this slide: transition immediately
586  m_transitioning = true;
587 
588  // Take next slide
589  Slide &next = m_slides.GetNext();
590 
591  // Update loading status
592  ClearStatus(next);
593 
594  // Update slide counts
595  if (m_uiSlideCount)
597 
598  int direction = next.GetDirection();
599 
600  // Use instant transition for start-up & updates (dir = 0)
601  // and browsing with transitions turned off
602  Transition &transition =
603  (direction != 0 &&
604  (m_playing || gCoreContext->GetBoolSetting("GalleryBrowseTransition", false)))
606 
607  // Reset any zoom before starting transition
608  Zoom();
609  transition.Start(m_slides.GetCurrent(), next, direction >= 0, speed);
610 }
611 
612 
620 {
621  if (m_IsDeleting)
622  return;
623 
624  m_transitioning = false;
625 
626  // Release old slide, which may start a new transition
628 
629  // No further actions when skipping
630  if (m_transitioning)
631  return;
632 
633  // Preload next slide, if any
635 
636  // Populate display for new slide
638 
639  // Update any file details information
640  m_infoList.Update(im);
641 
642  if (im && m_uiCaptionText)
643  {
644  // show the date & comment
645  QStringList text;
646  text << ImageManagerFe::LongDateOf(im);
647 
648  if (!im->m_comment.isEmpty())
649  text << im->m_comment;
650 
651  m_uiCaptionText->SetText(text.join(" - "));
652  }
653 
654  // Start any video unless we're paused or browsing
655  if (im && im->m_type == kVideoFile)
656  {
657  if (m_playing)
658  PlayVideo();
659  else
660  SetStatus(tr("Video"));
661  }
662 
663  // Resume slideshow timer
664  Release();
665 }
666 
667 
672 {
673  if (m_playing && m_view->HasPrev(inc) == nullptr)
674  {
675  // Prohibit back-wrapping during slideshow: it will cause premature end
676  //: Cannot go back beyond first slide of slideshow
677  SetStatus(tr("Start"));
678  }
679  else if (m_view->Prev(inc))
680  {
681  ShowSlide(-1);
682  }
683 }
684 
685 
691 void GallerySlideView::ShowNextSlide(int inc, bool useTransition)
692 {
693  // Browsing always wraps; slideshows depend on repeat setting
694  if (m_playing && m_view->HasNext(inc) == nullptr
695  && !gCoreContext->GetBoolSetting("GalleryRepeat", false))
696  {
697  // Don't stop due to jumping past end
698  if (inc == 1)
699  {
700  Stop();
701  //: Slideshow has reached last slide
702  SetStatus(tr("End"));
703  }
704  }
705  else if (m_view->Next(inc))
706  ShowSlide(useTransition ? 1 : 0);
707  else
708  {
709  // No images
710  Stop();
711  m_infoList.Hide();
713  if (m_uiSlideCount)
714  m_uiSlideCount->SetText("0/0");
715  if (m_uiCaptionText)
717  }
718 }
719 
720 
725 {
727  return;
728 
730 
731  if (im && im->m_type == kVideoFile)
732  GetMythMainWindow()->HandleMedia("Internal", im->m_url);
733 }
734 
735 
741 void GallerySlideView::SetStatus(QString msg, bool delay)
742 {
743  m_statusText = std::move(msg);
744  if (m_uiStatus)
745  {
746  if (delay)
747  m_delay.start();
748  else
749  ShowStatus();
750  }
751 }
752 
753 
755 {
756  if (m_uiStatus)
758 }
759 
760 
762 {
763  if (m_uiStatus)
764  {
765  m_delay.stop();
766 
767  if (slide.FailedLoad())
768  {
769  ImagePtrK im = slide.GetImageData();
770  SetStatus(tr("Failed to load %1").arg(im ? im->m_filePath : "?"));
771  }
772  else
773  m_uiStatus->Reset();
774  }
775 }
ImageManagerFe & m_mgr
Manages the images.
ImageSlideShowType
Type of slide show.
A video.
Definition: imagetypes.h:39
MythUIText * m_uiStatus
Slide & GetNext()
Definition: galleryslide.h:233
Shows just the most useful exif tags.
Definition: galleryinfo.h:17
void Zoom(int increment=0)
Zoom current slide.
A datastore of images for display by a screen.
Definition: galleryviews.h:98
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:91
QTimer m_delay
Status delay timer.
bool Select(int id, int fallback=0)
Selects first occurrence of an image.
bool CanZoomIn() const
Definition: galleryslide.h:170
bool TranslateKeyPress(const QString &context, QKeyEvent *e, QStringList &actions, bool allowJumps=true)
Get a list of actions for a keypress in the given context.
void ShowCaptions()
Show text widgets.
TransitionNone m_updateTransition
Instant transition that is always used for start-up & image updates.
MythConfirmationDialog * ShowOkPopup(const QString &message, QObject *parent, const char *slot, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Provides view datastores for Gallery screens.
bool Create(bool focusable)
Initialise buttonlist from XML.
Definition: galleryinfo.cpp:66
void Stop()
Stop a playing slideshow.
QString ChangeOrientation(ImageFileTransform transform, const ImageIdList &ids)
Apply an orientation transform to images.
Reset to Exif value.
Definition: imagemetadata.h:47
static Type MythEventMessage
Definition: mythevent.h:73
virtual void Pulse(int interval)=0
The image manager for use by Frontends.
Definition: imagemanager.h:456
void removeListener(QObject *listener)
Remove a listener to the observable.
bool m_suspended
True when transition is running or video playing.
GallerySlideView(MythScreenStack *parent, const char *name, bool editsAllowed)
Constructor.
void SetStatus(QString msg, bool delay=false)
Displays status text (Loading, Paused etc.)
static void RepeatOn(int on=1)
void Close() override
Basic menu dialog, message and a list of options.
void MenuMain()
Shows the popup menu.
void Release()
Unpause transition timer.
void ShowPrevSlide(int inc=1)
Display the previous slide in the sequence.
bool Load(const ImagePtrK &im, int direction)
Assign an image to next available slide, start loading and signal when done.
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:135
MythPainter * GetMythPainter(void)
static QString LongDateOf(const ImagePtrK &im)
Return a timestamp/datestamp for an image or dir.
void ShowInfo()
Show exif info list.
MythScreenStack * GetStack(const QString &stackname)
QTimer m_timer
Slide duration timer.
ImagePtrK HasPrev(int inc) const
Peeks at previous image in view but does not decrement iterator.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
virtual void SetSpeed(float)
bool Update(int id)
Updates view with images that have been updated.
void addListener(QObject *listener)
Add a listener to the observable.
void ShowSlide(int direction=0)
Display slide.
bool CanZoomOut() const
Definition: galleryslide.h:171
Biased random selection so that images are more likely to appear on anniversaries.
Definition: galleryviews.h:25
static MythThemedMenu * menu
void ReleaseCurrent()
Move head slide to back of queue and flush waiting slides.
void BuildFocusList(void)
static Type kEventType
Definition: mythdialogbox.h:56
QSharedPointer< ImageItemK > ImagePtrK
Definition: imagetypes.h:172
SlideOrderType
Order of images in slideshow.
Definition: galleryviews.h:21
void ImageSelected(int)
QString GetPosition() const
Get positional status.
virtual void Close()
void Transform(ImageFileTransform state)
Action transform request.
ImagePtrK GetImageData() const
Definition: galleryslide.h:165
MythUIText * m_uiSlideCount
ImageFileTransform
Image transformations.
Definition: imagemetadata.h:46
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
void Suspend()
Pause transition timer temporarily.
void Initialise(MythUIImage &image)
Construct buffer.
InfoVisibleState GetState() const
Definition: galleryinfo.h:33
void Preload(const ImagePtrK &im)
Load an image in next available slide.
void Update(const ImagePtrK &im)
Populates available exif details for the current image/dir.
void Rotate(int id)
Rotate view so that starting image is at front.
ImagePtrK GetSelected() const
Get current selection.
void MenuTransforms(MythMenu &mainMenu)
Add Transforms submenu.
void Pan(QPoint offset)
Initiate pan.
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitext.cpp:83
Reflect about horizontal axis.
Definition: imagemetadata.h:51
virtual void Pulse(void)
Pulse is called 70 times a second to trigger a single frame of an animation.
Definition: mythuitype.cpp:440
void Pan(QPoint offset=QPoint(0, 0))
Pan current slide.
SlideBuffer m_slides
A queue of slides used to display images.
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
A datastore of images for display by a screen. Provides an ordered list of images (no dirs) from a di...
Definition: galleryviews.h:214
void Play(bool useTransition=true)
Start a slideshow.
void customEvent(QEvent *event) override
Handle custom events.
int m_slideShowTime
Time to display a slide in a slideshow.
void Clear()
Reset slide to unused state.
Details not displayed.
Definition: galleryinfo.h:16
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
void AddItem(const QString &title, QVariant data=0, MythMenu *subMenu=nullptr, bool selected=false, bool checked=false)
MythUIType * GetFocusWidget(void) const
MythUIImage * m_uiImage
ImagePtrK Prev(int inc)
Decrements iterator and returns previous image. Wraps at start.
MythMainWindow * GetMythMainWindow(void)
void HideInfo()
Hide exif info list.
Shows all exif tags.
Definition: galleryinfo.h:18
void Toggle(const ImagePtrK &im)
Toggle infolist state for an image. Focusable widgets toggle between Basic & Full info....
Definition: galleryinfo.cpp:84
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
int GetNumSetting(const QString &key, int defaultval=0)
void ShowNextSlide(int inc=1, bool useTransition=true)
Display the next slide in the sequence.
MythUIText * m_uiHideCaptions
QList< int > ImageIdList
Definition: imagetypes.h:59
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
bool FailedLoad() const
Definition: galleryslide.h:174
void Zoom(int percentage)
Initiate slide zoom.
A specialised image for slideshows.
Definition: galleryslide.h:156
static void RepeatOff()
void ClearStatus(Slide &slide)
PictureAttribute next(PictureAttributeSupported Supported, PictureAttribute Attribute)
bool GetBoolSetting(const QString &key, bool defaultval=false)
void Pulse() override
Update transition.
Slideshow screen.
Base class of an animated transition that can be accelerated & reversed.
bool keyPressEvent(QKeyEvent *event) override
Handle keypresses.
void SlideAvailable(int count)
Start transition.
void Start(ImageSlideShowType type, int parentId, int selectedId=0)
Start slideshow.
bool m_transitioning
True when a transition is in progress.
virtual void Start(Slide &from, Slide &to, bool forwards, float speed=1.0)
Start base transition.
#define LOC
QString m_statusText
Text to display as status.
Rotate anti-clockwise.
Definition: imagemetadata.h:49
bool Hide()
Remove infolist from display.
ImagePtrK Next(int inc)
Advance iterator and return next image, wrapping if necessary. Regenerates unordered views on wrap.
void HideCaptions()
Hide text widgets.
MythUIText * m_uiCaptionText
Reflect about vertical axis.
Definition: imagemetadata.h:50
bool m_playing
True when slideshow is running.
bool SetFocusWidget(MythUIType *widget=nullptr)
bool m_showCaptions
If true, captions are shown.
Transition & m_transition
Selected transition.
virtual bool LoadFromDb(int parentId)
Populate view with database images from a directory.
void PlayVideo()
Starts internal player for video.
bool HandleMedia(const QString &handler, const QString &mrl, const QString &plot="", const QString &title="", const QString &subtitle="", const QString &director="", int season=0, int episode=0, const QString &inetref="", int lenMins=120, const QString &year="1895", const QString &id="", bool useBookmarks=false)
Screen in which all other widgets are contained and rendered.
Slide & GetCurrent()
Definition: galleryslide.h:227
bool m_editsAllowed
True when edits are enabled.
void Display(ImageItemK &im, const QStringList &tagStrings)
Build list of metadata tags.
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:41
InfoList m_infoList
Image details overlay.
Rotate clockwise.
Definition: imagemetadata.h:48
FlatView * m_view
List of images comprising the slideshow.
bool Create() override
Initialises the graphical elements.
ImagePtrK HasNext(int inc) const
Peeks at next image in view but does not advance iterator.
Ordered as per user setting GallerySortOrder.
Definition: galleryviews.h:22
void TransitionComplete()
Transition to new slide has finished.
~GallerySlideView() override
Destructor.