MythTV  master
galleryslideview.cpp
Go to the documentation of this file.
1 #include "galleryslideview.h"
2 
3 #include <utility>
4 
5 #include "mythmainwindow.h"
6 #include "mythuitext.h"
7 #include "mythdialogbox.h"
8 
9 #include "galleryviews.h"
10 
11 #define LOC QString("Slideview: ")
12 
13 
22  bool editsAllowed)
23  : MythScreenType(parent, name),
24  m_mgr(ImageManagerFe::getInstance()),
25  m_availableTransitions(GetMythPainter()->SupportsAnimation()),
26  m_transition(m_availableTransitions.Select(
27  gCoreContext->GetNumSetting("GalleryTransitionType",
29  m_infoList(*this),
30  m_slideShowTime(gCoreContext->GetNumSetting("GallerySlideShowTime", 3000)),
31  m_showCaptions(gCoreContext->GetBoolSetting("GalleryShowSlideCaptions", true)),
32  m_editsAllowed(editsAllowed)
33 {
34  // Detect when transitions finish. Queued signal to allow redraw/pulse to
35  // complete before handling event.
36  connect(&m_transition, SIGNAL(finished()),
37  this, SLOT(TransitionComplete()), Qt::QueuedConnection);
38  connect(&m_updateTransition, SIGNAL(finished()),
39  this, SLOT(TransitionComplete()), Qt::QueuedConnection);
40 
41 #if QT_VERSION < QT_VERSION_CHECK(5,10,0)
42  // Seed random generator for random transitions
43  qsrand(QTime::currentTime().msec());
44 #endif
45 
46  // Initialise slideshow timer
47  m_timer.setSingleShot(true);
48  m_timer.setInterval(m_slideShowTime);
49  connect(&m_timer, SIGNAL(timeout()), this, SLOT(ShowNextSlide()));
50 
51  // Initialise status delay timer
52  m_delay.setSingleShot(true);
53  m_delay.setInterval(gCoreContext->GetNumSetting("GalleryStatusDelay", 0));
54  connect(&m_delay, SIGNAL(timeout()), this, SLOT(ShowStatus()));
55 }
56 
57 
62 {
63  delete m_view;
64  LOG(VB_GUI, LOG_DEBUG, "Deleted Slideview");
65 }
66 
67 
73 {
74  if (!LoadWindowFromXML("image-ui.xml", "slideshow", this))
75  return false;
76 
77  // Get widgets from XML
78  bool err = false;
79  UIUtilE::Assign(this, m_uiImage, "image", &err);
80  UIUtilW::Assign(this, m_uiStatus, "status");
81  UIUtilW::Assign(this, m_uiSlideCount, "slidecount");
82  UIUtilW::Assign(this, m_uiCaptionText, "caption");
83  UIUtilW::Assign(this, m_uiHideCaptions, "hidecaptions");
84 
85  if (err)
86  {
87  LOG(VB_GENERAL, LOG_ERR, LOC + "Cannot load screen 'Slideshow'");
88  return false;
89  }
90 
91  // Initialise details list
92  if (!m_infoList.Create(true))
93  {
94  LOG(VB_GENERAL, LOG_ERR, LOC + "Cannot load 'Info buttonlist'");
95  return false;
96  }
97 
98  // Create display buffer
100 
101  if (m_uiHideCaptions)
102  m_uiHideCaptions->SetText(m_showCaptions ? "" : tr("Hide"));
103 
104  BuildFocusList();
106 
107  // Detect when slides are available for display.
108  // Queue so that keypress events always complete before transition starts
109  connect(&m_slides, SIGNAL(SlideReady(int)),
110  this, SLOT(SlideAvailable(int)), Qt::QueuedConnection);
111 
112  return true;
113 }
114 
115 
120 {
121  // Update transition animations
122  m_transition.Pulse(GetMythMainWindow()->GetDrawInterval());
123 
125 }
126 
127 
133 bool GallerySlideView::keyPressEvent(QKeyEvent *event)
134 {
135  if (GetFocusWidget()->keyPressEvent(event))
136  return true;
137 
138  QStringList actions;
139  bool handled = GetMythMainWindow()->TranslateKeyPress("Images", event, actions);
140 
141  for (int i = 0; i < actions.size() && !handled; i++)
142  {
143  QString action = actions[i];
144  handled = true;
145 
146  if (action == "LEFT")
147  ShowPrevSlide(1);
148  else if (action == "RIGHT")
149  ShowNextSlide(1);
150  else if (action == "UP")
151  ShowPrevSlide(10);
152  else if (action == "DOWN")
153  ShowNextSlide(10);
154  else if (action == "INFO")
155  ShowInfo();
156  else if (action == "MENU")
157  MenuMain();
158  else if (action == "PLAY")
159  {
160  if (m_playing)
161  Stop();
162  else
163  Play();
164  }
165  else if (action == "SELECT")
166  PlayVideo();
167  else if (action == "STOP")
168  Stop();
169  else if (action == "ROTRIGHT")
171  else if (action == "ROTLEFT")
173  else if (action == "FLIPHORIZONTAL")
175  else if (action == "FLIPVERTICAL")
177  else if (action == "ZOOMIN")
178  Zoom(10);
179  else if (action == "ZOOMOUT")
180  Zoom(-10);
181  else if (action == "FULLSIZE")
182  Zoom();
183  else if (action == "SCROLLUP")
184  Pan(QPoint(0, 100));
185  else if (action == "SCROLLDOWN")
186  Pan(QPoint(0, -100));
187  else if (action == "SCROLLLEFT")
188  Pan(QPoint(-120, 0));
189  else if (action == "SCROLLRIGHT")
190  Pan(QPoint(120, 0));
191  else if (action == "RECENTER")
192  Pan();
193  else if (action == "ESCAPE" && !GetMythMainWindow()->IsExitingToMain())
194  {
195  // Exit info details, if shown
196  handled = m_infoList.Hide();
197  }
198  else
199  {
200  handled = false;
201  }
202  }
203 
204  if (!handled)
205  handled = MythScreenType::keyPressEvent(event);
206 
207  return handled;
208 }
209 
210 
215 void GallerySlideView::customEvent(QEvent *event)
216 {
217  if (event->type() == MythEvent::MythEventMessage)
218  {
219  auto *me = dynamic_cast<MythEvent *>(event);
220  if (me == nullptr)
221  return;
222 
223  const QString& message = me->Message();
224 
225  QStringList extra = me->ExtraDataList();
226 
227  if (message == "IMAGE_METADATA" && !extra.isEmpty())
228  {
229  int id = extra[0].toInt();
230  ImagePtrK selected = m_view->GetSelected();
231 
232  if (selected && selected->m_id == id)
233  m_infoList.Display(*selected, extra.mid(1));
234  }
235  else if (message == "THUMB_AVAILABLE")
236  {
237  if (!extra.isEmpty() && m_view->Update(extra[0].toInt()))
238  ShowSlide(0);
239  }
240  }
241  else if (event->type() == DialogCompletionEvent::kEventType)
242  {
243  auto *dce = (DialogCompletionEvent *)(event);
244 
245  QString resultid = dce->GetId();
246  int buttonnum = dce->GetResult();
247 
248  if (resultid == "metadatamenu")
249  {
250  switch (buttonnum)
251  {
252  case 0: Transform(kRotateCW); break;
253  case 1: Transform(kRotateCCW); break;
254  case 2: Transform(kFlipHorizontal); break;
255  case 3: Transform(kFlipVertical); break;
256  case 4: Transform(kResetToExif); break;
257  case 5: Zoom(10); break;
258  case 6: Zoom(-10); break;
259  }
260  }
261  }
262 }
263 
264 
269 {
270  // Create the main menu that will contain the submenus above
271  auto *menu = new MythMenu(tr("Slideshow Options"), this, "mainmenu");
272 
274  if (im && im->m_type == kVideoFile)
275  menu->AddItem(tr("Play Video"), SLOT(PlayVideo()));
276 
277  if (m_playing)
278  menu->AddItem(tr("Stop"), SLOT(Stop()));
279  else
280  menu->AddItem(tr("Start SlideShow"), SLOT(Play()));
281 
282  if (gCoreContext->GetBoolSetting("GalleryRepeat", false))
283  menu->AddItem(tr("Turn Repeat Off"), SLOT(RepeatOff()));
284  else
285  menu->AddItem(tr("Turn Repeat On"), SLOT(RepeatOn()));
286 
288 
289  if (m_uiHideCaptions)
290  {
291  if (m_showCaptions)
292  menu->AddItem(tr("Hide Captions"), SLOT(HideCaptions()));
293  else
294  menu->AddItem(tr("Show Captions"), SLOT(ShowCaptions()));
295  }
296 
297  QString details;
298  switch (m_infoList.GetState())
299  {
300  case kBasicInfo: details = tr("More Details"); break;
301  case kFullInfo: details = tr("Less Details"); break;
302  default:
303  case kNoInfo: details = tr("Show Details"); break;
304  }
305  menu->AddItem(details, SLOT(ShowInfo()));
306 
307  if (m_infoList.GetState() != kNoInfo)
308  menu->AddItem(tr("Hide Details"), SLOT(HideInfo()));
309 
310  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
311  auto *menuPopup = new MythDialogBox(menu, popupStack, "menuPopup");
312  if (menuPopup->Create())
313  popupStack->AddScreen(menuPopup);
314  else
315  delete menuPopup;
316 }
317 
318 
324 {
326  if (im && !m_playing)
327  {
328  auto *menu = new MythMenu(tr("Transform Options"),
329  this, "metadatamenu");
330  if (m_editsAllowed)
331  {
332  menu->AddItem(tr("Rotate CW"));
333  menu->AddItem(tr("Rotate CCW"));
334  menu->AddItem(tr("Flip Horizontal"));
335  menu->AddItem(tr("Flip Vertical"));
336  menu->AddItem(tr("Reset to Exif"));
337  }
338 
339  if (m_slides.GetCurrent().CanZoomIn())
340  menu->AddItem(tr("Zoom In"));
341 
343  menu->AddItem(tr("Zoom Out"));
344 
345  mainMenu.AddItem(tr("Transforms"), nullptr, menu);
346  }
347 }
348 
349 
358 void GallerySlideView::Start(ImageSlideShowType type, int parentId, int selectedId)
359 {
360  gCoreContext->addListener(this);
361 
362  if (type == kBrowseSlides)
363  {
364  // Browsing views a single ordered directory
365  m_view = new FlatView(kOrdered);
366 
367  // Load db images
368  m_view->LoadFromDb(parentId);
369 
370  // Display current selection, falling back to first
371  m_view->Select(selectedId);
372 
373  // Display slide immediately
374  ShowSlide();
375  }
376  else
377  {
378  int orderInt = gCoreContext->GetNumSetting("GallerySlideOrder", kOrdered);
379 
380  SlideOrderType order = (orderInt < kOrdered) || (orderInt > kSeasonal)
381  ? kOrdered
382  : static_cast<SlideOrderType>(orderInt);
383 
384  // Recursive uses a view of a directory subtree; Normal views a single directory
385  m_view = (type == kRecursiveSlideShow) ? new TreeView(order)
386  : new FlatView(order);
387  // Load db images
388  m_view->LoadFromDb(parentId);
389 
390  // Ordered views start from selected image
391  if (order == kOrdered)
392  // Adjust view so that slideshows show count rather than position
393  m_view->Rotate(selectedId);
394 
395  // No transition for first image
396  Play(false);
397  }
398 }
399 
400 
402 {
404 
405  // Stop further loads
406  m_slides.Teardown();
407 
408  // Update gallerythumbview selection
409  ImagePtrK im = m_view->GetSelected();
410  if (im)
411  emit ImageSelected(im->m_id);
412 
414 }
415 
416 
421 {
422  m_playing = false;
423  m_timer.stop();
424  SetStatus(tr("Stopped"));
425 }
426 
427 
432 void GallerySlideView::Play(bool useTransition)
433 {
434  // Start from next slide
435  ShowNextSlide(1, useTransition);
436 
437  m_playing = true;
438  if (!m_suspended)
439  m_timer.start();
440  SetStatus(tr("Playing"), true);
441 }
442 
443 
448 {
449  m_timer.stop();
450  m_suspended = true;
451 }
452 
453 
458 {
459  m_suspended = false;
460  if (m_playing)
461  m_timer.start();
462 }
463 
464 
470 {
471  ImagePtrK im = m_view->GetSelected();
472  if (im && !m_playing)
473  {
474  ImageIdList list;
475  list.append(im->m_id);
476  QString err = m_mgr.ChangeOrientation(state, list);
477  if (!err.isEmpty())
478  ShowOkPopup(err);
479  }
480 }
481 
482 
487 void GallerySlideView::Zoom(int increment)
488 {
489  if (!m_playing)
490  m_slides.GetCurrent().Zoom(increment);
491 }
492 
493 
498 void GallerySlideView::Pan(QPoint offset)
499 {
500  if (!m_playing)
501  m_slides.GetCurrent().Pan(offset);
502 }
503 
504 
509 {
511 }
512 
513 
518 {
519  m_infoList.Hide();
520 }
521 
522 
527 {
528  m_showCaptions = true;
530 }
531 
532 
537 {
538  m_showCaptions = false;
539  m_uiHideCaptions->SetText(tr("Hide"));
540 }
541 
542 
547 void GallerySlideView::ShowSlide(int direction)
548 {
549  ImagePtrK im = m_view->GetSelected();
550  if (!im)
551  // Reached view limits
552  return;
553 
554  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Selected %1").arg(im->m_filePath));
555 
556  // Suspend the timer until the transition has finished
557  Suspend();
558 
559  // Load image from file
560  if (!m_slides.Load(im, direction))
561  // Image not yet available: show loading status
562  SetStatus(tr("Loading"), true);
563 }
564 
565 
572 {
573  // Transition speed = 0.5x for every slide waiting. Min = 1x, Max = Half buffer size
574  float speed = 0.5 + count / 2.0;
575 
576  // Are we transitioning ?
577  if (m_transitioning)
578  {
579  // More slides waiting for display: accelerate current transition
580  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Changing speed to %1").arg(speed));
581  m_transition.SetSpeed(speed);
582  return;
583  }
584 
585  // We've been waiting for this slide: transition immediately
586  m_transitioning = true;
587 
588  // Take next slide
589  Slide &next = m_slides.GetNext();
590 
591  // Update loading status
592  ClearStatus(next);
593 
594  // Update slide counts
595  if (m_uiSlideCount)
597 
598  int direction = next.GetDirection();
599 
600  // Use instant transition for start-up & updates (dir = 0)
601  // and browsing with transitions turned off
602  Transition &transition =
603  (direction != 0 &&
604  (m_playing || gCoreContext->GetBoolSetting("GalleryBrowseTransition", false)))
606 
607  // Reset any zoom before starting transition
608  Zoom();
609  transition.Start(m_slides.GetCurrent(), next, direction >= 0, speed);
610 }
611 
612 
620 {
621  if (m_IsDeleting)
622  return;
623 
624  m_transitioning = false;
625 
626  // Release old slide, which may start a new transition
628 
629  // No further actions when skipping
630  if (m_transitioning)
631  return;
632 
633  // Preload next slide, if any
635 
636  // Populate display for new slide
638 
639  // Update any file details information
640  m_infoList.Update(im);
641 
642  if (im && m_uiCaptionText)
643  {
644  // show the date & comment
645  QStringList text;
646  text << ImageManagerFe::LongDateOf(im);
647 
648  if (!im->m_comment.isEmpty())
649  text << im->m_comment;
650 
651  m_uiCaptionText->SetText(text.join(" - "));
652  }
653 
654  // Start any video unless we're paused or browsing
655  if (im && im->m_type == kVideoFile)
656  {
657  if (m_playing)
658  PlayVideo();
659  else
660  SetStatus(tr("Video"));
661  }
662 
663  // Resume slideshow timer
664  Release();
665 }
666 
667 
672 {
673  if (m_playing && m_view->HasPrev(inc) == nullptr)
674  {
675  // Prohibit back-wrapping during slideshow: it will cause premature end
676  //: Cannot go back beyond first slide of slideshow
677  SetStatus(tr("Start"));
678  }
679  else if (m_view->Prev(inc))
680  {
681  ShowSlide(-1);
682  }
683 }
684 
685 
691 void GallerySlideView::ShowNextSlide(int inc, bool useTransition)
692 {
693  // Browsing always wraps; slideshows depend on repeat setting
694  if (m_playing && m_view->HasNext(inc) == nullptr
695  && !gCoreContext->GetBoolSetting("GalleryRepeat", false))
696  {
697  // Don't stop due to jumping past end
698  if (inc == 1)
699  {
700  Stop();
701  //: Slideshow has reached last slide
702  SetStatus(tr("End"));
703  }
704  }
705  else if (m_view->Next(inc))
706  ShowSlide(useTransition ? 1 : 0);
707  else
708  {
709  // No images
710  Stop();
711  m_infoList.Hide();
713  if (m_uiSlideCount)
714  m_uiSlideCount->SetText("0/0");
715  if (m_uiCaptionText)
717  }
718 }
719 
720 
725 {
727  return;
728 
730 
731  if (im && im->m_type == kVideoFile)
732  GetMythMainWindow()->HandleMedia("Internal", im->m_url);
733 }
734 
735 
741 void GallerySlideView::SetStatus(QString msg, bool delay)
742 {
743  m_statusText = std::move(msg);
744  if (m_uiStatus)
745  {
746  if (delay)
747  m_delay.start();
748  else
749  ShowStatus();
750  }
751 }
752 
753 
755 {
756  if (m_uiStatus)
758 }
759 
760 
762 {
763  if (m_uiStatus)
764  {
765  m_delay.stop();
766 
767  if (slide.FailedLoad())
768  {
769  ImagePtrK im = slide.GetImageData();
770  SetStatus(tr("Failed to load %1").arg(im ? im->m_filePath : "?"));
771  }
772  else
773  m_uiStatus->Reset();
774  }
775 }
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:164
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:217
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:83
kVideoFile
@ kVideoFile
A video.
Definition: imagetypes.h:39
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, QObject *parent, const char *slot, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:550
ImageSlideShowType
ImageSlideShowType
Type of slide show.
Definition: galleryslideview.h:15
GallerySlideView::m_showCaptions
bool m_showCaptions
If true, captions are shown.
Definition: galleryslideview.h:93
GallerySlideView::Transform
void Transform(ImageFileTransform state)
Action transform request.
Definition: galleryslideview.cpp:469
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:402
GallerySlideView::m_uiSlideCount
MythUIText * m_uiSlideCount
Definition: galleryslideview.h:73
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:1106
GallerySlideView::m_editsAllowed
bool m_editsAllowed
True when edits are enabled.
Definition: galleryslideview.h:95
GallerySlideView::m_mgr
ImageManagerFe & m_mgr
Manages the images.
Definition: galleryslideview.h:77
FlatView::Rotate
void Rotate(int id)
Rotate view so that starting image is at front.
Definition: galleryviews.cpp:427
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:368
kBrowseSlides
@ kBrowseSlides
Definition: galleryslideview.h:16
MythEvent
This class is used as a container for messages.
Definition: mythevent.h:16
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:15
arg
arg(title).arg(filename).arg(doDelete))
GallerySlideView::m_infoList
InfoList m_infoList
Image details overlay.
Definition: galleryslideview.h:86
GallerySlideView::customEvent
void customEvent(QEvent *event) override
Handle custom events.
Definition: galleryslideview.cpp:215
GallerySlideView::Start
void Start(ImageSlideShowType type, int parentId, int selectedId=0)
Start slideshow.
Definition: galleryslideview.cpp:358
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:191
GallerySlideView::m_transitioning
bool m_transitioning
True when a transition is in progress.
Definition: galleryslideview.h:94
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:75
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:44
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:619
Slide::CanZoomIn
bool CanZoomIn() const
Definition: galleryslide.h:170
GallerySlideView::Suspend
void Suspend()
Pause transition timer temporarily.
Definition: galleryslideview.cpp:447
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:74
GallerySlideView::m_uiImage
MythUIImage * m_uiImage
Definition: galleryslideview.h:71
MythUIType::Pulse
virtual void Pulse(void)
Pulse is called 70 times a second to trigger a single frame of an animation.
Definition: mythuitype.cpp:440
GallerySlideView::m_slides
SlideBuffer m_slides
A queue of slides used to display images.
Definition: galleryslideview.h:85
menu
static MythThemedMenu * menu
Definition: mythtv/programs/mythtv-setup/main.cpp:55
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &stackname)
Definition: mythmainwindow.cpp:309
GallerySlideView::Stop
void Stop()
Stop a playing slideshow.
Definition: galleryslideview.cpp:420
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:87
true
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:91
GallerySlideView::SlideAvailable
void SlideAvailable(int count)
Start transition.
Definition: galleryslideview.cpp:571
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
GallerySlideView::ShowNextSlide
void ShowNextSlide(int inc=1, bool useTransition=true)
Display the next slide in the sequence.
Definition: galleryslideview.cpp:691
ImageManagerFe::ChangeOrientation
QString ChangeOrientation(ImageFileTransform transform, const ImageIdList &ids)
Apply an orientation transform to images.
Definition: imagemanager.cpp:2074
GallerySlideView::PlayVideo
void PlayVideo()
Starts internal player for video.
Definition: galleryslideview.cpp:724
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
MythMenu::AddItem
void AddItem(const QString &title, QVariant data=0, MythMenu *subMenu=nullptr, bool selected=false, bool checked=false)
Definition: mythdialogbox.cpp:66
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::ClearStatus
void ClearStatus(Slide &slide)
Definition: galleryslideview.cpp:761
GallerySlideView::m_updateTransition
TransitionNone m_updateTransition
Instant transition that is always used for start-up & image updates.
Definition: galleryslideview.h:83
GallerySlideView::HideCaptions
void HideCaptions()
Hide text widgets.
Definition: galleryslideview.cpp:536
ImageFileTransform
ImageFileTransform
Image transformations.
Definition: imagemetadata.h:46
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:671
GallerySlideView::m_view
FlatView * m_view
List of images comprising the slideshow.
Definition: galleryslideview.h:78
SlideBuffer::Teardown
void Teardown()
Definition: galleryslide.cpp:579
GallerySlideView::Play
void Play(bool useTransition=true)
Start a slideshow.
Definition: galleryslideview.cpp:432
InfoList::Toggle
void Toggle(const ImagePtrK &im)
Toggle infolist state for an image. Focusable widgets toggle between Basic & Full info....
Definition: galleryinfo.cpp:80
Slide::CanZoomOut
bool CanZoomOut() const
Definition: galleryslide.h:171
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:401
GallerySlideView::m_delay
QTimer m_delay
Status delay timer.
Definition: galleryslideview.h:89
MythScreenType::SetFocusWidget
bool SetFocusWidget(MythUIType *widget=nullptr)
Definition: mythscreentype.cpp:117
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:137
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:81
kBlendTransition
@ kBlendTransition
Definition: gallerytransitions.h:18
GallerySlideView::Zoom
void Zoom(int increment=0)
Zoom current slide.
Definition: galleryslideview.cpp:487
GallerySlideView::m_uiStatus
MythUIText * m_uiStatus
Definition: galleryslideview.h:72
ImageManagerFe::LongDateOf
static QString LongDateOf(const ImagePtrK &im)
Return a timestamp/datestamp for an image or dir.
Definition: imagemanager.cpp:2309
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:57
InfoList::GetState
InfoVisibleState GetState() const
Definition: galleryinfo.h:33
GallerySlideView::m_playing
bool m_playing
True when slideshow is running.
Definition: galleryslideview.h:91
GallerySlideView::Create
bool Create() override
Initialises the graphical elements.
Definition: galleryslideview.cpp:72
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:930
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:547
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:90
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:924
InfoList::Hide
bool Hide()
Remove infolist from display.
Definition: galleryinfo.cpp:114
kFullInfo
@ kFullInfo
Shows all exif tags.
Definition: galleryinfo.h:18
GallerySlideView::ShowCaptions
void ShowCaptions()
Show text widgets.
Definition: galleryslideview.cpp:526
GallerySlideView::m_uiCaptionText
MythUIText * m_uiCaptionText
Definition: galleryslideview.h:74
Slide::Zoom
void Zoom(int percentage)
Initiate slide zoom.
Definition: galleryslide.cpp:451
MythMenu
Definition: mythdialogbox.h:92
next
PictureAttribute next(PictureAttributeSupported Supported, PictureAttribute Attribute)
Definition: videoouttypes.h:350
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)
GallerySlideView::SetStatus
void SetStatus(QString msg, bool delay=false)
Displays status text (Loading, Paused etc.)
Definition: galleryslideview.cpp:741
ImageManagerFe
The image manager for use by Frontends.
Definition: imagemanager.h:456
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:1491
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:92
kRotateCW
@ kRotateCW
Rotate clockwise.
Definition: imagemetadata.h:48
GallerySlideView::~GallerySlideView
~GallerySlideView() override
Destructor.
Definition: galleryslideview.cpp:61
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:323
galleryslideview.h
Slideshow screen.
ImageIdList
QList< int > ImageIdList
Definition: imagetypes.h:59
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:135
Transition::Pulse
virtual void Pulse(int interval)=0
GallerySlideView::ShowStatus
void ShowStatus()
Definition: galleryslideview.cpp:754
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:107
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:517
MythScreenType::m_IsDeleting
bool m_IsDeleting
Definition: mythscreentype.h:115
GallerySlideView::Release
void Release()
Unpause transition timer.
Definition: galleryslideview.cpp:457
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:508
InfoList::Create
bool Create(bool focusable)
Initialise buttonlist from XML.
Definition: galleryinfo.cpp:62
GallerySlideView::Pan
void Pan(QPoint offset=QPoint(0, 0))
Pan current slide.
Definition: galleryslideview.cpp:498
SlideBuffer::GetCurrent
Slide & GetCurrent()
Definition: galleryslide.h:227
GetMythPainter
MythPainter * GetMythPainter(void)
Definition: mythmainwindow.cpp:122
GallerySlideView::m_timer
QTimer m_timer
Slide duration timer.
Definition: galleryslideview.h:88
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:119
GallerySlideView::RepeatOn
static void RepeatOn(int on=1)
Definition: galleryslideview.h:60
GallerySlideView::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Handle keypresses.
Definition: galleryslideview.cpp:133
mythmainwindow.h
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:49
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:268
kResetToExif
@ kResetToExif
Reset to Exif value.
Definition: imagemetadata.h:47
GallerySlideView::RepeatOff
static void RepeatOff()
Definition: galleryslideview.h:61
kRotateCCW
@ kRotateCCW
Rotate anti-clockwise.
Definition: imagemetadata.h:49