MythTV  master
galleryslideview.cpp
Go to the documentation of this file.
1 // C++
2 #include <utility>
3 
4 // MythTV
7 #include "libmythui/mythuitext.h"
8 
9 // MythFrontend
10 #include "galleryslideview.h"
11 #include "galleryviews.h"
12 
13 #define LOC QString("Slideview: ")
14 
15 // EXIF tag 0x9286 UserComment can contain garbage
16 static QString clean_comment(const QString &comment)
17 {
18  QString result;
19  std::copy_if(comment.cbegin(), comment.cend(), std::back_inserter(result), [](QChar x) { return x.isPrint(); } );
20  return result;
21 }
22 
31  bool editsAllowed)
32  : MythScreenType(parent, name),
33  m_mgr(ImageManagerFe::getInstance()),
34  m_availableTransitions(GetMythPainter()->SupportsAnimation()),
35  m_transition(m_availableTransitions.Select(
36  gCoreContext->GetNumSetting("GalleryTransitionType",
38  m_infoList(*this),
39  m_slideShowTime(gCoreContext->GetDurSetting<std::chrono::milliseconds>("GallerySlideShowTime", 3s)),
40  m_showCaptions(gCoreContext->GetBoolSetting("GalleryShowSlideCaptions", true)),
41  m_editsAllowed(editsAllowed)
42 {
43  // Detect when transitions finish. Queued signal to allow redraw/pulse to
44  // complete before handling event.
46  this, &GallerySlideView::TransitionComplete, Qt::QueuedConnection);
48  this, &GallerySlideView::TransitionComplete, Qt::QueuedConnection);
49 
50  // Initialise slideshow timer
51  m_timer.setSingleShot(true);
52  m_timer.setInterval(m_slideShowTime);
53  connect(&m_timer, &QTimer::timeout,
54  this, qOverload<>(&GallerySlideView::ShowNextSlide));
55 
56  // Initialise status delay timer
57  m_delay.setSingleShot(true);
58  m_delay.setInterval(gCoreContext->GetDurSetting<std::chrono::milliseconds>("GalleryStatusDelay", 0s));
60 
62  LOG(VB_GUI, LOG_DEBUG, "Created Slideview");
63 }
64 
65 
70 {
71  delete m_view;
73  LOG(VB_GUI, LOG_DEBUG, "Deleted Slideview");
74 }
75 
76 
82 {
83  if (!LoadWindowFromXML("image-ui.xml", "slideshow", this))
84  return false;
85 
86  // Get widgets from XML
87  bool err = false;
88  UIUtilE::Assign(this, m_uiImage, "image", &err);
89  UIUtilW::Assign(this, m_uiStatus, "status");
90  UIUtilW::Assign(this, m_uiSlideCount, "slidecount");
91  UIUtilW::Assign(this, m_uiCaptionText, "caption");
92  UIUtilW::Assign(this, m_uiHideCaptions, "hidecaptions");
93 
94  if (err)
95  {
96  LOG(VB_GENERAL, LOG_ERR, LOC + "Cannot load screen 'Slideshow'");
97  return false;
98  }
99 
100  // Initialise details list
101  if (!m_infoList.Create(true))
102  {
103  LOG(VB_GENERAL, LOG_ERR, LOC + "Cannot load 'Info buttonlist'");
104  return false;
105  }
106 
107  // Create display buffer
109 
110  if (m_uiHideCaptions)
111  m_uiHideCaptions->SetText(m_showCaptions ? "" : tr("Hide"));
112 
113  BuildFocusList();
115 
116  // Detect when slides are available for display.
117  // Queue so that keypress events always complete before transition starts
119  this, &GallerySlideView::SlideAvailable, Qt::QueuedConnection);
120 
121  return true;
122 }
123 
124 
129 {
130  // Update transition animations
133 }
134 
135 
141 bool GallerySlideView::keyPressEvent(QKeyEvent *event)
142 {
143  if (GetFocusWidget()->keyPressEvent(event))
144  return true;
145 
146  QStringList actions;
147  bool handled = GetMythMainWindow()->TranslateKeyPress("Images", event, actions);
148 
149  for (int i = 0; i < actions.size() && !handled; i++)
150  {
151  const QString& action = actions[i];
152  handled = true;
153 
154  if (action == "LEFT")
155  ShowPrevSlide(1);
156  else if (action == "RIGHT")
157  ShowNextSlide(1);
158  else if (action == "UP")
159  ShowPrevSlide(10);
160  else if (action == "DOWN")
161  ShowNextSlide(10);
162  else if (action == "INFO")
163  ShowInfo();
164  else if (action == "MENU")
165  MenuMain();
166  else if (action == "PLAY")
167  {
168  if (m_playing)
169  Stop();
170  else
171  Play();
172  }
173  else if (action == "SELECT")
174  {
175  PlayVideo();
176  }
177  else if (action == "STOP")
178  {
179  Stop();
180  }
181  else if (action == "ROTRIGHT")
182  {
184  }
185  else if (action == "ROTLEFT")
186  {
188  }
189  else if (action == "FLIPHORIZONTAL")
190  {
192  }
193  else if (action == "FLIPVERTICAL")
194  {
196  }
197  else if (action == "ZOOMIN")
198  {
199  Zoom(10);
200  }
201  else if (action == "ZOOMOUT")
202  {
203  Zoom(-10);
204  }
205  else if (action == "FULLSIZE")
206  {
207  Zoom();
208  }
209  else if (action == "SCROLLUP")
210  {
211  Pan(QPoint(0, 100));
212  }
213  else if (action == "SCROLLDOWN")
214  {
215  Pan(QPoint(0, -100));
216  }
217  else if (action == "SCROLLLEFT")
218  {
219  Pan(QPoint(-120, 0));
220  }
221  else if (action == "SCROLLRIGHT")
222  {
223  Pan(QPoint(120, 0));
224  }
225  else if (action == "RECENTER")
226  {
227  Pan();
228  }
229  else if (action == "ESCAPE" && !GetMythMainWindow()->IsExitingToMain())
230  {
231  // Exit info details, if shown
232  handled = m_infoList.Hide();
233  }
234  else
235  {
236  handled = false;
237  }
238  }
239 
240  if (!handled)
241  handled = MythScreenType::keyPressEvent(event);
242 
243  return handled;
244 }
245 
246 
251 void GallerySlideView::customEvent(QEvent *event)
252 {
253  if (event->type() == MythEvent::kMythEventMessage)
254  {
255  auto *me = dynamic_cast<MythEvent *>(event);
256  if (me == nullptr)
257  return;
258 
259  const QString& message = me->Message();
260 
261  QStringList extra = me->ExtraDataList();
262 
263  if (message == "IMAGE_METADATA" && !extra.isEmpty())
264  {
265  int id = extra[0].toInt();
266  ImagePtrK selected = m_view->GetSelected();
267 
268  if (selected && selected->m_id == id)
269  m_infoList.Display(*selected, extra.mid(1));
270  }
271  else if (message == "THUMB_AVAILABLE")
272  {
273  if (!extra.isEmpty() && m_view->Update(extra[0].toInt()))
274  ShowSlide(0);
275  }
276  }
277  else if (event->type() == DialogCompletionEvent::kEventType)
278  {
279  auto *dce = (DialogCompletionEvent *)(event);
280 
281  QString resultid = dce->GetId();
282  int buttonnum = dce->GetResult();
283 
284  if (resultid == "metadatamenu")
285  {
286  switch (buttonnum)
287  {
288  case 0: Transform(kRotateCW); break;
289  case 1: Transform(kRotateCCW); break;
290  case 2: Transform(kFlipHorizontal); break;
291  case 3: Transform(kFlipVertical); break;
292  case 4: Transform(kResetToExif); break;
293  case 5: Zoom(10); break;
294  case 6: Zoom(-10); break;
295  }
296  }
297  }
298 }
299 
300 
305 {
306  // Create the main menu that will contain the submenus above
307  auto *menu = new MythMenu(tr("Slideshow Options"), this, "mainmenu");
308 
310  if (im && im->m_type == kVideoFile)
311  menu->AddItem(tr("Play Video"), qOverload<>(&GallerySlideView::PlayVideo));
312 
313  if (m_playing)
314  menu->AddItem(tr("Stop"), &GallerySlideView::Stop);
315  else
316  menu->AddItem(tr("Start SlideShow"), qOverload<>(&GallerySlideView::Play));
317 
318  if (gCoreContext->GetBoolSetting("GalleryRepeat", false))
319  menu->AddItem(tr("Turn Repeat Off"), &GallerySlideView::RepeatOff);
320  else
321  menu->AddItem(tr("Turn Repeat On"), qOverload<>(&GallerySlideView::RepeatOn));
322 
324 
325  if (m_uiHideCaptions)
326  {
327  if (m_showCaptions)
328  menu->AddItem(tr("Hide Captions"), &GallerySlideView::HideCaptions);
329  else
330  menu->AddItem(tr("Show Captions"), &GallerySlideView::ShowCaptions);
331  }
332 
333  QString details;
334  switch (m_infoList.GetState())
335  {
336  case kBasicInfo: details = tr("More Details"); break;
337  case kFullInfo: details = tr("Less Details"); break;
338  default:
339  case kNoInfo: details = tr("Show Details"); break;
340  }
341  menu->AddItem(details, &GallerySlideView::ShowInfo);
342 
343  if (m_infoList.GetState() != kNoInfo)
344  menu->AddItem(tr("Hide Details"), &GallerySlideView::HideInfo);
345 
346  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
347  auto *menuPopup = new MythDialogBox(menu, popupStack, "menuPopup");
348  if (menuPopup->Create())
349  popupStack->AddScreen(menuPopup);
350  else
351  delete menuPopup;
352 }
353 
354 
360 {
362  if (im && !m_playing)
363  {
364  auto *menu = new MythMenu(tr("Transform Options"),
365  this, "metadatamenu");
366  if (m_editsAllowed)
367  {
368  menu->AddItem(tr("Rotate CW"));
369  menu->AddItem(tr("Rotate CCW"));
370  menu->AddItem(tr("Flip Horizontal"));
371  menu->AddItem(tr("Flip Vertical"));
372  menu->AddItem(tr("Reset to Exif"));
373  }
374 
375  if (m_slides.GetCurrent().CanZoomIn())
376  menu->AddItem(tr("Zoom In"));
377 
379  menu->AddItem(tr("Zoom Out"));
380 
381  mainMenu.AddItem(tr("Transforms"), nullptr, menu);
382  }
383 }
384 
385 
394 void GallerySlideView::Start(ImageSlideShowType type, int parentId, int selectedId)
395 {
396  gCoreContext->addListener(this);
397 
398  if (type == kBrowseSlides)
399  {
400  // Browsing views a single ordered directory
401  m_view = new FlatView(kOrdered);
402 
403  // Load db images
404  m_view->LoadFromDb(parentId);
405 
406  // Display current selection, falling back to first
407  m_view->Select(selectedId);
408 
409  // Display slide immediately
410  ShowSlide();
411  }
412  else
413  {
414  int orderInt = gCoreContext->GetNumSetting("GallerySlideOrder", kOrdered);
415 
416  SlideOrderType order = (orderInt < kOrdered) || (orderInt > kSeasonal)
417  ? kOrdered
418  : static_cast<SlideOrderType>(orderInt);
419 
420  // Recursive uses a view of a directory subtree; Normal views a single directory
421  m_view = (type == kRecursiveSlideShow) ? new TreeView(order)
422  : new FlatView(order);
423  // Load db images
424  m_view->LoadFromDb(parentId);
425 
426  // Ordered views start from selected image
427  if (order == kOrdered)
428  // Adjust view so that slideshows show count rather than position
429  m_view->Rotate(selectedId);
430 
431  // No transition for first image
432  Play(false);
433  }
434 }
435 
436 
438 {
440 
441  // Stop further loads
442  m_slides.Teardown();
443 
444  // Update gallerythumbview selection
445  ImagePtrK im = m_view->GetSelected();
446  if (im)
447  emit ImageSelected(im->m_id);
448 
450 }
451 
452 
457 {
458  m_playing = false;
459  m_timer.stop();
460  SetStatus(tr("Stopped"));
461 }
462 
463 
468 void GallerySlideView::Play(bool useTransition)
469 {
470  // Start from next slide
471  ShowNextSlide(1, useTransition);
472 
473  m_playing = true;
474  if (!m_suspended)
475  m_timer.start();
476  SetStatus(tr("Playing"), true);
477 }
478 
479 
484 {
485  m_timer.stop();
486  m_suspended = true;
487 }
488 
489 
494 {
495  m_suspended = false;
496  if (m_playing)
497  m_timer.start();
498 }
499 
500 
506 {
507  ImagePtrK im = m_view->GetSelected();
508  if (im && !m_playing)
509  {
510  ImageIdList list;
511  list.append(im->m_id);
512  QString err = m_mgr.ChangeOrientation(state, list);
513  if (!err.isEmpty())
514  ShowOkPopup(err);
515  }
516 }
517 
518 
523 void GallerySlideView::Zoom(int increment)
524 {
525  if (!m_playing)
526  m_slides.GetCurrent().Zoom(increment);
527 }
528 
529 
534 void GallerySlideView::Pan(QPoint offset)
535 {
536  if (!m_playing)
537  m_slides.GetCurrent().Pan(offset);
538 }
539 
540 
545 {
547 }
548 
549 
554 {
555  m_infoList.Hide();
556 }
557 
558 
563 {
564  m_showCaptions = true;
566 }
567 
568 
573 {
574  m_showCaptions = false;
575  m_uiHideCaptions->SetText(tr("Hide"));
576 }
577 
578 
583 void GallerySlideView::ShowSlide(int direction)
584 {
585  ImagePtrK im = m_view->GetSelected();
586  if (!im)
587  // Reached view limits
588  return;
589 
590  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Selected %1").arg(im->m_filePath));
591 
592  // Suspend the timer until the transition has finished
593  Suspend();
594 
595  // Load image from file
596  if (!m_slides.Load(im, direction))
597  // Image not yet available: show loading status
598  SetStatus(tr("Loading"), true);
599 }
600 
601 
608 {
609  // Transition speed = 0.5x for every slide waiting. Min = 1x, Max = Half buffer size
610  float speed = 0.5 + (count / 2.0);
611 
612  // Are we transitioning ?
613  if (m_transitioning)
614  {
615  // More slides waiting for display: accelerate current transition
616  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Changing speed to %1").arg(speed));
617  m_transition.SetSpeed(speed);
618  return;
619  }
620 
621  // We've been waiting for this slide: transition immediately
622  m_transitioning = true;
623 
624  // Take next slide
625  Slide &next = m_slides.GetNext();
626 
627  // Update loading status
628  ClearStatus(next);
629 
630  // Update slide counts
631  if (m_uiSlideCount)
633 
634  int direction = next.GetDirection();
635 
636  // Use instant transition for start-up & updates (dir = 0)
637  // and browsing with transitions turned off
638  Transition &transition =
639  (direction != 0 &&
640  (m_playing || gCoreContext->GetBoolSetting("GalleryBrowseTransition", false)))
642 
643  // Reset any zoom before starting transition
644  Zoom();
645  transition.Start(m_slides.GetCurrent(), next, direction >= 0, speed);
646 }
647 
648 
656 {
657  if (m_isDeleting)
658  return;
659 
660  m_transitioning = false;
661 
662  // Release old slide, which may start a new transition
664 
665  // No further actions when skipping
666  // cppcheck-suppress knownConditionTrueFalse
667  if (m_transitioning)
668  return;
669 
670  // Preload next slide, if any
672 
673  // Populate display for new slide
675 
676  // Update any file details information
677  m_infoList.Update(im);
678 
679  if (im && m_uiCaptionText)
680  {
681  // show the date & comment
682  QStringList text;
683  text << ImageManagerFe::LongDateOf(im);
684 
685  QString comment = clean_comment(im->m_comment);
686  if (!comment.isEmpty())
687  text << comment;
688 
689  m_uiCaptionText->SetText(text.join(" - "));
690  }
691 
692  // Start any video unless we're paused or browsing
693  if (im && im->m_type == kVideoFile)
694  {
695  if (m_playing)
696  PlayVideo();
697  else
698  SetStatus(tr("Video"));
699  }
700 
701  // Resume slideshow timer
702  Release();
703 }
704 
705 
710 {
711  if (m_playing && m_view->HasPrev(inc) == nullptr)
712  {
713  // Prohibit back-wrapping during slideshow: it will cause premature end
714  //: Cannot go back beyond first slide of slideshow
715  SetStatus(tr("Start"));
716  }
717  else if (m_view->Prev(inc))
718  {
719  ShowSlide(-1);
720  }
721 }
722 
723 
729 void GallerySlideView::ShowNextSlide(int inc, bool useTransition)
730 {
731  // Browsing always wraps; slideshows depend on repeat setting
732  if (m_playing && m_view->HasNext(inc) == nullptr
733  && !gCoreContext->GetBoolSetting("GalleryRepeat", false))
734  {
735  // Don't stop due to jumping past end
736  if (inc == 1)
737  {
738  Stop();
739  //: Slideshow has reached last slide
740  SetStatus(tr("End"));
741  }
742  }
743  else if (m_view->Next(inc))
744  {
745  ShowSlide(useTransition ? 1 : 0);
746  }
747  else
748  {
749  // No images
750  Stop();
751  m_infoList.Hide();
753  if (m_uiSlideCount)
754  m_uiSlideCount->SetText("0/0");
755  if (m_uiCaptionText)
757  }
758 }
760 {
761  ShowNextSlide(1, true);
762 }
763 
764 
769 {
771  return;
772 
774 
775  if (im && im->m_type == kVideoFile)
776  GetMythMainWindow()->HandleMedia("Internal", im->m_url);
777 }
778 
779 
785 void GallerySlideView::SetStatus(QString msg, bool delay)
786 {
787  m_statusText = std::move(msg);
788  if (m_uiStatus)
789  {
790  if (delay)
791  m_delay.start();
792  else
793  ShowStatus();
794  }
795 }
796 
797 
799 {
800  if (m_uiStatus)
802 }
803 
804 
806 {
807  if (m_uiStatus)
808  {
809  m_delay.stop();
810 
811  if (slide.FailedLoad())
812  {
813  ImagePtrK im = slide.GetImageData();
814  SetStatus(tr("Failed to load %1").arg(im ? im->m_filePath : "?"));
815  }
816  else
817  {
818  m_uiStatus->Reset();
819  }
820  }
821 }
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:214
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:21
InfoList::Display
void Display(ImageItemK &im, const QStringList &tagStrings)
Build list of metadata tags.
Definition: galleryinfo.cpp:224
FlatView::HasNext
ImagePtrK HasNext(int inc) const
Peeks at next image in view but does not advance iterator.
Definition: galleryviews.cpp:154
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:102
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:16
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:505
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:383
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:429
FlatView::LoadFromDb
virtual bool LoadFromDb(int parentId)
Populate view with database images from a directory.
Definition: galleryviews.cpp:370
MythEvent
This class is used as a container for messages.
Definition: mythevent.h:16
MythMenu::AddItem
void AddItem(const QString &title)
Definition: mythdialogbox.h:110
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:251
GallerySlideView::Start
void Start(ImageSlideShowType type, int parentId, int selectedId=0)
Start slideshow.
Definition: galleryslideview.cpp:394
InfoList::Update
void Update(const ImagePtrK &im)
Populates available exif details for the current image/dir.
Definition: galleryinfo.cpp:198
GallerySlideView::m_transitioning
bool m_transitioning
True when a transition is in progress.
Definition: galleryslideview.h:97
LOC
#define LOC
Definition: galleryslideview.cpp:13
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:98
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:655
Slide::CanZoomIn
bool CanZoomIn() const
Definition: galleryslide.h:170
GallerySlideView::Suspend
void Suspend()
Pause transition timer temporarily.
Definition: galleryslideview.cpp:483
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:77
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:456
FlatView::Select
bool Select(int id, int fallback=0)
Selects first occurrence of an image.
Definition: galleryviews.cpp:119
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:607
FlatView::Prev
ImagePtrK Prev(int inc)
Decrements iterator and returns previous image. Wraps at start.
Definition: galleryviews.cpp:199
GallerySlideView::GallerySlideView
GallerySlideView(MythScreenStack *parent, const char *name, bool editsAllowed)
Constructor.
Definition: galleryslideview.cpp:30
ImageManagerFe::ChangeOrientation
QString ChangeOrientation(ImageFileTransform transform, const ImageIdList &ids)
Apply an orientation transform to images.
Definition: imagemanager.cpp:2092
GallerySlideView::PlayVideo
void PlayVideo()
Starts internal player for video.
Definition: galleryslideview.cpp:768
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:110
FlatView::Update
bool Update(int id)
Updates view with images that have been updated.
Definition: galleryviews.cpp:88
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:572
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:709
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:85
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:805
Transition::Start
virtual void Start(Slide &from, Slide &to, bool forwards, float speed=1.0)
Start base transition.
Definition: gallerytransitions.cpp:80
GallerySlideView::Close
void Close() override
Definition: galleryslideview.cpp:437
GallerySlideView::m_delay
QTimer m_delay
Status delay timer.
Definition: galleryslideview.h:92
MythScreenType::SetFocusWidget
bool SetFocusWidget(MythUIType *widget=nullptr)
Definition: mythscreentype.cpp:115
kFlipVertical
@ kFlipVertical
Reflect about horizontal axis.
Definition: imagemetadata.h:51
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
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:188
MythCoreContext::GetDurSetting
std::enable_if_t< std::chrono::__is_duration< T >::value, T > GetDurSetting(const QString &key, T defaultval=T::zero())
Definition: mythcorecontext.h:168
Slide::Pan
void Pan(QPoint offset)
Initiate pan.
Definition: galleryslide.cpp:509
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:203
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:523
GallerySlideView::m_uiStatus
MythUIText * m_uiStatus
Definition: galleryslideview.h:75
GallerySlideView::ShowNextSlide
void ShowNextSlide()
Definition: galleryslideview.cpp:759
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:2327
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:66
kBrowseSlides
@ kBrowseSlides
Definition: galleryslideview.h:16
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
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:81
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:916
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:583
FlatView::Next
ImagePtrK Next(int inc)
Advance iterator and return next image, wrapping if necessary. Regenerates unordered views on wrap.
Definition: galleryviews.cpp:166
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:910
InfoList::Hide
bool Hide()
Remove infolist from display.
Definition: galleryinfo.cpp:121
GallerySlideView::ShowCaptions
void ShowCaptions()
Show text widgets.
Definition: galleryslideview.cpp:562
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:99
galleryviews.h
Provides view datastores for Gallery screens.
MythScreenType::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythscreentype.cpp:401
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:785
ImageManagerFe
The image manager for use by Frontends.
Definition: imagemanager.h:463
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:69
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:41
GallerySlideView::MenuTransforms
void MenuTransforms(MythMenu &mainMenu)
Add Transforms submenu.
Definition: galleryslideview.cpp:359
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:57
kResetToExif
@ kResetToExif
Reset to Exif value.
Definition: imagemetadata.h:47
GallerySlideView::ShowStatus
void ShowStatus()
Definition: galleryslideview.cpp:798
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:553
kSeasonal
@ kSeasonal
Biased random selection so that images are more likely to appear on anniversaries.
Definition: galleryviews.h:25
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:322
GallerySlideView::Release
void Release()
Unpause transition timer.
Definition: galleryslideview.cpp:493
Transition::finished
void finished()
GallerySlideView::ShowInfo
void ShowInfo()
Show exif info list.
Definition: galleryslideview.cpp:544
kOrdered
@ kOrdered
Ordered as per user setting GallerySortOrder.
Definition: galleryviews.h:22
InfoList::Create
bool Create(bool focusable)
Initialise buttonlist from XML.
Definition: galleryinfo.cpp:67
GallerySlideView::Pan
void Pan(QPoint offset=QPoint(0, 0))
Pan current slide.
Definition: galleryslideview.cpp:534
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:128
GallerySlideView::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Handle keypresses.
Definition: galleryslideview.cpp:141
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:304
GallerySlideView::RepeatOff
static void RepeatOff()
Definition: galleryslideview.h:64
kNoInfo
@ kNoInfo
Details not displayed.
Definition: galleryinfo.h:17