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 
24  bool editsAllowed)
25  : MythScreenType(parent, name),
26  m_mgr(ImageManagerFe::getInstance()),
27  m_availableTransitions(GetMythPainter()->SupportsAnimation()),
28  m_transition(m_availableTransitions.Select(
29  gCoreContext->GetNumSetting("GalleryTransitionType",
31  m_infoList(*this),
32  m_slideShowTime(gCoreContext->GetDurSetting<std::chrono::milliseconds>("GallerySlideShowTime", 3s)),
33  m_showCaptions(gCoreContext->GetBoolSetting("GalleryShowSlideCaptions", true)),
34  m_editsAllowed(editsAllowed)
35 {
36  // Detect when transitions finish. Queued signal to allow redraw/pulse to
37  // complete before handling event.
39  this, &GallerySlideView::TransitionComplete, Qt::QueuedConnection);
41  this, &GallerySlideView::TransitionComplete, Qt::QueuedConnection);
42 
43  // Initialise slideshow timer
44  m_timer.setSingleShot(true);
45  m_timer.setInterval(m_slideShowTime);
46  connect(&m_timer, &QTimer::timeout,
47  this, qOverload<>(&GallerySlideView::ShowNextSlide));
48 
49  // Initialise status delay timer
50  m_delay.setSingleShot(true);
51  m_delay.setInterval(gCoreContext->GetDurSetting<std::chrono::milliseconds>("GalleryStatusDelay", 0s));
53 }
54 
55 
60 {
61  delete m_view;
62  LOG(VB_GUI, LOG_DEBUG, "Deleted Slideview");
63 }
64 
65 
71 {
72  if (!LoadWindowFromXML("image-ui.xml", "slideshow", this))
73  return false;
74 
75  // Get widgets from XML
76  bool err = false;
77  UIUtilE::Assign(this, m_uiImage, "image", &err);
78  UIUtilW::Assign(this, m_uiStatus, "status");
79  UIUtilW::Assign(this, m_uiSlideCount, "slidecount");
80  UIUtilW::Assign(this, m_uiCaptionText, "caption");
81  UIUtilW::Assign(this, m_uiHideCaptions, "hidecaptions");
82 
83  if (err)
84  {
85  LOG(VB_GENERAL, LOG_ERR, LOC + "Cannot load screen 'Slideshow'");
86  return false;
87  }
88 
89  // Initialise details list
90  if (!m_infoList.Create(true))
91  {
92  LOG(VB_GENERAL, LOG_ERR, LOC + "Cannot load 'Info buttonlist'");
93  return false;
94  }
95 
96  // Create display buffer
98 
99  if (m_uiHideCaptions)
100  m_uiHideCaptions->SetText(m_showCaptions ? "" : tr("Hide"));
101 
102  BuildFocusList();
104 
105  // Detect when slides are available for display.
106  // Queue so that keypress events always complete before transition starts
108  this, &GallerySlideView::SlideAvailable, Qt::QueuedConnection);
109 
110  return true;
111 }
112 
113 
118 {
119  // Update transition animations
122 }
123 
124 
130 bool GallerySlideView::keyPressEvent(QKeyEvent *event)
131 {
132  if (GetFocusWidget()->keyPressEvent(event))
133  return true;
134 
135  QStringList actions;
136  bool handled = GetMythMainWindow()->TranslateKeyPress("Images", event, actions);
137 
138  for (int i = 0; i < actions.size() && !handled; i++)
139  {
140  QString action = actions[i];
141  handled = true;
142 
143  if (action == "LEFT")
144  ShowPrevSlide(1);
145  else if (action == "RIGHT")
146  ShowNextSlide(1);
147  else if (action == "UP")
148  ShowPrevSlide(10);
149  else if (action == "DOWN")
150  ShowNextSlide(10);
151  else if (action == "INFO")
152  ShowInfo();
153  else if (action == "MENU")
154  MenuMain();
155  else if (action == "PLAY")
156  {
157  if (m_playing)
158  Stop();
159  else
160  Play();
161  }
162  else if (action == "SELECT")
163  PlayVideo();
164  else if (action == "STOP")
165  Stop();
166  else if (action == "ROTRIGHT")
168  else if (action == "ROTLEFT")
170  else if (action == "FLIPHORIZONTAL")
172  else if (action == "FLIPVERTICAL")
174  else if (action == "ZOOMIN")
175  Zoom(10);
176  else if (action == "ZOOMOUT")
177  Zoom(-10);
178  else if (action == "FULLSIZE")
179  Zoom();
180  else if (action == "SCROLLUP")
181  Pan(QPoint(0, 100));
182  else if (action == "SCROLLDOWN")
183  Pan(QPoint(0, -100));
184  else if (action == "SCROLLLEFT")
185  Pan(QPoint(-120, 0));
186  else if (action == "SCROLLRIGHT")
187  Pan(QPoint(120, 0));
188  else if (action == "RECENTER")
189  Pan();
190  else if (action == "ESCAPE" && !GetMythMainWindow()->IsExitingToMain())
191  {
192  // Exit info details, if shown
193  handled = m_infoList.Hide();
194  }
195  else
196  {
197  handled = false;
198  }
199  }
200 
201  if (!handled)
202  handled = MythScreenType::keyPressEvent(event);
203 
204  return handled;
205 }
206 
207 
212 void GallerySlideView::customEvent(QEvent *event)
213 {
214  if (event->type() == MythEvent::kMythEventMessage)
215  {
216  auto *me = dynamic_cast<MythEvent *>(event);
217  if (me == nullptr)
218  return;
219 
220  const QString& message = me->Message();
221 
222  QStringList extra = me->ExtraDataList();
223 
224  if (message == "IMAGE_METADATA" && !extra.isEmpty())
225  {
226  int id = extra[0].toInt();
227  ImagePtrK selected = m_view->GetSelected();
228 
229  if (selected && selected->m_id == id)
230  m_infoList.Display(*selected, extra.mid(1));
231  }
232  else if (message == "THUMB_AVAILABLE")
233  {
234  if (!extra.isEmpty() && m_view->Update(extra[0].toInt()))
235  ShowSlide(0);
236  }
237  }
238  else if (event->type() == DialogCompletionEvent::kEventType)
239  {
240  auto *dce = (DialogCompletionEvent *)(event);
241 
242  QString resultid = dce->GetId();
243  int buttonnum = dce->GetResult();
244 
245  if (resultid == "metadatamenu")
246  {
247  switch (buttonnum)
248  {
249  case 0: Transform(kRotateCW); break;
250  case 1: Transform(kRotateCCW); break;
251  case 2: Transform(kFlipHorizontal); break;
252  case 3: Transform(kFlipVertical); break;
253  case 4: Transform(kResetToExif); break;
254  case 5: Zoom(10); break;
255  case 6: Zoom(-10); break;
256  }
257  }
258  }
259 }
260 
261 
266 {
267  // Create the main menu that will contain the submenus above
268  auto *menu = new MythMenu(tr("Slideshow Options"), this, "mainmenu");
269 
271  if (im && im->m_type == kVideoFile)
272  menu->AddItem(tr("Play Video"), qOverload<>(&GallerySlideView::PlayVideo));
273 
274  if (m_playing)
275  menu->AddItem(tr("Stop"), &GallerySlideView::Stop);
276  else
277  menu->AddItem(tr("Start SlideShow"), qOverload<>(&GallerySlideView::Play));
278 
279  if (gCoreContext->GetBoolSetting("GalleryRepeat", false))
280  menu->AddItem(tr("Turn Repeat Off"), &GallerySlideView::RepeatOff);
281  else
282  menu->AddItem(tr("Turn Repeat On"), qOverload<>(&GallerySlideView::RepeatOn));
283 
285 
286  if (m_uiHideCaptions)
287  {
288  if (m_showCaptions)
289  menu->AddItem(tr("Hide Captions"), &GallerySlideView::HideCaptions);
290  else
291  menu->AddItem(tr("Show Captions"), &GallerySlideView::ShowCaptions);
292  }
293 
294  QString details;
295  switch (m_infoList.GetState())
296  {
297  case kBasicInfo: details = tr("More Details"); break;
298  case kFullInfo: details = tr("Less Details"); break;
299  default:
300  case kNoInfo: details = tr("Show Details"); break;
301  }
302  menu->AddItem(details, &GallerySlideView::ShowInfo);
303 
304  if (m_infoList.GetState() != kNoInfo)
305  menu->AddItem(tr("Hide Details"), &GallerySlideView::HideInfo);
306 
307  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
308  auto *menuPopup = new MythDialogBox(menu, popupStack, "menuPopup");
309  if (menuPopup->Create())
310  popupStack->AddScreen(menuPopup);
311  else
312  delete menuPopup;
313 }
314 
315 
321 {
323  if (im && !m_playing)
324  {
325  auto *menu = new MythMenu(tr("Transform Options"),
326  this, "metadatamenu");
327  if (m_editsAllowed)
328  {
329  menu->AddItem(tr("Rotate CW"));
330  menu->AddItem(tr("Rotate CCW"));
331  menu->AddItem(tr("Flip Horizontal"));
332  menu->AddItem(tr("Flip Vertical"));
333  menu->AddItem(tr("Reset to Exif"));
334  }
335 
336  if (m_slides.GetCurrent().CanZoomIn())
337  menu->AddItem(tr("Zoom In"));
338 
340  menu->AddItem(tr("Zoom Out"));
341 
342  mainMenu.AddItem(tr("Transforms"), nullptr, menu);
343  }
344 }
345 
346 
355 void GallerySlideView::Start(ImageSlideShowType type, int parentId, int selectedId)
356 {
357  gCoreContext->addListener(this);
358 
359  if (type == kBrowseSlides)
360  {
361  // Browsing views a single ordered directory
362  m_view = new FlatView(kOrdered);
363 
364  // Load db images
365  m_view->LoadFromDb(parentId);
366 
367  // Display current selection, falling back to first
368  m_view->Select(selectedId);
369 
370  // Display slide immediately
371  ShowSlide();
372  }
373  else
374  {
375  int orderInt = gCoreContext->GetNumSetting("GallerySlideOrder", kOrdered);
376 
377  SlideOrderType order = (orderInt < kOrdered) || (orderInt > kSeasonal)
378  ? kOrdered
379  : static_cast<SlideOrderType>(orderInt);
380 
381  // Recursive uses a view of a directory subtree; Normal views a single directory
382  m_view = (type == kRecursiveSlideShow) ? new TreeView(order)
383  : new FlatView(order);
384  // Load db images
385  m_view->LoadFromDb(parentId);
386 
387  // Ordered views start from selected image
388  if (order == kOrdered)
389  // Adjust view so that slideshows show count rather than position
390  m_view->Rotate(selectedId);
391 
392  // No transition for first image
393  Play(false);
394  }
395 }
396 
397 
399 {
401 
402  // Stop further loads
403  m_slides.Teardown();
404 
405  // Update gallerythumbview selection
406  ImagePtrK im = m_view->GetSelected();
407  if (im)
408  emit ImageSelected(im->m_id);
409 
411 }
412 
413 
418 {
419  m_playing = false;
420  m_timer.stop();
421  SetStatus(tr("Stopped"));
422 }
423 
424 
429 void GallerySlideView::Play(bool useTransition)
430 {
431  // Start from next slide
432  ShowNextSlide(1, useTransition);
433 
434  m_playing = true;
435  if (!m_suspended)
436  m_timer.start();
437  SetStatus(tr("Playing"), true);
438 }
439 
440 
445 {
446  m_timer.stop();
447  m_suspended = true;
448 }
449 
450 
455 {
456  m_suspended = false;
457  if (m_playing)
458  m_timer.start();
459 }
460 
461 
467 {
468  ImagePtrK im = m_view->GetSelected();
469  if (im && !m_playing)
470  {
471  ImageIdList list;
472  list.append(im->m_id);
473  QString err = m_mgr.ChangeOrientation(state, list);
474  if (!err.isEmpty())
475  ShowOkPopup(err);
476  }
477 }
478 
479 
484 void GallerySlideView::Zoom(int increment)
485 {
486  if (!m_playing)
487  m_slides.GetCurrent().Zoom(increment);
488 }
489 
490 
495 void GallerySlideView::Pan(QPoint offset)
496 {
497  if (!m_playing)
498  m_slides.GetCurrent().Pan(offset);
499 }
500 
501 
506 {
508 }
509 
510 
515 {
516  m_infoList.Hide();
517 }
518 
519 
524 {
525  m_showCaptions = true;
527 }
528 
529 
534 {
535  m_showCaptions = false;
536  m_uiHideCaptions->SetText(tr("Hide"));
537 }
538 
539 
544 void GallerySlideView::ShowSlide(int direction)
545 {
546  ImagePtrK im = m_view->GetSelected();
547  if (!im)
548  // Reached view limits
549  return;
550 
551  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Selected %1").arg(im->m_filePath));
552 
553  // Suspend the timer until the transition has finished
554  Suspend();
555 
556  // Load image from file
557  if (!m_slides.Load(im, direction))
558  // Image not yet available: show loading status
559  SetStatus(tr("Loading"), true);
560 }
561 
562 
569 {
570  // Transition speed = 0.5x for every slide waiting. Min = 1x, Max = Half buffer size
571  float speed = 0.5 + count / 2.0;
572 
573  // Are we transitioning ?
574  if (m_transitioning)
575  {
576  // More slides waiting for display: accelerate current transition
577  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Changing speed to %1").arg(speed));
578  m_transition.SetSpeed(speed);
579  return;
580  }
581 
582  // We've been waiting for this slide: transition immediately
583  m_transitioning = true;
584 
585  // Take next slide
586  Slide &next = m_slides.GetNext();
587 
588  // Update loading status
589  ClearStatus(next);
590 
591  // Update slide counts
592  if (m_uiSlideCount)
594 
595  int direction = next.GetDirection();
596 
597  // Use instant transition for start-up & updates (dir = 0)
598  // and browsing with transitions turned off
599  Transition &transition =
600  (direction != 0 &&
601  (m_playing || gCoreContext->GetBoolSetting("GalleryBrowseTransition", false)))
603 
604  // Reset any zoom before starting transition
605  Zoom();
606  transition.Start(m_slides.GetCurrent(), next, direction >= 0, speed);
607 }
608 
609 
617 {
618  if (m_isDeleting)
619  return;
620 
621  m_transitioning = false;
622 
623  // Release old slide, which may start a new transition
625 
626  // No further actions when skipping
627  // cppcheck-suppress knownConditionTrueFalse
628  if (m_transitioning)
629  return;
630 
631  // Preload next slide, if any
633 
634  // Populate display for new slide
636 
637  // Update any file details information
638  m_infoList.Update(im);
639 
640  if (im && m_uiCaptionText)
641  {
642  // show the date & comment
643  QStringList text;
644  text << ImageManagerFe::LongDateOf(im);
645 
646  if (!im->m_comment.isEmpty())
647  text << im->m_comment;
648 
649  m_uiCaptionText->SetText(text.join(" - "));
650  }
651 
652  // Start any video unless we're paused or browsing
653  if (im && im->m_type == kVideoFile)
654  {
655  if (m_playing)
656  PlayVideo();
657  else
658  SetStatus(tr("Video"));
659  }
660 
661  // Resume slideshow timer
662  Release();
663 }
664 
665 
670 {
671  if (m_playing && m_view->HasPrev(inc) == nullptr)
672  {
673  // Prohibit back-wrapping during slideshow: it will cause premature end
674  //: Cannot go back beyond first slide of slideshow
675  SetStatus(tr("Start"));
676  }
677  else if (m_view->Prev(inc))
678  {
679  ShowSlide(-1);
680  }
681 }
682 
683 
689 void GallerySlideView::ShowNextSlide(int inc, bool useTransition)
690 {
691  // Browsing always wraps; slideshows depend on repeat setting
692  if (m_playing && m_view->HasNext(inc) == nullptr
693  && !gCoreContext->GetBoolSetting("GalleryRepeat", false))
694  {
695  // Don't stop due to jumping past end
696  if (inc == 1)
697  {
698  Stop();
699  //: Slideshow has reached last slide
700  SetStatus(tr("End"));
701  }
702  }
703  else if (m_view->Next(inc))
704  ShowSlide(useTransition ? 1 : 0);
705  else
706  {
707  // No images
708  Stop();
709  m_infoList.Hide();
711  if (m_uiSlideCount)
712  m_uiSlideCount->SetText("0/0");
713  if (m_uiCaptionText)
715  }
716 }
718 {
719  ShowNextSlide(1, true);
720 }
721 
722 
727 {
729  return;
730 
732 
733  if (im && im->m_type == kVideoFile)
734  GetMythMainWindow()->HandleMedia("Internal", im->m_url);
735 }
736 
737 
743 void GallerySlideView::SetStatus(QString msg, bool delay)
744 {
745  m_statusText = std::move(msg);
746  if (m_uiStatus)
747  {
748  if (delay)
749  m_delay.start();
750  else
751  ShowStatus();
752  }
753 }
754 
755 
757 {
758  if (m_uiStatus)
760 }
761 
762 
764 {
765  if (m_uiStatus)
766  {
767  m_delay.stop();
768 
769  if (slide.FailedLoad())
770  {
771  ImagePtrK im = slide.GetImageData();
772  SetStatus(tr("Failed to load %1").arg(im ? im->m_filePath : "?"));
773  }
774  else
775  m_uiStatus->Reset();
776  }
777 }
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
InfoList::Display
void Display(ImageItemK &im, const QStringList &tagStrings)
Build list of metadata tags.
Definition: galleryinfo.cpp:222
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:103
mythuitext.h
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:82
kVideoFile
@ kVideoFile
A video.
Definition: imagetypes.h:40
ImageSlideShowType
ImageSlideShowType
Type of slide show.
Definition: galleryslideview.h:15
GallerySlideView::m_showCaptions
bool m_showCaptions
If true, captions are shown.
Definition: galleryslideview.h:96
GallerySlideView::Transform
void Transform(ImageFileTransform state)
Action transform request.
Definition: galleryslideview.cpp:466
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:386
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:426
FlatView::LoadFromDb
virtual bool LoadFromDb(int parentId)
Populate view with database images from a directory.
Definition: galleryviews.cpp:367
kBrowseSlides
@ kBrowseSlides
Definition: galleryslideview.h:16
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
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:212
GallerySlideView::Start
void Start(ImageSlideShowType type, int parentId, int selectedId=0)
Start slideshow.
Definition: galleryslideview.cpp:355
kNoInfo
@ kNoInfo
Details not displayed.
Definition: galleryinfo.h:16
InfoList::Update
void Update(const ImagePtrK &im)
Populates available exif details for the current image/dir.
Definition: galleryinfo.cpp:196
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
kSeasonal
@ kSeasonal
Biased random selection so that images are more likely to appear on anniversaries.
Definition: galleryviews.h:25
GallerySlideView::TransitionComplete
void TransitionComplete()
Transition to new slide has finished.
Definition: galleryslideview.cpp:616
Slide::CanZoomIn
bool CanZoomIn() const
Definition: galleryslide.h:170
GallerySlideView::Suspend
void Suspend()
Pause transition timer temporarily.
Definition: galleryslideview.cpp:444
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:455
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:417
FlatView::Select
bool Select(int id, int fallback=0)
Selects first occurrence of an image.
Definition: galleryviews.cpp:119
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:568
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:23
ImageManagerFe::ChangeOrientation
QString ChangeOrientation(ImageFileTransform transform, const ImageIdList &ids)
Apply an orientation transform to images.
Definition: imagemanager.cpp:2109
GallerySlideView::PlayVideo
void PlayVideo()
Starts internal player for video.
Definition: galleryslideview.cpp:726
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:113
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:701
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:533
ImageFileTransform
ImageFileTransform
Image transformations.
Definition: imagemetadata.h:46
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:654
GallerySlideView::ShowPrevSlide
void ShowPrevSlide(int inc=1)
Display the previous slide in the sequence.
Definition: galleryslideview.cpp:669
GallerySlideView::m_view
FlatView * m_view
List of images comprising the slideshow.
Definition: galleryslideview.h:81
SlideBuffer::Teardown
void Teardown()
Definition: galleryslide.cpp:579
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:763
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:398
GallerySlideView::m_delay
QTimer m_delay
Status delay timer.
Definition: galleryslideview.h:92
MythScreenType::SetFocusWidget
bool SetFocusWidget(MythUIType *widget=nullptr)
Definition: mythscreentype.cpp:118
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:325
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:169
Slide::Pan
void Pan(QPoint offset)
Initiate pan.
Definition: galleryslide.cpp:495
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:206
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
kBlendTransition
@ kBlendTransition
Definition: gallerytransitions.h:18
GallerySlideView::Zoom
void Zoom(int increment=0)
Zoom current slide.
Definition: galleryslideview.cpp:484
GallerySlideView::m_uiStatus
MythUIText * m_uiStatus
Definition: galleryslideview.h:75
GallerySlideView::ShowNextSlide
void ShowNextSlide()
Definition: galleryslideview.cpp:717
ImageManagerFe::LongDateOf
static QString LongDateOf(const ImagePtrK &im)
Return a timestamp/datestamp for an image or dir.
Definition: imagemanager.cpp:2344
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
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:33
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:70
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:911
SlideBuffer::Preload
void Preload(const ImagePtrK &im)
Load an image in next available slide.
Definition: galleryslide.cpp:679
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:544
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:593
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:905
InfoList::Hide
bool Hide()
Remove infolist from display.
Definition: galleryinfo.cpp:119
kFullInfo
@ kFullInfo
Shows all exif tags.
Definition: galleryinfo.h:18
GallerySlideView::ShowCaptions
void ShowCaptions()
Show text widgets.
Definition: galleryslideview.cpp:523
GallerySlideView::m_uiCaptionText
MythUIText * m_uiCaptionText
Definition: galleryslideview.h:77
Slide::Zoom
void Zoom(int percentage)
Initiate slide zoom.
Definition: galleryslide.cpp:452
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:404
kFlipVertical
@ kFlipVertical
Reflect about horizontal axis.
Definition: imagemetadata.h:51
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:743
ImageManagerFe
The image manager for use by Frontends.
Definition: imagemanager.h:459
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:695
GallerySlideView::m_suspended
bool m_suspended
True when transition is running or video playing.
Definition: galleryslideview.h:95
kRotateCW
@ kRotateCW
Rotate clockwise.
Definition: imagemetadata.h:48
GallerySlideView::~GallerySlideView
~GallerySlideView() override
Destructor.
Definition: galleryslideview.cpp:59
std
Definition: mythchrono.h:23
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:41
kBasicInfo
@ kBasicInfo
Shows just the most useful exif tags.
Definition: galleryinfo.h:17
GallerySlideView::MenuTransforms
void MenuTransforms(MythMenu &mainMenu)
Add Transforms submenu.
Definition: galleryslideview.cpp:320
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:132
DialogCompletionEvent::kEventType
static const Type kEventType
Definition: mythdialogbox.h:57
GallerySlideView::ShowStatus
void ShowStatus()
Definition: galleryslideview.cpp:756
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:104
SlideOrderType
SlideOrderType
Order of images in slideshow.
Definition: galleryviews.h:21
Transition::Pulse
virtual void Pulse()=0
Transition::SetSpeed
virtual void SetSpeed(float)
Definition: gallerytransitions.h:36
build_compdb.action
action
Definition: build_compdb.py:9
GallerySlideView::HideInfo
void HideInfo()
Hide exif info list.
Definition: galleryslideview.cpp:514
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:323
GallerySlideView::Release
void Release()
Unpause transition timer.
Definition: galleryslideview.cpp:454
Transition::finished
void finished()
kOrdered
@ kOrdered
Ordered as per user setting GallerySortOrder.
Definition: galleryviews.h:22
kFlipHorizontal
@ kFlipHorizontal
Reflect about vertical axis.
Definition: imagemetadata.h:50
GallerySlideView::ShowInfo
void ShowInfo()
Show exif info list.
Definition: galleryslideview.cpp:505
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:495
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
kRecursiveSlideShow
@ kRecursiveSlideShow
Definition: galleryslideview.h:18
GallerySlideView::Pulse
void Pulse() override
Update transition.
Definition: galleryslideview.cpp:117
GallerySlideView::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Handle keypresses.
Definition: galleryslideview.cpp:130
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:562
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:265
kResetToExif
@ kResetToExif
Reset to Exif value.
Definition: imagemetadata.h:47
GallerySlideView::RepeatOff
static void RepeatOff()
Definition: galleryslideview.h:64
kRotateCCW
@ kRotateCCW
Rotate anti-clockwise.
Definition: imagemetadata.h:49