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