MythTV  master
galleryslide.cpp
Go to the documentation of this file.
1 #include "galleryslide.h"
2 
3 #include <cmath> // for roundf
4 #include "mythmainwindow.h"
5 #include "mythlogging.h"
6 
7 #include "imagemetadata.h"
8 
9 
10 #define LOC QString("Slide: ")
11 #define SBLOC QString("SlideBuffer: ")
12 
13 
14 // Number of slides to use for buffering image requests.
15 // When browsing quickly the buffer will load consecutive slides until it fills.
16 // If too large, rapid browsing will be stodgy (sequential access) for images that
17 // aren't cached (Cached images are always fast).
18 // If too small, rapid browsing will result in skipping slides rather than flicking
19 // quickly through them.
20 // Minimum is 4: 3 for displaying a transition, 1 to handle load requests
21 #define SLIDE_BUFFER_SIZE 9
22 
23 
29 void AbstractAnimation::Start(bool forwards, float speed)
30 {
31  m_forwards = forwards;
32  m_speed = speed;
33  m_running = true;
34 }
35 
36 
45 void Animation::Set(const QVariant& from, const QVariant& to, int duration,
46  const QEasingCurve& curve, UIEffects::Centre centre)
47 {
48  setStartValue(from);
49  setEndValue(to);
50  m_centre = centre;
51  setDuration(duration);
52  setEasingCurve(curve);
53 }
54 
55 
61 void Animation::Start(bool forwards, float speed)
62 {
63  if (duration() == 0)
64  return;
65 
66  m_elapsed = forwards ? 0 : duration();
67  setCurrentTime(m_elapsed);
68 
69  AbstractAnimation::Start(forwards, speed);
70 }
71 
72 
76 {
77  if (!m_running)
78  return;
79 
80  int64_t current = QDateTime::currentMSecsSinceEpoch();
81  int interval = std::min(static_cast<int>(current - m_lastUpdate), 50);
83  m_elapsed += (m_forwards ? interval : -interval) * static_cast<int>(m_speed);
84  setCurrentTime(m_elapsed);
85 
86  // Detect completion
87  if ((m_forwards && m_elapsed >= duration()) || (!m_forwards && m_elapsed <= 0))
88  Finished();
89 }
90 
91 
96 void Animation::updateCurrentValue(const QVariant &value)
97 {
98  if (m_parent && m_running)
99  {
101 
102  switch (m_type)
103  {
104  case None: break;
105  case Position: m_parent->SetPosition(value.toPoint()); break;
106  case Alpha: m_parent->SetAlpha(value.toInt()); break;
107  case Zoom: m_parent->SetZoom(value.toFloat()); break;
108  case HorizontalZoom: m_parent->SetHorizontalZoom(value.toFloat()); break;
109  case VerticalZoom: m_parent->SetVerticalZoom(value.toFloat()); break;
110  case Angle: m_parent->SetAngle(value.toFloat()); break;
111  }
112  }
113 }
114 
115 
121 {
122  // Signal group when child completes
123  m_group.append(child);
124  connect(child, &AbstractAnimation::finished, this, &GroupAnimation::Finished);
125 }
126 
127 
132 {
133  qDeleteAll(m_group);
134  m_group.clear();
135 }
136 
137 
141 {
142  if (!m_running || m_current < 0 || m_current >= m_group.size())
143  return;
144 
145  // Pulse current running child
146  m_group.at(m_current)->Pulse();
147 }
148 
149 
155 void SequentialAnimation::Start(bool forwards, float speed)
156 {
157  if (m_group.empty())
158  return;
159 
160  m_current = forwards ? 0 : m_group.size() - 1;
161 
162  // Start group, then first child
163  GroupAnimation::Start(forwards, speed);
164  m_group.at(m_current)->Start(m_forwards, m_speed);
165 }
166 
167 
173 {
174  // Set group speed for subsequent children
176 
177  // Set active child
178  if (!m_running || m_current < 0 || m_current >= m_group.size())
179  return;
180 
181  m_group.at(m_current)->SetSpeed(speed);
182 }
183 
184 
189 {
190  // Finish group when last child finishes
191  if ((m_forwards && ++m_current == m_group.size())
192  || (!m_forwards && --m_current < 0))
194  else
195  // Start next child
196  m_group.at(m_current)->Start(m_forwards, m_speed);
197 }
198 
199 
203 {
204  if (m_running)
205  {
206  // Pulse all children
207  for (AbstractAnimation *animation : qAsConst(m_group))
208  animation->Pulse();
209  }
210 }
211 
212 
218 void ParallelAnimation::Start(bool forwards, float speed)
219 {
220  if (m_group.empty())
221  return;
222 
223  m_finished = m_group.size();
224 
225  // Start group, then all children
226  GroupAnimation::Start(forwards, speed);
227  for (AbstractAnimation *animation : qAsConst(m_group))
228  animation->Start(m_forwards, m_speed);
229 }
230 
231 
237 {
238  // Set group speed, then all children
240  for (AbstractAnimation *animation : qAsConst(m_group))
241  animation->SetSpeed(m_speed);
242 }
243 
244 
249 {
250  // Finish group when last child finishes
251  if (--m_finished == 0)
253 }
254 
255 
260 void PanAnimation::updateCurrentValue(const QVariant &value)
261 {
262  if (m_parent && m_running)
263  {
264  Slide *image = m_parent;
265  image->SetPan(value.toPoint());
266  }
267 }
268 
269 
276 Slide::Slide(MythUIType *parent, const QString& name, MythUIImage *image)
277  : MythUIImage(parent, name)
278 {
279  // Clone from image
280  CopyFrom(image);
281 
282  // Null parent indicates we should become a child of the image (after
283  // copy to avoid recursion)
284  if (!parent)
285  {
286  // Slides sit on top of parent image area
287  SetArea(MythRect(image->GetArea().toQRect()));
288  m_area.moveTo(0, 0);
289  setParent(image);
290  m_parent = image;
291  image->AddChild(this);
292  }
293 
294  // Provide animations for pan & zoom
295  if (GetPainter()->SupportsAnimation())
296  {
298  m_panAnimation = new PanAnimation(this);
299  }
300 
301  connect(this, &MythUIImage::LoadComplete, this, &Slide::SlideLoaded);
302 }
303 
304 
309 {
310  delete m_zoomAnimation;
311  delete m_panAnimation;
312  LOG(VB_GUI, LOG_DEBUG, "Deleted Slide " + objectName());
313 }
314 
315 
320 {
321  m_state = kEmpty;
322  m_data.clear();
323  m_waitingFor.clear();
324  SetCropRect(0, 0, 0, 0);
325  SetVisible(false);
326 }
327 
328 
333 QChar Slide::GetDebugState() const
334 {
335  switch (m_state)
336  {
337  case kEmpty: return 'e';
338  case kFailed: return 'f';
339  case kLoaded: return m_waitingFor ? 'r' : 'a';
340  case kLoading: return m_waitingFor ? 'l' : 'p';
341  }
342  return '?';
343 }
344 
345 
358 bool Slide::LoadSlide(const ImagePtrK& im, int direction, bool notifyCompletion)
359 {
360  m_direction = direction;
361  m_waitingFor = notifyCompletion ? im : ImagePtrK();
362 
363  if (im == m_data)
364  {
365  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Already loading/loaded %1 in %2")
366  .arg(im->m_filePath, objectName()));
367 
368  if (m_state >= kLoaded && notifyCompletion)
369  // Image has been pre-loaded
370  emit ImageLoaded(this);
371 
372  return (m_state >= kLoaded);
373  }
374 
375  // Is a different image loading ?
376  if (m_state == kLoading)
377  {
378  // Can't abort image loads, so must wait for it to finish
379  // before starting new load
380  m_waitingFor = im;
381 
382  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Postponing load of %1 in %2")
383  .arg(im->m_filePath, objectName()));
384 
385  return false;
386  }
387 
388  // Start load
389  m_data = im;
390  m_state = kLoading;
391 
392  if (im->m_type == kVideoFile)
393  {
394  // Use thumbnail, which has already been orientated
395  SetFilename(im->m_thumbNails.at(0).second);
396  SetOrientation(1);
397  }
398  else
399  {
400  // Load image, compensating for any Qt auto-orientation
401  SetFilename(im->m_url);
402  SetOrientation(Orientation(m_data->m_orientation).GetCurrent(true));
403  }
404 
405  // Load in background
406  Load(true);
407  return false;
408 }
409 
410 
418 {
419  m_state = m_images[0] ? kLoaded : kFailed;
420  if (m_state == kFailed)
421  LOG(VB_GENERAL, LOG_ERR, LOC +
422  QString("Failed to load %1").arg(m_data->m_filePath));
423 
424  // Ignore superseded requests and preloads
425  if (m_data == m_waitingFor)
426  {
427  // Loaded image is the latest requested
428  emit ImageLoaded(this);
429  }
430  else if (m_waitingFor)
431  {
432  LOG(VB_FILE, LOG_DEBUG, LOC + QString("Starting delayed load %1")
433  .arg(m_waitingFor->m_filePath));
434 
435  // Start latest postponed load
437  }
438 }
439 
440 
446 void Slide::Zoom(int percentage)
447 {
448  // Sentinel indicates reset to default zoom
449  float newZoom = (percentage == 0)
450  ? 1.0F
451  : qMax(MIN_ZOOM,
452  qMin(MAX_ZOOM, m_zoom * (1.0F + percentage / 100.0F)));
453  if (newZoom != m_zoom)
454  {
455  if (m_zoomAnimation)
456  {
457  m_zoomAnimation->Set(m_zoom, newZoom, 250, QEasingCurve::OutQuad);
459  }
460  else
461  SetZoom(newZoom);
462  }
463 }
464 
465 
472 void Slide::SetZoom(float zoom)
473 {
474  m_zoom = zoom;
476 
477  // TODO
478  // MythUIImage displaces widget or doesn't centre for some combinations of
479  // zoom centre/cropping so frig centre for now.
481 
482  SetPan(m_pan);
483 }
484 
485 
490 void Slide::Pan(QPoint offset)
491 {
492  // Panning only possible when zoomed in
493  if (m_zoom > 1.0F)
494  {
495  QPoint start = m_pan;
496 
497  // Sentinel indicates reset to centre
498  // Panning is applied to original (unzoomed) image co-ords.
499  // Adjust offset for zoom so that pan moves a constant screen distance rather
500  // than constant image distance
501  QPoint dest = offset.isNull() ? QPoint(0, 0) : start + offset / m_zoom;
502 
503  if (m_panAnimation)
504  {
505  m_panAnimation->Set(start, dest, 250, QEasingCurve::Linear);
507  }
508  else
509  SetPan(dest);
510  }
511 }
512 
513 
520 void Slide::SetPan(QPoint pos)
521 {
522  if (m_state == kFailed)
523  {
524  m_pan = pos;
525  return;
526  }
527 
528  // Determine zoom of largest dimension
529  QRect imageArea = m_images[m_curPos]->rect();
530  float hRatio = float(imageArea.height()) / m_area.height();
531  float wRatio = float(imageArea.width()) / m_area.width();
532  float ratio = qMax(hRatio, wRatio);
533 
534  if (m_zoom != 0.0F)
535  ratio /= m_zoom;
536 
537  // Determine crop area
538  int h = qMin(int(roundf(m_area.height() * ratio)), imageArea.height());
539  int w = qMin(int(roundf(m_area.width() * ratio)), imageArea.width());
540  int x = imageArea.center().x() - w / 2;
541  int y = imageArea.center().y() - h / 2;
542 
543  // Constrain pan to boundaries
544  int limitX = (imageArea.width() - w) / 2;
545  int limitY = (imageArea.height() - h) / 2;
546  m_pan.setX(qMax(qMin(pos.x(), limitX), -limitX));
547  m_pan.setY(qMax(qMin(pos.y(), limitY), -limitY));
548 
549  SetCropRect(x + m_pan.x(), y + m_pan.y(), w, h);
550  SetRedraw();
551 }
552 
553 
558 {
559  // Update zoom/pan animations
560  if (m_zoomAnimation)
562 
563  if (m_panAnimation)
565 }
566 
567 
569 {
570  LOG(VB_GUI, LOG_DEBUG, "Deleted Slidebuffer");
571 }
572 
573 
575 {
576  QMutexLocker lock(&m_mutexQ);
577  for (Slide *s : qAsConst(m_queue))
578  s->Clear();
579  LOG(VB_GUI, LOG_DEBUG, "Aborted Slidebuffer");
580 }
581 
582 
589 {
590  // Require at least 4 slides: 2 for transitions, 1 to handle further requests
591  // and 1 to prevent solitary slide from being used whilst it is loading
592  int size = qMax(SLIDE_BUFFER_SIZE, 4);
593 
594  // Fill buffer with slides cloned from the XML image widget
595 
596  // Create first as a child of the XML image.
597  auto *slide = new Slide(nullptr, "slide0", &image);
598 
599  // Buffer is notified when it has loaded image
600  connect(slide, &Slide::ImageLoaded,
601  this, qOverload<Slide*>(&SlideBuffer::Flush));
602 
603  m_queue.enqueue(slide);
604 
605  // Rest are simple clones of first
606  for (int i = 1; i < size; ++i)
607  {
608  slide = new Slide(&image, QString("slide%1").arg(i), slide);
609 
610  // All slides (except first) start off hidden
611  slide->SetVisible(false);
612 
613  // Buffer is notified when it has loaded image
614  connect(slide, &Slide::ImageLoaded,
615  this, qOverload<Slide*>(&SlideBuffer::Flush));
616 
617  m_queue.enqueue(slide);
618  }
619 
620  m_nextLoad = 1;
621 }
622 
623 
629 {
630  QMutexLocker lock(&m_mutexQ);
631 
632  QString state;
633  for (int i = 0; i < m_queue.size(); ++i)
634  {
635  QChar code(m_queue.at(i)->GetDebugState());
636  state += (i == m_nextLoad ? code.toUpper() : code);
637  }
638  return QString("[%1] (%2)").arg(state, m_queue.head()->objectName());
639 }
640 
641 
649 bool SlideBuffer::Load(const ImagePtrK& im, int direction)
650 {
651  if (!im)
652  return false;
653 
654  QMutexLocker lock(&m_mutexQ);
655 
656  // Start loading image in next available slide
657  Slide *slide = m_queue.at(m_nextLoad);
658 
659  // Further load requests will go to same slide if no free ones are available
660  if (m_nextLoad < m_queue.size() - 1)
661  ++m_nextLoad;
662 
663  LOG(VB_FILE, LOG_DEBUG, SBLOC + QString("Loading %1 in %2, %3")
664  .arg(im->m_filePath, slide->objectName()).arg(BufferState()));
665 
666  return slide->LoadSlide(im, direction, true);
667 }
668 
669 
675 {
676  if (!im)
677  return;
678 
679  QMutexLocker lock(&m_mutexQ);
680 
681  // Start loading image in next available slide
682  Slide *slide = m_queue.at(m_nextLoad);
683 
684  LOG(VB_FILE, LOG_DEBUG, SBLOC + QString("Preloading %1 in %2, %3")
685  .arg(im->m_filePath, slide->objectName()).arg(BufferState()));
686 
687  // Load silently
688  slide->LoadSlide(im);
689 }
690 
691 
697 {
698  QMutexLocker lock(&m_mutexQ);
699 
700  // Reset slide & return to buffer for re-use
701  Slide *slide = m_queue.dequeue();
702  slide->Clear();
703  m_queue.enqueue(slide);
704 
705  QString name = slide->objectName();
706 
707  // Free constrained load ptr now a spare slide is available
708  if (!m_queue.at(--m_nextLoad)->IsEmpty())
709  ++m_nextLoad;
710 
711  LOG(VB_FILE, LOG_DEBUG, SBLOC + QString("Released %1").arg(name));
712 
713  // Flush any pending slides that originate from multiple requests (skipping)
714  Flush(m_queue.head(), "Pending");
715 }
716 
717 
724 void SlideBuffer::Flush(Slide *slide, const QString& reason)
725 {
726  QMutexLocker lock(&m_mutexQ);
727 
728  // Determine number of consecutive slides that are now available after head
729  // Include last slide to ensure transition speed is consistent: it will never
730  // be displayed because queue size is always > 2
731  int available = 1;
732  while (available < m_queue.size() && m_queue.at(available)->IsLoaded())
733  ++available;
734 
735  if (available == 1)
736  return;
737 
738  // Notify that more slides are available
739  ImagePtrK im = slide->GetImageData();
740  QString path = im ? im->m_filePath : "Unknown";
741 
742  LOG(VB_FILE, LOG_DEBUG, SBLOC + QString("%1 %2 in %3, %4")
743  .arg(reason, path, slide->objectName()).arg(BufferState()));
744 
745  emit SlideReady(--available);
746 }
747 
749 {
750  Flush(slide, "Loaded");
751 };
Slide::kFailed
@ kFailed
Definition: galleryslide.h:189
Slide::~Slide
~Slide() override
Destructor.
Definition: galleryslide.cpp:308
MythUIType::m_area
MythRect m_area
Definition: mythuitype.h:271
ImagePtrK
QSharedPointer< ImageItemK > ImagePtrK
Definition: imagetypes.h:164
Slide
A specialised image for slideshows.
Definition: galleryslide.h:157
UIEffects::TopLeft
@ TopLeft
Definition: mythuianimation.h:13
build_compdb.dest
dest
Definition: build_compdb.py:9
Slide::SetZoom
void SetZoom(float zoom)
Sets slide zoom.
Definition: galleryslide.cpp:472
ParallelAnimation::SetSpeed
void SetSpeed(float speed) override
Change speed of group and all child animations.
Definition: galleryslide.cpp:236
Slide::m_pan
QPoint m_pan
Pan position (0,0) = no pan.
Definition: galleryslide.h:200
MythUIImage
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
Animation::m_lastUpdate
int64_t m_lastUpdate
Definition: galleryslide.h:86
MIN_ZOOM
#define MIN_ZOOM
Definition: galleryslide.h:20
kVideoFile
@ kVideoFile
A video.
Definition: imagetypes.h:39
AbstractAnimation::Finished
virtual void Finished()
To be called when animation completes.
Definition: galleryslide.h:40
Animation::m_centre
UIEffects::Centre m_centre
Definition: galleryslide.h:82
MythUIImage::m_images
QHash< int, MythImage * > m_images
Definition: mythuiimage.h:170
Animation::HorizontalZoom
@ HorizontalZoom
Definition: galleryslide.h:59
SequentialAnimation::Finished
void Finished() override
A child animation has completed.
Definition: galleryslide.cpp:188
MythRect::toQRect
QRect toQRect(void) const
Definition: mythrect.cpp:405
Slide::Pulse
void Pulse() override
Update pan & zoom animations.
Definition: galleryslide.cpp:557
SlideBuffer::SlideReady
void SlideReady(int count)
Signals that buffer has (count) loaded slides awaiting display.
SLIDE_BUFFER_SIZE
#define SLIDE_BUFFER_SIZE
Definition: galleryslide.cpp:21
ParallelAnimation::Finished
void Finished() override
A child animation has completed.
Definition: galleryslide.cpp:248
Slide::m_panAnimation
PanAnimation * m_panAnimation
Dedicated animation for panning, if supported.
Definition: galleryslide.h:199
Slide::Slide
Slide(MythUIType *parent, const QString &name, MythUIImage *image)
Clone slide from a theme MythUIImage.
Definition: galleryslide.cpp:276
MythUIImage::Load
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
Definition: mythuiimage.cpp:968
Slide::SlideLoaded
void SlideLoaded()
An image has completed loading.
Definition: galleryslide.cpp:417
SequentialAnimation::m_current
int m_current
Index of child currently playing.
Definition: galleryslide.h:124
arg
arg(title).arg(filename).arg(doDelete))
MythUIType::GetPainter
virtual MythPainter * GetPainter(void)
Definition: mythuitype.cpp:1399
AbstractAnimation::m_forwards
bool m_forwards
Play direction.
Definition: galleryslide.h:47
MythUIImage::SetOrientation
void SetOrientation(int orientation)
Saves the exif orientation value of the first image in the widget.
Definition: mythuiimage.cpp:921
MythUIType::SetArea
virtual void SetArea(const MythRect &rect)
Definition: mythuitype.cpp:595
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
Animation::m_elapsed
int m_elapsed
Current millisec position within animation, 0..duration.
Definition: galleryslide.h:85
GroupAnimation::m_group
QList< AbstractAnimation * > m_group
Definition: galleryslide.h:105
Slide::kLoading
@ kLoading
Definition: galleryslide.h:189
MythRect
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:17
AbstractAnimation
Base animation class that is driven by a Myth pulse and implements variable speed.
Definition: galleryslide.h:27
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
MAX_ZOOM
#define MAX_ZOOM
Definition: galleryslide.h:21
Orientation::GetCurrent
int GetCurrent(bool compensate)
Determines orientation required for an image.
Definition: imagemetadata.cpp:85
Animation::Angle
@ Angle
Definition: galleryslide.h:59
MythUIType::GetArea
virtual MythRect GetArea(void) const
If the object has a minimum area defined, return it, other wise return the default area.
Definition: mythuitype.cpp:870
MythUIType::AddChild
void AddChild(MythUIType *child)
Add a child UIType.
Definition: mythuitype.cpp:86
MythUIType::m_effects
UIEffects m_effects
Definition: mythuitype.h:278
SlideBuffer::ReleaseCurrent
void ReleaseCurrent()
Move head slide to back of queue and flush waiting slides.
Definition: galleryslide.cpp:696
Slide::m_data
ImagePtrK m_data
The image currently loading/loaded.
Definition: galleryslide.h:192
Animation::m_type
Type m_type
Definition: galleryslide.h:81
Animation::Set
void Set(const QVariant &from, const QVariant &to, int duration=500, const QEasingCurve &curve=QEasingCurve::InOutCubic, UIEffects::Centre centre=UIEffects::Middle)
Initialises an animation.
Definition: galleryslide.cpp:45
Animation::Pulse
void Pulse() override
Progress single animation.
Definition: galleryslide.cpp:75
MythUIImage::SetCropRect
void SetCropRect(int x, int y, int width, int height)
Crop the image using the given rectangle, useful for removing unsightly edges from imported images or...
Definition: mythuiimage.cpp:949
Slide::kEmpty
@ kEmpty
Definition: galleryslide.h:189
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:649
SlideBuffer::m_nextLoad
int m_nextLoad
Index of first spare slide, (or last slide if none spare)
Definition: galleryslide.h:254
MythUIType::SetAlpha
void SetAlpha(int newalpha)
Definition: mythuitype.cpp:931
AbstractAnimation::Start
virtual void Start(bool forwards, float speed=1.0)
Initialise & start base animation.
Definition: galleryslide.cpp:29
AbstractAnimation::m_speed
float m_speed
Real-time = 1.0, Double-speed = 2.0.
Definition: galleryslide.h:49
mythlogging.h
SlideBuffer::Teardown
void Teardown()
Definition: galleryslide.cpp:574
PanAnimation::updateCurrentValue
void updateCurrentValue(const QVariant &value) override
Update pan value.
Definition: galleryslide.cpp:260
MythUIImage::LoadComplete
void LoadComplete()
MythUIImage::m_curPos
unsigned int m_curPos
Definition: mythuiimage.h:178
LOC
#define LOC
Definition: galleryslide.cpp:10
MythUIType::SetPosition
void SetPosition(int x, int y)
Convenience method, calls SetPosition(const MythPoint&) Override that instead to change functionality...
Definition: mythuitype.cpp:518
SlideBuffer::Flush
void Flush(Slide *slide, const QString &reason)
Signal if any slides are waiting to be displayed.
Definition: galleryslide.cpp:724
SBLOC
#define SBLOC
Definition: galleryslide.cpp:11
UIEffects::Middle
@ Middle
Definition: mythuianimation.h:14
Slide::Clear
void Clear()
Reset slide to unused state.
Definition: galleryslide.cpp:319
Slide::m_zoom
float m_zoom
Current zoom, 1.0 = fullsize.
Definition: galleryslide.h:195
GroupAnimation::Start
void Start(bool forwards, float speed=1.0) override
Initialise & start base animation.
Definition: galleryslide.h:97
Slide::Pan
void Pan(QPoint offset)
Initiate pan.
Definition: galleryslide.cpp:490
Slide::LoadSlide
bool LoadSlide(const ImagePtrK &im, int direction=0, bool notifyCompletion=false)
Load slide with an image.
Definition: galleryslide.cpp:358
Slide::SetPan
void SetPan(QPoint pos)
Sets slide pan.
Definition: galleryslide.cpp:520
MythUIType::m_parent
MythUIType * m_parent
Definition: mythuitype.h:291
Slide::ImageLoaded
void ImageLoaded(Slide *)
Generated when the last requested image has loaded.
Slide::GetImageData
ImagePtrK GetImageData() const
Definition: galleryslide.h:166
Animation::m_parent
Slide * m_parent
Image to be animated.
Definition: galleryslide.h:80
Slide::m_state
SlideState m_state
Slide validity.
Definition: galleryslide.h:191
MythUIImage::CopyFrom
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
Definition: mythuiimage.cpp:1429
UIEffects::m_centre
Centre m_centre
Definition: mythuianimation.h:40
AbstractAnimation::m_running
bool m_running
True whilst animation is active.
Definition: galleryslide.h:48
SlideBuffer::Preload
void Preload(const ImagePtrK &im)
Load an image in next available slide.
Definition: galleryslide.cpp:674
Slide::GetDebugState
QChar GetDebugState() const
Return debug status.
Definition: galleryslide.cpp:333
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:84
SlideBuffer::Initialise
void Initialise(MythUIImage &image)
Construct buffer.
Definition: galleryslide.cpp:588
Animation::Zoom
@ Zoom
Definition: galleryslide.h:59
Animation
A single animation controlling alpha, zoom, rotation and position.
Definition: galleryslide.h:55
Animation::Position
@ Position
Definition: galleryslide.h:59
galleryslide.h
Defines specialised images used by the Gallery slideshow and the animation framework used by transfor...
Slide::Zoom
void Zoom(int percentage)
Initiate slide zoom.
Definition: galleryslide.cpp:446
SlideBuffer::m_mutexQ
QMutex m_mutexQ
Queue protection.
Definition: galleryslide.h:252
UIEffects::m_vzoom
float m_vzoom
Definition: mythuianimation.h:38
SequentialAnimation::Start
void Start(bool forwards, float speed=1.0) override
Start sequential animation.
Definition: galleryslide.cpp:155
Slide::kLoaded
@ kLoaded
Definition: galleryslide.h:189
Slide::m_zoomAnimation
Animation * m_zoomAnimation
Dedicated animation for zoom, if supported.
Definition: galleryslide.h:198
ParallelAnimation::Start
void Start(bool forwards, float speed=1.0) override
Start parallel group. All children play simultaneously.
Definition: galleryslide.cpp:218
GroupAnimation::SetSpeed
void SetSpeed(float speed) override
Definition: galleryslide.h:99
imagemetadata.h
Handles Exif/FFMpeg metadata tags for images.
SequentialAnimation::Pulse
void Pulse() override
Progress sequential animation.
Definition: galleryslide.cpp:140
SlideBuffer::BufferState
QString BufferState()
Determines buffer state for debug logging.
Definition: galleryslide.cpp:628
GroupAnimation::Add
virtual void Add(AbstractAnimation *child)
Add child animation to group.
Definition: galleryslide.cpp:120
MythUIType::SetVisible
virtual void SetVisible(bool visible)
Definition: mythuitype.cpp:1086
SequentialAnimation::SetSpeed
void SetSpeed(float speed) override
Change speed of current child animation and all subsequent ones.
Definition: galleryslide.cpp:172
UIEffects::Centre
Centre
Definition: mythuianimation.h:13
ParallelAnimation::m_finished
int m_finished
Count of child animations that have finished.
Definition: galleryslide.h:142
ParallelAnimation::Pulse
void Pulse() override
Progress parallel animations.
Definition: galleryslide.cpp:202
Slide::m_direction
int m_direction
Navigation that created this image, -1 = Prev, 0 = Update, 1 = Next.
Definition: galleryslide.h:197
MythUIType::SetHorizontalZoom
void SetHorizontalZoom(float zoom)
Definition: mythuitype.cpp:956
Animation::VerticalZoom
@ VerticalZoom
Definition: galleryslide.h:59
GroupAnimation::Clear
void Clear() override
Delete all child animations.
Definition: galleryslide.cpp:131
PanAnimation
Specialised animation for panning slideshow images (MythUI doesn't support panning)
Definition: galleryslide.h:148
SlideBuffer::m_queue
QQueue< Slide * > m_queue
Queue of slides.
Definition: galleryslide.h:253
MythUIType::SetCentre
void SetCentre(UIEffects::Centre centre)
Definition: mythuitype.cpp:945
MythUIType::SetAngle
void SetAngle(float angle)
Definition: mythuitype.cpp:968
UIEffects::m_hzoom
float m_hzoom
Definition: mythuianimation.h:37
MythUIType::SetVerticalZoom
void SetVerticalZoom(float zoom)
Definition: mythuitype.cpp:962
MythUIImage::SetFilename
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
Definition: mythuiimage.cpp:676
Slide::m_waitingFor
ImagePtrK m_waitingFor
The most recently requested image. Null for preloads. Differs from m_data when skipping.
Definition: galleryslide.h:194
Animation::Start
void Start(bool forwards=true, float speed=1.0) override
Start a single animation.
Definition: galleryslide.cpp:61
mythmainwindow.h
SlideBuffer::~SlideBuffer
~SlideBuffer() override
Definition: galleryslide.cpp:568
MythUIType::SetRedraw
void SetRedraw(void)
Definition: mythuitype.cpp:294
Animation::None
@ None
Definition: galleryslide.h:59
Animation::Alpha
@ Alpha
Definition: galleryslide.h:59
AbstractAnimation::finished
void finished()
Signals animation has finished.
Orientation
Encapsulates Exif orientation processing.
Definition: imagemetadata.h:62
Animation::updateCurrentValue
void updateCurrentValue(const QVariant &value) override
Update animated value.
Definition: galleryslide.cpp:96