MythTV  master
galleryslideview.cpp
Go to the documentation of this file.
1 // C++
2 #include <utility>
3 
4 // MythTV
9 #include "libmythui/mythuitext.h"
10 
11 // MythFrontend
12 #include "galleryslideview.h"
13 #include "galleryviews.h"
14 
15 #define LOC QString("Slideview: ")
16 
17 // EXIF tag 0x9286 UserComment can contain garbage
18 static QString clean_comment(const QString &comment)
19 {
20  QString result;
21  std::copy_if(comment.cbegin(), comment.cend(), std::back_inserter(result), [](QChar x) { return x.isPrint(); } );
22  return result;
23 }
24 
33  bool editsAllowed)
34  : MythScreenType(parent, name),
35  m_mgr(ImageManagerFe::getInstance()),
36  m_availableTransitions(GetMythPainter()->SupportsAnimation()),
37  m_transition(m_availableTransitions.Select(
38  gCoreContext->GetNumSetting("GalleryTransitionType",
40  m_infoList(*this),
41  m_slideShowTime(gCoreContext->GetDurSetting<std::chrono::milliseconds>("GallerySlideShowTime", 3s)),
42  m_showCaptions(gCoreContext->GetBoolSetting("GalleryShowSlideCaptions", true)),
43  m_editsAllowed(editsAllowed)
44 {
45  // Detect when transitions finish. Queued signal to allow redraw/pulse to
46  // complete before handling event.
48  this, &GallerySlideView::TransitionComplete, Qt::QueuedConnection);
50  this, &GallerySlideView::TransitionComplete, Qt::QueuedConnection);
51 
52  // Initialise slideshow timer
53  m_timer.setSingleShot(true);
54  m_timer.setInterval(m_slideShowTime);
55  connect(&m_timer, &QTimer::timeout,
56  this, qOverload<>(&GallerySlideView::ShowNextSlide));
57 
58  // Initialise status delay timer
59  m_delay.setSingleShot(true);
60  m_delay.setInterval(gCoreContext->GetDurSetting<std::chrono::milliseconds>("GalleryStatusDelay", 0s));
62 
64  LOG(VB_GUI, LOG_DEBUG, "Created Slideview");
65 }
66 
67 
72 {
73  delete m_view;
75  LOG(VB_GUI, LOG_DEBUG, "Deleted Slideview");
76 }
77 
78 
84 {
85  if (!LoadWindowFromXML("image-ui.xml", "slideshow", this))
86  return false;
87 
88  // Get widgets from XML
89  bool err = false;
90  UIUtilE::Assign(this, m_uiImage, "image", &err);
91  UIUtilW::Assign(this, m_uiStatus, "status");
92  UIUtilW::Assign(this, m_uiSlideCount, "slidecount");
93  UIUtilW::Assign(this, m_uiCaptionText, "caption");
94  UIUtilW::Assign(this, m_uiHideCaptions, "hidecaptions");
95 
96  if (err)
97  {
98  LOG(VB_GENERAL, LOG_ERR, LOC + "Cannot load screen 'Slideshow'");
99  return false;
100  }
101 
102  // Initialise details list
103  if (!m_infoList.Create(true))
104  {
105  LOG(VB_GENERAL, LOG_ERR, LOC + "Cannot load 'Info buttonlist'");
106  return false;
107  }
108 
109  // Create display buffer
111 
112  if (m_uiHideCaptions)
113  m_uiHideCaptions->SetText(m_showCaptions ? "" : tr("Hide"));
114 
115  BuildFocusList();
117 
118  // Detect when slides are available for display.
119  // Queue so that keypress events always complete before transition starts
121  this, &GallerySlideView::SlideAvailable, Qt::QueuedConnection);
122 
123  return true;
124 }
125 
126 
131 {
132  // Update transition animations
135 }
136 
137 
143 bool GallerySlideView::keyPressEvent(QKeyEvent *event)
144 {
145  if (GetFocusWidget()->keyPressEvent(event))
146  return true;
147 
148  QStringList actions;
149  bool handled = GetMythMainWindow()->TranslateKeyPress("Images", event, actions);
150 
151  for (int i = 0; i < actions.size() && !handled; i++)
152  {
153  const QString& action = actions[i];
154  handled = true;
155 
156  if (action == "LEFT")
157  ShowPrevSlide(1);
158  else if (action == "RIGHT")
159  ShowNextSlide(1);
160  else if (action == "UP")
161  ShowPrevSlide(10);
162  else if (action == "DOWN")
163  ShowNextSlide(10);
164  else if (action == "INFO")
165  ShowInfo();
166  else if (action == "MENU")
167  MenuMain();
168  else if (action == "PLAY")
169  {
170  if (m_playing)
171  Stop();
172  else
173  Play();
174  }
175  else if (action == "SELECT")
176  {
177  PlayVideo();
178  }
179  else if (action == "STOP")
180  {
181  Stop();
182  }
183  else if (action == "ROTRIGHT")
184  {
186  }
187  else if (action == "ROTLEFT")
188  {
190  }
191  else if (action == "FLIPHORIZONTAL")
192  {
194  }
195  else if (action == "FLIPVERTICAL")
196  {
198  }
199  else if (action == "ZOOMIN")
200  {
201  Zoom(10);
202  }
203  else if (action == "ZOOMOUT")
204  {
205  Zoom(-10);
206  }
207  else if (action == "FULLSIZE")
208  {
209  Zoom();
210  }
211  else if (action == "SCROLLUP")
212  {
213  Pan(QPoint(0, 100));
214  }
215  else if (action == "SCROLLDOWN")
216  {
217  Pan(QPoint(0, -100));
218  }
219  else if (action == "SCROLLLEFT")
220  {
221  Pan(QPoint(-120, 0));
222  }
223  else if (action == "SCROLLRIGHT")
224  {
225  Pan(QPoint(120, 0));
226  }
227  else if (action == "RECENTER")
228  {
229  Pan();
230  }
231  else if (action == "ESCAPE" && !GetMythMainWindow()->IsExitingToMain())
232  {
233  // Exit info details, if shown
234  handled = m_infoList.Hide();
235  }
236  else
237  {
238  handled = false;
239  }
240  }
241 
242  if (!handled)
243  handled = MythScreenType::keyPressEvent(event);
244 
245  return handled;
246 }
247 
248 
253 void GallerySlideView::customEvent(QEvent *event)
254 {
255  if (event->type() == MythEvent::kMythEventMessage)
256  {
257  auto *me = dynamic_cast<MythEvent *>(event);
258  if (me == nullptr)
259  return;
260 
261  const QString& message = me->Message();
262 
263  QStringList extra = me->ExtraDataList();
264 
265  if (message == "IMAGE_METADATA" && !extra.isEmpty())
266  {
267  int id = extra[0].toInt();
268  ImagePtrK selected = m_view->GetSelected();
269 
270  if (selected && selected->m_id == id)
271  m_infoList.Display(*selected, extra.mid(1));
272  }
273  else if (message == "THUMB_AVAILABLE")
274  {
275  if (!extra.isEmpty() && m_view->Update(extra[0].toInt()))
276  ShowSlide(0);
277  }
278  }
279  else if (event->type() == DialogCompletionEvent::kEventType)
280  {
281  auto *dce = (DialogCompletionEvent *)(event);
282 
283  QString resultid = dce->GetId();
284  int buttonnum = dce->GetResult();
285 
286  if (resultid == "metadatamenu")
287  {
288  switch (buttonnum)
289  {
290  case 0: Transform(kRotateCW); break;
291  case 1: Transform(kRotateCCW); break;
292  case 2: Transform(kFlipHorizontal); break;
293  case 3: Transform(kFlipVertical); break;
294  case 4: Transform(kResetToExif); break;
295  case 5: Zoom(10); break;
296  case 6: Zoom(-10); break;
297  }
298  }
299  }
300 }
301 
302 
307 {
308  // Create the main menu that will contain the submenus above
309  auto *menu = new MythMenu(tr("Slideshow Options"), this, "mainmenu");
310 
312  if (im && im->m_type == kVideoFile)
313  menu->AddItem(tr("Play Video"), qOverload<>(&GallerySlideView::PlayVideo));
314 
315  if (m_playing)
316  menu->AddItem(tr("Stop"), &GallerySlideView::Stop);
317  else
318  menu->AddItem(tr("Start SlideShow"), qOverload<>(&GallerySlideView::Play));
319 
320  if (gCoreContext->GetBoolSetting("GalleryRepeat", false))
321  menu->AddItem(tr("Turn Repeat Off"), &GallerySlideView::RepeatOff);
322  else
323  menu->AddItem(tr("Turn Repeat On"), qOverload<>(&GallerySlideView::RepeatOn));
324 
326 
327  if (m_uiHideCaptions)
328  {
329  if (m_showCaptions)
330  menu->AddItem(tr("Hide Captions"), &GallerySlideView::HideCaptions);
331  else
332  menu->AddItem(tr("Show Captions"), &GallerySlideView::ShowCaptions);
333  }
334 
335  QString details;
336  switch (m_infoList.GetState())
337  {
338  case kBasicInfo: details = tr("More Details"); break;
339  case kFullInfo: details = tr("Less Details"); break;
340  default:
341  case kNoInfo: details = tr("Show Details"); break;
342  }
343  menu->AddItem(details, &GallerySlideView::ShowInfo);
344 
345  if (m_infoList.GetState() != kNoInfo)
346  menu->AddItem(tr("Hide Details"), &GallerySlideView::HideInfo);
347 
348  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
349  auto *menuPopup = new MythDialogBox(menu, popupStack, "menuPopup");
350  if (menuPopup->Create())
351  popupStack->AddScreen(menuPopup);
352  else
353  delete menuPopup;
354 }
355 
356 
362 {
364  if (im && !m_playing)
365  {
366  auto *menu = new MythMenu(tr("Transform Options"),
367  this, "metadatamenu");
368  if (m_editsAllowed)
369  {
370  menu->AddItem(tr("Rotate CW"));
371  menu->AddItem(tr("Rotate CCW"));
372  menu->AddItem(tr("Flip Horizontal"));
373  menu->AddItem(tr("Flip Vertical"));
374  menu->AddItem(tr("Reset to Exif"));
375  }
376 
377  if (m_slides.GetCurrent().CanZoomIn())
378  menu->AddItem(tr("Zoom In"));
379 
381  menu->AddItem(tr("Zoom Out"));
382 
383  mainMenu.AddItem(tr("Transforms"), nullptr, menu);
384  }
385 }
386 
387 
396 void GallerySlideView::Start(ImageSlideShowType type, int parentId, int selectedId)
397 {
398  gCoreContext->addListener(this);
399 
400  if (type == kBrowseSlides)
401  {
402  // Browsing views a single ordered directory
403  m_view = new FlatView(kOrdered);
404 
405  // Load db images
406  m_view->LoadFromDb(parentId);
407 
408  // Display current selection, falling back to first
409  m_view->Select(selectedId);
410 
411  // Display slide immediately
412  ShowSlide();
413  }
414  else
415  {
416  int orderInt = gCoreContext->GetNumSetting("GallerySlideOrder", kOrdered);
417 
418  SlideOrderType order = (orderInt < kOrdered) || (orderInt > kSeasonal)
419  ? kOrdered
420  : static_cast<SlideOrderType>(orderInt);
421 
422  // Recursive uses a view of a directory subtree; Normal views a single directory
423  m_view = (type == kRecursiveSlideShow) ? new TreeView(order)
424  : new FlatView(order);
425  // Load db images
426  m_view->LoadFromDb(parentId);
427 
428  // Ordered views start from selected image
429  if (order == kOrdered)
430  // Adjust view so that slideshows show count rather than position
431  m_view->Rotate(selectedId);
432 
433  // No transition for first image
434  Play(false);
435  }
436 }
437 
438 
440 {
442 
443  // Stop further loads
444  m_slides.Teardown();
445 
446  // Update gallerythumbview selection
447  ImagePtrK im = m_view->GetSelected();
448  if (im)
449  emit ImageSelected(im->m_id);
450 
452 }
453 
454 
459 {
460  m_playing = false;
461  m_timer.stop();
462  SetStatus(tr("Stopped"));
463 }
464 
465 
470 void GallerySlideView::Play(bool useTransition)
471 {
472  // Start from next slide
473  ShowNextSlide(1, useTransition);
474 
475  m_playing = true;
476  if (!m_suspended)
477  m_timer.start();
478  SetStatus(tr("Playing"), true);
479 }
480 
481 
486 {
487  m_timer.stop();
488  m_suspended = true;
489 }
490 
491 
496 {
497  m_suspended = false;
498  if (m_playing)
499  m_timer.start();
500 }
501 
502 
508 {
509  ImagePtrK im = m_view->GetSelected();
510  if (im && !m_playing)
511  {
512  ImageIdList list;
513  list.append(im->m_id);
514  QString err = m_mgr.ChangeOrientation(state, list);
515  if (!err.isEmpty())
516  ShowOkPopup(err);
517  }
518 }
519 
520 
525 void GallerySlideView::Zoom(int increment)
526 {
527  if (!m_playing)
528  m_slides.GetCurrent().Zoom(increment);
529 }
530 
531 
536 void GallerySlideView::Pan(QPoint offset)
537 {
538  if (!m_playing)
539  m_slides.GetCurrent().Pan(offset);
540 }
541 
542 
547 {
549 }
550 
551 
556 {
557  m_infoList.Hide();
558 }
559 
560 
565 {
566  m_showCaptions = true;
568 }
569 
570 
575 {
576  m_showCaptions = false;
577  m_uiHideCaptions->SetText(tr("Hide"));
578 }
579 
580 
585 void GallerySlideView::ShowSlide(int direction)
586 {
587  ImagePtrK im = m_view->GetSelected();
588  if (!im)
589  // Reached view limits
590  return;
591 
592  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Selected %1").arg(im->m_filePath));
593 
594  // Suspend the timer until the transition has finished
595  Suspend();
596 
597  // Load image from file
598  if (!m_slides.Load(im, direction))
599  // Image not yet available: show loading status
600  SetStatus(tr("Loading"), true);
601 }
602 
603 
610 {
611  // Transition speed = 0.5x for every slide waiting. Min = 1x, Max = Half buffer size
612  float speed = 0.5 + (count / 2.0);
613 
614  // Are we transitioning ?
615  if (m_transitioning)
616  {
617  // More slides waiting for display: accelerate current transition
618  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Changing speed to %1").arg(speed));
619  m_transition.SetSpeed(speed);
620  return;
621  }
622 
623  // We've been waiting for this slide: transition immediately
624  m_transitioning = true;
625 
626  // Take next slide
627  Slide &next = m_slides.GetNext();
628 
629  // Update loading status
630  ClearStatus(next);
631 
632  // Update slide counts
633  if (m_uiSlideCount)
635 
636  int direction = next.GetDirection();
637 
638  // Use instant transition for start-up & updates (dir = 0)
639  // and browsing with transitions turned off
640  Transition &transition =
641  (direction != 0 &&
642  (m_playing || gCoreContext->GetBoolSetting("GalleryBrowseTransition", false)))
644 
645  // Reset any zoom before starting transition
646  Zoom();
647  transition.Start(m_slides.GetCurrent(), next, direction >= 0, speed);
648 }
649 
650 
658 {
659  if (m_isDeleting)
660  return;
661 
662  m_transitioning = false;
663 
664  // Release old slide, which may start a new transition
666 
667  // No further actions when skipping
668  // cppcheck-suppress knownConditionTrueFalse
669  if (m_transitioning)
670  return;
671 
672  // Preload next slide, if any
674 
675  // Populate display for new slide
677 
678  // Update any file details information
679  m_infoList.Update(im);
680 
681  if (im && m_uiCaptionText)
682  {
683  // show the date & comment
684  QStringList text;
685  text << ImageManagerFe::LongDateOf(im);
686 
687  QString comment = clean_comment(im->m_comment);
688  if (!comment.isEmpty())
689  text << comment;
690 
691  m_uiCaptionText->SetText(text.join(" - "));
692  }
693 
694  // Start any video unless we're paused or browsing
695  if (im && im->m_type == kVideoFile)
696  {
697  if (m_playing)
698  PlayVideo();
699  else
700  SetStatus(tr("Video"));
701  }
702 
703  // Resume slideshow timer
704  Release();
705 }
706 
707 
712 {
713  if (m_playing && m_view->HasPrev(inc) == nullptr)
714  {
715  // Prohibit back-wrapping during slideshow: it will cause premature end
716  //: Cannot go back beyond first slide of slideshow
717  SetStatus(tr("Start"));
718  }
719  else if (m_view->Prev(inc))
720  {
721  ShowSlide(-1);
722  }
723 }
724 
725 
731 void GallerySlideView::ShowNextSlide(int inc, bool useTransition)
732 {
733  // Browsing always wraps; slideshows depend on repeat setting
734  if (m_playing && m_view->HasNext(inc) == nullptr
735  && !gCoreContext->GetBoolSetting("GalleryRepeat", false))
736  {
737  // Don't stop due to jumping past end
738  if (inc == 1)
739  {
740  Stop();
741  //: Slideshow has reached last slide
742  SetStatus(tr("End"));
743  }
744  }
745  else if (m_view->Next(inc))
746  {
747  ShowSlide(useTransition ? 1 : 0);
748  }
749  else
750  {
751  // No images
752  Stop();
753  m_infoList.Hide();
755  if (m_uiSlideCount)
756  m_uiSlideCount->SetText("0/0");
757  if (m_uiCaptionText)
759  }
760 }
762 {
763  ShowNextSlide(1, true);
764 }
765 
766 
771 {
773  return;
774 
776 
777  if (im && im->m_type == kVideoFile)
778  GetMythMainWindow()->HandleMedia("Internal", im->m_url);
779 }
780 
781 
787 void GallerySlideView::SetStatus(QString msg, bool delay)
788 {
789  m_statusText = std::move(msg);
790  if (m_uiStatus)
791  {
792  if (delay)
793  m_delay.start();
794  else
795  ShowStatus();
796  }
797 }
798 
799 
801 {
802  if (m_uiStatus)
804 }
805 
806 
808 {
809  if (m_uiStatus)
810  {
811  m_delay.stop();
812 
813  if (slide.FailedLoad())
814  {
815  ImagePtrK im = slide.GetImageData();
816  SetStatus(tr("Failed to load %1").arg(im ? im->m_filePath : "?"));
817  }
818  else
819  {
820  m_uiStatus->Reset();
821  }
822  }
823 }
824 
826 {
827  gCoreContext->SaveSetting("GalleryRepeat", on);
828 }
SlideBuffer::GetNext
Slide & GetNext()
Definition: galleryslide.h:233
TreeView
A datastore of images for display by a screen. Provides an ordered list of images (no dirs) from a di...
Definition: galleryviews.h:217
ImagePtrK
QSharedPointer< ImageItemK > ImagePtrK
Definition: imagetypes.h:165
Slide
A specialised image for slideshows.
Definition: galleryslide.h:156
SlideOrderType
SlideOrderType
Order of images in slideshow.
Definition: galleryviews.h:24
InfoList::Display
void Display(ImageItemK &im, const QStringList &tagStrings)
Build list of metadata tags.
Definition: galleryinfo.cpp:225
FlatView::HasNext
ImagePtrK HasNext(int inc) const
Peeks at next image in view but does not advance iterator.
Definition: galleryviews.cpp:155
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:101
mythuitext.h
ImageFileTransform
ImageFileTransform
Image transformations.
Definition: imagemetadata.h:46
MythEvent::kMythEventMessage
static const Type kMythEventMessage
Definition: mythevent.h:79
MythUIText::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitext.cpp:65
clean_comment
static QString clean_comment(const QString &comment)
Definition: galleryslideview.cpp:18
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:507
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:384
GallerySlideView::m_uiSlideCount
MythUIText * m_uiSlideCount
Definition: galleryslideview.h:76
SlideBuffer::SlideReady
void SlideReady(int count)
Signals that buffer has (count) loaded slides awaiting display.
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
FlatView::Rotate
void Rotate(int id)
Rotate view so that starting image is at front.
Definition: galleryviews.cpp:430
FlatView::LoadFromDb
virtual bool LoadFromDb(int parentId)
Populate view with database images from a directory.
Definition: galleryviews.cpp:371
MythEvent
This class is used as a container for messages.
Definition: mythevent.h:16
MythMenu::AddItem
void AddItem(const QString &title)
Definition: mythdialogbox.h:109
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
MythMainWindow::RestoreScreensaver
static void RestoreScreensaver()
Definition: mythmainwindow.cpp:576
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:253
GallerySlideView::Start
void Start(ImageSlideShowType type, int parentId, int selectedId=0)
Start slideshow.
Definition: galleryslideview.cpp:396
InfoList::Update
void Update(const ImagePtrK &im)
Populates available exif details for the current image/dir.
Definition: galleryinfo.cpp:199
GallerySlideView::m_transitioning
bool m_transitioning
True when a transition is in progress.
Definition: galleryslideview.h:97
LOC
#define LOC
Definition: galleryslideview.cpp:15
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
GallerySlideView::m_uiHideCaptions
MythUIText * m_uiHideCaptions
Definition: galleryslideview.h:78
FlatView
A datastore of images for display by a screen.
Definition: galleryviews.h:101
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:657
Slide::CanZoomIn
bool CanZoomIn() const
Definition: galleryslide.h:170
GallerySlideView::Suspend
void Suspend()
Pause transition timer temporarily.
Definition: galleryslideview.cpp:485
Transition
Base class of an animated transition that can be accelerated & reversed.
Definition: gallerytransitions.h:28
FlatView::GetPosition
QString GetPosition() const
Get positional status.
Definition: galleryviews.cpp:78
GallerySlideView::m_uiImage
MythUIImage * m_uiImage
Definition: galleryslideview.h:74
MythUIType::Pulse
virtual void Pulse(void)
Pulse is called 70 times a second to trigger a single frame of an animation.
Definition: mythuitype.cpp:456
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:458
FlatView::Select
bool Select(int id, int fallback=0)
Selects first occurrence of an image.
Definition: galleryviews.cpp:120
kVideoFile
@ kVideoFile
A video.
Definition: imagetypes.h:40
MythEvent::Message
const QString & Message() const
Definition: mythevent.h:65
MythMainWindow::HandleMedia
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="", std::chrono::minutes LenMins=2h, const QString &Year="1895", const QString &Id="", bool UseBookmarks=false)
Definition: mythmainwindow.cpp:1496
true
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:95
GallerySlideView::SlideAvailable
void SlideAvailable(int count)
Start transition.
Definition: galleryslideview.cpp:609
FlatView::Prev
ImagePtrK Prev(int inc)
Decrements iterator and returns previous image. Wraps at start.
Definition: galleryviews.cpp:200
GallerySlideView::GallerySlideView
GallerySlideView(MythScreenStack *parent, const char *name, bool editsAllowed)
Constructor.
Definition: galleryslideview.cpp:32
ImageManagerFe::ChangeOrientation
QString ChangeOrientation(ImageFileTransform transform, const ImageIdList &ids)
Apply an orientation transform to images.
Definition: imagemanager.cpp:2111
GallerySlideView::PlayVideo
void PlayVideo()
Starts internal player for video.
Definition: galleryslideview.cpp:770
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:111
FlatView::Update
bool Update(int id)
Updates view with images that have been updated.
Definition: galleryviews.cpp:89
MythObservable::addListener
void addListener(QObject *listener)
Add a listener to the observable.
Definition: mythobservable.cpp:38
SlideBuffer::ReleaseCurrent
void ReleaseCurrent()
Move head slide to back of queue and flush waiting slides.
Definition: galleryslide.cpp:717
MythMainWindow::DisableScreensaver
static void DisableScreensaver()
Definition: mythmainwindow.cpp:582
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:574
kBasicInfo
@ kBasicInfo
Shows just the most useful exif tags.
Definition: galleryinfo.h:18
GallerySlideView::RepeatOn
static void RepeatOn()
Definition: galleryslideview.h:63
SlideBuffer::Load
bool Load(const ImagePtrK &im, int direction)
Assign an image to next available slide, start loading and signal when done.
Definition: galleryslide.cpp:670
GallerySlideView::ShowPrevSlide
void ShowPrevSlide(int inc=1)
Display the previous slide in the sequence.
Definition: galleryslideview.cpp:711
mythlogging.h
GallerySlideView::m_view
FlatView * m_view
List of images comprising the slideshow.
Definition: galleryslideview.h:81
SlideBuffer::Teardown
void Teardown()
Definition: galleryslide.cpp:595
InfoList::Toggle
void Toggle(const ImagePtrK &im)
Toggle infolist state for an image. Focusable widgets toggle between Basic & Full info....
Definition: galleryinfo.cpp:86
Slide::CanZoomOut
bool CanZoomOut() const
Definition: galleryslide.h:171
MythMainWindow::TranslateKeyPress
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
Definition: mythmainwindow.cpp:1111
GallerySlideView::ClearStatus
void ClearStatus(const Slide &slide)
Definition: galleryslideview.cpp:807
Transition::Start
virtual void Start(Slide &from, Slide &to, bool forwards, float speed=1.0)
Start base transition.
Definition: gallerytransitions.cpp:81
GallerySlideView::Close
void Close() override
Definition: galleryslideview.cpp:439
GallerySlideView::m_delay
QTimer m_delay
Status delay timer.
Definition: galleryslideview.h:92
MythScreenType::SetFocusWidget
bool SetFocusWidget(MythUIType *widget=nullptr)
Definition: mythscreentype.cpp:116
kFlipVertical
@ kFlipVertical
Reflect about horizontal axis.
Definition: imagemetadata.h:51
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:165
Slide::Clear
void Clear()
Reset slide to unused state.
Definition: galleryslide.cpp:337
menu
static MythThemedMenu * menu
Definition: mythtv-setup.cpp:58
FlatView::HasPrev
ImagePtrK HasPrev(int inc) const
Peeks at previous image in view but does not decrement iterator.
Definition: galleryviews.cpp:189
MythCoreContext::GetDurSetting
std::enable_if_t< std::chrono::__is_duration< T >::value, T > GetDurSetting(const QString &key, T defaultval=T::zero())
Definition: mythcorecontext.h:147
Slide::Pan
void Pan(QPoint offset)
Initiate pan.
Definition: galleryslide.cpp:509
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:204
GallerySlideView::m_slideShowTime
std::chrono::milliseconds m_slideShowTime
Time to display a slide in a slideshow.
Definition: galleryslideview.h:90
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:525
GallerySlideView::m_uiStatus
MythUIText * m_uiStatus
Definition: galleryslideview.h:75
GallerySlideView::ShowNextSlide
void ShowNextSlide()
Definition: galleryslideview.cpp:761
kFullInfo
@ kFullInfo
Shows all exif tags.
Definition: galleryinfo.h:19
kRecursiveSlideShow
@ kRecursiveSlideShow
Definition: galleryslideview.h:18
kBlendTransition
@ kBlendTransition
Definition: gallerytransitions.h:18
ImageManagerFe::LongDateOf
static QString LongDateOf(const ImagePtrK &im)
Return a timestamp/datestamp for an image or dir.
Definition: imagemanager.cpp:2346
GallerySlideView::Play
void Play()
Definition: galleryslideview.h:61
Slide::GetImageData
ImagePtrK GetImageData() const
Definition: galleryslide.h:165
FlatView::GetSelected
ImagePtrK GetSelected() const
Get current selection.
Definition: galleryviews.cpp:67
kBrowseSlides
@ kBrowseSlides
Definition: galleryslideview.h:16
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
InfoList::GetState
InfoVisibleState GetState() const
Definition: galleryinfo.h:34
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:83
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:918
SlideBuffer::Preload
void Preload(const ImagePtrK &im)
Load an image in next available slide.
Definition: galleryslide.cpp:695
UIUtilDisp::Assign
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
GallerySlideView::ShowSlide
void ShowSlide(int direction=0)
Display slide.
Definition: galleryslideview.cpp:585
FlatView::Next
ImagePtrK Next(int inc)
Advance iterator and return next image, wrapping if necessary. Regenerates unordered views on wrap.
Definition: galleryviews.cpp:167
GallerySlideView::m_statusText
QString m_statusText
Text to display as status.
Definition: galleryslideview.h:93
SlideBuffer::Initialise
void Initialise(MythUIImage &image)
Construct buffer.
Definition: galleryslide.cpp:609
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:912
InfoList::Hide
bool Hide()
Remove infolist from display.
Definition: galleryinfo.cpp:122
GallerySlideView::ShowCaptions
void ShowCaptions()
Show text widgets.
Definition: galleryslideview.cpp:564
ImageSlideShowType
ImageSlideShowType
Type of slide show.
Definition: galleryslideview.h:15
GallerySlideView::m_uiCaptionText
MythUIText * m_uiCaptionText
Definition: galleryslideview.h:77
Slide::Zoom
void Zoom(int percentage)
Initiate slide zoom.
Definition: galleryslide.cpp:464
MythMenu
Definition: mythdialogbox.h:98
galleryviews.h
Provides view datastores for Gallery screens.
MythScreenType::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythscreentype.cpp:402
GallerySlideView::ImageSelected
void ImageSelected(int)
MythScreenType::m_isDeleting
bool m_isDeleting
Definition: mythscreentype.h:117
GallerySlideView::SetStatus
void SetStatus(QString msg, bool delay=false)
Displays status text (Loading, Paused etc.)
Definition: galleryslideview.cpp:787
mythcorecontext.h
ImageManagerFe
The image manager for use by Frontends.
Definition: imagemanager.h:455
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:701
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:71
kFlipHorizontal
@ kFlipHorizontal
Reflect about vertical axis.
Definition: imagemetadata.h:50
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:40
GallerySlideView::MenuTransforms
void MenuTransforms(MythMenu &mainMenu)
Add Transforms submenu.
Definition: galleryslideview.cpp:361
galleryslideview.h
Slideshow screen.
Slide::GetDirection
int GetDirection() const
Definition: galleryslide.h:175
ImageIdList
QList< int > ImageIdList
Definition: imagetypes.h:60
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:115
DialogCompletionEvent::kEventType
static const Type kEventType
Definition: mythdialogbox.h:56
kResetToExif
@ kResetToExif
Reset to Exif value.
Definition: imagemetadata.h:47
GallerySlideView::ShowStatus
void ShowStatus()
Definition: galleryslideview.cpp:800
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:104
Transition::Pulse
virtual void Pulse()=0
Transition::SetSpeed
virtual void SetSpeed(float)
Definition: gallerytransitions.h:36
kRotateCCW
@ kRotateCCW
Rotate anti-clockwise.
Definition: imagemetadata.h:49
build_compdb.action
action
Definition: build_compdb.py:9
GallerySlideView::HideInfo
void HideInfo()
Hide exif info list.
Definition: galleryslideview.cpp:555
kSeasonal
@ kSeasonal
Biased random selection so that images are more likely to appear on anniversaries.
Definition: galleryviews.h:28
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:322
GallerySlideView::Release
void Release()
Unpause transition timer.
Definition: galleryslideview.cpp:495
Transition::finished
void finished()
GallerySlideView::ShowInfo
void ShowInfo()
Show exif info list.
Definition: galleryslideview.cpp:546
kOrdered
@ kOrdered
Ordered as per user setting GallerySortOrder.
Definition: galleryviews.h:25
InfoList::Create
bool Create(bool focusable)
Initialise buttonlist from XML.
Definition: galleryinfo.cpp:68
GallerySlideView::Pan
void Pan(QPoint offset=QPoint(0, 0))
Pan current slide.
Definition: galleryslideview.cpp:536
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:887
SlideBuffer::GetCurrent
Slide & GetCurrent()
Definition: galleryslide.h:227
GetMythPainter
MythPainter * GetMythPainter(void)
Definition: mythmainwindow.cpp:119
GallerySlideView::m_timer
QTimer m_timer
Slide duration timer.
Definition: galleryslideview.h:91
Slide::FailedLoad
bool FailedLoad() const
Definition: galleryslide.h:174
kRotateCW
@ kRotateCW
Rotate clockwise.
Definition: imagemetadata.h:48
GallerySlideView::Pulse
void Pulse() override
Update transition.
Definition: galleryslideview.cpp:130
GallerySlideView::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Handle keypresses.
Definition: galleryslideview.cpp:143
mythmainwindow.h
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:52
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:566
MythObservable::removeListener
void removeListener(QObject *listener)
Remove a listener to the observable.
Definition: mythobservable.cpp:55
GallerySlideView::MenuMain
void MenuMain()
Shows the popup menu.
Definition: galleryslideview.cpp:306
GallerySlideView::RepeatOff
static void RepeatOff()
Definition: galleryslideview.h:64
kNoInfo
@ kNoInfo
Details not displayed.
Definition: galleryinfo.h:17