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  // Exit info details, if shown
195  handled = m_infoList.Hide();
196  else
197  handled = false;
198  }
199 
200  if (!handled)
201  handled = MythScreenType::keyPressEvent(event);
202 
203  return handled;
204 }
205 
206 
211 void GallerySlideView::customEvent(QEvent *event)
212 {
213  if (event->type() == MythEvent::MythEventMessage)
214  {
215  MythEvent *me = static_cast<MythEvent *>(event);
216  const QString& message = me->Message();
217 
218  QStringList extra = me->ExtraDataList();
219 
220  if (message == "IMAGE_METADATA" && !extra.isEmpty())
221  {
222  int id = extra[0].toInt();
223  ImagePtrK selected = m_view->GetSelected();
224 
225  if (selected && selected->m_id == id)
226  m_infoList.Display(*selected, extra.mid(1));
227  }
228  else if (message == "THUMB_AVAILABLE")
229  {
230  if (!extra.isEmpty() && m_view->Update(extra[0].toInt()))
231  ShowSlide(0);
232  }
233  }
234  else if (event->type() == DialogCompletionEvent::kEventType)
235  {
237 
238  QString resultid = dce->GetId();
239  int buttonnum = dce->GetResult();
240 
241  if (resultid == "metadatamenu")
242  {
243  switch (buttonnum)
244  {
245  case 0: Transform(kRotateCW); break;
246  case 1: Transform(kRotateCCW); break;
247  case 2: Transform(kFlipHorizontal); break;
248  case 3: Transform(kFlipVertical); break;
249  case 4: Transform(kResetToExif); break;
250  case 5: Zoom(10); break;
251  case 6: Zoom(-10); break;
252  }
253  }
254  }
255 }
256 
257 
262 {
263  // Create the main menu that will contain the submenus above
264  MythMenu *menu = new MythMenu(tr("Slideshow Options"), this, "mainmenu");
265 
267  if (im && im->m_type == kVideoFile)
268  menu->AddItem(tr("Play Video"), SLOT(PlayVideo()));
269 
270  if (m_playing)
271  menu->AddItem(tr("Stop"), SLOT(Stop()));
272  else
273  menu->AddItem(tr("Start SlideShow"), SLOT(Play()));
274 
275  if (gCoreContext->GetBoolSetting("GalleryRepeat", false))
276  menu->AddItem(tr("Turn Repeat Off"), SLOT(RepeatOff()));
277  else
278  menu->AddItem(tr("Turn Repeat On"), SLOT(RepeatOn()));
279 
281 
282  if (m_uiHideCaptions)
283  {
284  if (m_showCaptions)
285  menu->AddItem(tr("Hide Captions"), SLOT(HideCaptions()));
286  else
287  menu->AddItem(tr("Show Captions"), SLOT(ShowCaptions()));
288  }
289 
290  QString details;
291  switch (m_infoList.GetState())
292  {
293  case kBasicInfo: details = tr("More Details"); break;
294  case kFullInfo: details = tr("Less Details"); break;
295  default:
296  case kNoInfo: details = tr("Show Details"); break;
297  }
298  menu->AddItem(details, SLOT(ShowInfo()));
299 
300  if (m_infoList.GetState() != kNoInfo)
301  menu->AddItem(tr("Hide Details"), SLOT(HideInfo()));
302 
303  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
304  MythDialogBox *menuPopup = new MythDialogBox(menu, popupStack, "menuPopup");
305  if (menuPopup->Create())
306  popupStack->AddScreen(menuPopup);
307  else
308  delete menuPopup;
309 }
310 
311 
317 {
319  if (im && !m_playing)
320  {
321  MythMenu *menu = new MythMenu(tr("Transform Options"),
322  this, "metadatamenu");
323  if (m_editsAllowed)
324  {
325  menu->AddItem(tr("Rotate CW"));
326  menu->AddItem(tr("Rotate CCW"));
327  menu->AddItem(tr("Flip Horizontal"));
328  menu->AddItem(tr("Flip Vertical"));
329  menu->AddItem(tr("Reset to Exif"));
330  }
331 
332  if (m_slides.GetCurrent().CanZoomIn())
333  menu->AddItem(tr("Zoom In"));
334 
336  menu->AddItem(tr("Zoom Out"));
337 
338  mainMenu.AddItem(tr("Transforms"), nullptr, menu);
339  }
340 }
341 
342 
351 void GallerySlideView::Start(ImageSlideShowType type, int parentId, int selectedId)
352 {
353  gCoreContext->addListener(this);
354 
355  if (type == kBrowseSlides)
356  {
357  // Browsing views a single ordered directory
358  m_view = new FlatView(kOrdered);
359 
360  // Load db images
361  m_view->LoadFromDb(parentId);
362 
363  // Display current selection, falling back to first
364  m_view->Select(selectedId);
365 
366  // Display slide immediately
367  ShowSlide();
368  }
369  else
370  {
371  int orderInt = gCoreContext->GetNumSetting("GallerySlideOrder", kOrdered);
372 
373  SlideOrderType order = (orderInt < kOrdered) || (orderInt > kSeasonal)
374  ? kOrdered
375  : static_cast<SlideOrderType>(orderInt);
376 
377  // Recursive uses a view of a directory subtree; Normal views a single directory
378  m_view = (type == kRecursiveSlideShow) ? new TreeView(order)
379  : new FlatView(order);
380  // Load db images
381  m_view->LoadFromDb(parentId);
382 
383  // Ordered views start from selected image
384  if (order == kOrdered)
385  // Adjust view so that slideshows show count rather than position
386  m_view->Rotate(selectedId);
387 
388  // No transition for first image
389  Play(false);
390  }
391 }
392 
393 
395 {
397 
398  // Stop further loads
399  m_slides.Teardown();
400 
401  // Update gallerythumbview selection
402  ImagePtrK im = m_view->GetSelected();
403  if (im)
404  emit ImageSelected(im->m_id);
405 
407 }
408 
409 
414 {
415  m_playing = false;
416  m_timer.stop();
417  SetStatus(tr("Stopped"));
418 }
419 
420 
425 void GallerySlideView::Play(bool useTransition)
426 {
427  // Start from next slide
428  ShowNextSlide(1, useTransition);
429 
430  m_playing = true;
431  if (!m_suspended)
432  m_timer.start();
433  SetStatus(tr("Playing"), true);
434 }
435 
436 
441 {
442  m_timer.stop();
443  m_suspended = true;
444 }
445 
446 
451 {
452  m_suspended = false;
453  if (m_playing)
454  m_timer.start();
455 }
456 
457 
463 {
464  ImagePtrK im = m_view->GetSelected();
465  if (im && !m_playing)
466  {
467  ImageIdList list;
468  list.append(im->m_id);
469  QString err = m_mgr.ChangeOrientation(state, list);
470  if (!err.isEmpty())
471  ShowOkPopup(err);
472  }
473 }
474 
475 
480 void GallerySlideView::Zoom(int increment)
481 {
482  if (!m_playing)
483  m_slides.GetCurrent().Zoom(increment);
484 }
485 
486 
491 void GallerySlideView::Pan(QPoint offset)
492 {
493  if (!m_playing)
494  m_slides.GetCurrent().Pan(offset);
495 }
496 
497 
502 {
504 }
505 
506 
511 {
512  m_infoList.Hide();
513 }
514 
515 
520 {
521  m_showCaptions = true;
523 }
524 
525 
530 {
531  m_showCaptions = false;
532  m_uiHideCaptions->SetText(tr("Hide"));
533 }
534 
535 
540 void GallerySlideView::ShowSlide(int direction)
541 {
542  ImagePtrK im = m_view->GetSelected();
543  if (!im)
544  // Reached view limits
545  return;
546 
547  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Selected %1").arg(im->m_filePath));
548 
549  // Suspend the timer until the transition has finished
550  Suspend();
551 
552  // Load image from file
553  if (!m_slides.Load(im, direction))
554  // Image not yet available: show loading status
555  SetStatus(tr("Loading"), true);
556 }
557 
558 
565 {
566  // Transition speed = 0.5x for every slide waiting. Min = 1x, Max = Half buffer size
567  float speed = 0.5 + count / 2.0;
568 
569  // Are we transitioning ?
570  if (m_transitioning)
571  {
572  // More slides waiting for display: accelerate current transition
573  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Changing speed to %1").arg(speed));
574  m_transition.SetSpeed(speed);
575  return;
576  }
577 
578  // We've been waiting for this slide: transition immediately
579  m_transitioning = true;
580 
581  // Take next slide
582  Slide &next = m_slides.GetNext();
583 
584  // Update loading status
585  ClearStatus(next);
586 
587  // Update slide counts
588  if (m_uiSlideCount)
590 
591  int direction = next.GetDirection();
592 
593  // Use instant transition for start-up & updates (dir = 0)
594  // and browsing with transitions turned off
595  Transition &transition =
596  (direction != 0 &&
597  (m_playing || gCoreContext->GetBoolSetting("GalleryBrowseTransition", false)))
599 
600  // Reset any zoom before starting transition
601  Zoom();
602  transition.Start(m_slides.GetCurrent(), next, direction >= 0, speed);
603 }
604 
605 
613 {
614  if (m_IsDeleting)
615  return;
616 
617  m_transitioning = false;
618 
619  // Release old slide, which may start a new transition
621 
622  // No further actions when skipping
623  if (m_transitioning)
624  return;
625 
626  // Preload next slide, if any
628 
629  // Populate display for new slide
631 
632  // Update any file details information
633  m_infoList.Update(im);
634 
635  if (im && m_uiCaptionText)
636  {
637  // show the date & comment
638  QStringList text;
639  text << m_mgr.LongDateOf(im);
640 
641  if (!im->m_comment.isEmpty())
642  text << im->m_comment;
643 
644  m_uiCaptionText->SetText(text.join(" - "));
645  }
646 
647  // Start any video unless we're paused or browsing
648  if (im && im->m_type == kVideoFile)
649  {
650  if (m_playing)
651  PlayVideo();
652  else
653  SetStatus(tr("Video"));
654  }
655 
656  // Resume slideshow timer
657  Release();
658 }
659 
660 
665 {
666  if (m_playing && m_view->HasPrev(inc) == nullptr)
667  // Prohibit back-wrapping during slideshow: it will cause premature end
668  //: Cannot go back beyond first slide of slideshow
669  SetStatus(tr("Start"));
670 
671  else if (m_view->Prev(inc))
672  ShowSlide(-1);
673 }
674 
675 
681 void GallerySlideView::ShowNextSlide(int inc, bool useTransition)
682 {
683  // Browsing always wraps; slideshows depend on repeat setting
684  if (m_playing && m_view->HasNext(inc) == nullptr
685  && !gCoreContext->GetBoolSetting("GalleryRepeat", false))
686  {
687  // Don't stop due to jumping past end
688  if (inc == 1)
689  {
690  Stop();
691  //: Slideshow has reached last slide
692  SetStatus(tr("End"));
693  }
694  }
695  else if (m_view->Next(inc))
696  ShowSlide(useTransition ? 1 : 0);
697  else
698  {
699  // No images
700  Stop();
701  m_infoList.Hide();
703  if (m_uiSlideCount)
704  m_uiSlideCount->SetText("0/0");
705  if (m_uiCaptionText)
707  }
708 }
709 
710 
715 {
717  return;
718 
720 
721  if (im && im->m_type == kVideoFile)
722  GetMythMainWindow()->HandleMedia("Internal", im->m_url);
723 }
724 
725 
731 void GallerySlideView::SetStatus(QString msg, bool delay)
732 {
733  m_statusText = std::move(msg);
734  if (m_uiStatus)
735  {
736  if (delay)
737  m_delay.start();
738  else
739  ShowStatus();
740  }
741 }
742 
743 
745 {
746  if (m_uiStatus)
748 }
749 
750 
752 {
753  if (m_uiStatus)
754  {
755  m_delay.stop();
756 
757  if (slide.FailedLoad())
758  {
759  ImagePtrK im = slide.GetImageData();
760  SetStatus(tr("Failed to load %1").arg(im ? im->m_filePath : "?"));
761  }
762  else
763  m_uiStatus->Reset();
764  }
765 }
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:232
Shows just the most useful exif tags.
Definition: galleryinfo.h:17
A datastore of images for display by a screen.
Definition: galleryviews.h:95
QTimer m_delay
Status delay timer.
bool Select(int id, int fallback=0)
Selects first occurrence of an image.
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:91
bool CanZoomIn() const
Definition: galleryslide.h:169
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:43
static Type MythEventMessage
Definition: mythevent.h:66
virtual void Pulse(int interval)=0
The image manager for use by Frontends.
Definition: imagemanager.h:452
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.)
bool keyPressEvent(QKeyEvent *) override
Handle keypresses.
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:136
MythPainter * GetMythPainter(void)
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:170
Biased random selection so that images are more likely to appear on anniversaries.
Definition: galleryviews.h:22
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:50
SlideOrderType
Order of images in slideshow.
Definition: galleryviews.h:18
void ImageSelected(int)
QString GetPosition() const
Get positional status.
virtual void Close()
ImagePtrK GetImageData() const
Definition: galleryslide.h:164
MythUIText * m_uiSlideCount
ImageFileTransform
Image transformations.
Definition: imagemetadata.h:42
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
void Suspend()
Pause transition timer temporarily.
This class is used as a container for messages.
Definition: mythevent.h:16
QString LongDateOf(const ImagePtrK &) const
Return a timestamp/datestamp for an image or dir.
void Initialise(MythUIImage &image)
Construct buffer.
InfoVisibleState GetState() const
Definition: galleryinfo.h:33
void customEvent(QEvent *) override
Handle custom events.
void Preload(const ImagePtrK &im)
Load an image in next available slide.
void Rotate(int id)
Rotate view so that starting image is at front.
ImagePtrK GetSelected() const
Get current selection.
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:84
Reflect about horizontal axis.
Definition: imagemetadata.h:47
virtual void Pulse(void)
Pulse is called 70 times a second to trigger a single frame of an animation.
Definition: mythuitype.cpp:442
void MenuTransforms(MythMenu &)
Add Transforms submenu.
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:211
void Play(bool useTransition=true)
Start a slideshow.
int m_slideShowTime
Time to display a slide in a slideshow.
const char * name
Definition: ParseText.cpp:328
void Clear()
Reset slide to unused state.
Details not displayed.
Definition: galleryinfo.h:16
void Update(const ImagePtrK &)
Populates available exif details for the current image/dir.
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)
QSharedPointer< ImageItemK > ImagePtrK
Definition: imagetypes.h:179
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 RepeatOn(int on=1)
PictureAttribute next(PictureAttributeSupported supported, PictureAttribute attribute)
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
bool keyPressEvent(QKeyEvent *) override
Key event handler.
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
bool FailedLoad() const
Definition: galleryslide.h:173
void Zoom(int percentage)
Initiate slide zoom.
A specialised image for slideshows.
Definition: galleryslide.h:155
void ClearStatus(Slide &slide)
bool GetBoolSetting(const QString &key, bool defaultval=false)
void Transform(ImageFileTransform)
Action transform request.
void Toggle(const ImagePtrK &)
Toggle infolist state for an image. Focusable widgets toggle between Basic & Full info....
Definition: galleryinfo.cpp:84
void Pulse() override
Update transition.
Slideshow screen.
Base class of an animated transition that can be accelerated & reversed.
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:45
void Zoom(int=0)
Zoom current slide.
bool Hide()
Remove infolist from display.
ImagePtrK Next(int inc)
Advance iterator and return next image, wrapping if necessary. Regenerates unordered views on wrap.
~GallerySlideView()
Destructor.
void HideCaptions()
Hide text widgets.
void Pan(QPoint=QPoint(0, 0))
Pan current slide.
MythUIText * m_uiCaptionText
Reflect about vertical axis.
Definition: imagemetadata.h:46
bool m_playing
True when slideshow is running.
bool SetFocusWidget(MythUIType *widget=nullptr)
QList< int > ImageIdList
Definition: imagetypes.h:59
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:226
const QString & Message() const
Definition: mythevent.h:58
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:37
InfoList m_infoList
Image details overlay.
const QStringList & ExtraDataList() const
Definition: mythevent.h:60
Rotate clockwise.
Definition: imagemetadata.h:44
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:19
bool Create(void) override
void TransitionComplete()
Transition to new slide has finished.