MythTV
master
|
A datastore of images for display by a screen. More...
#include <mythfrontend/galleryviews.h>
Public Member Functions | |
FlatView (SlideOrderType order) | |
virtual | ~FlatView () |
int | GetParentId () const |
ImageListK | GetAllNodes () const |
Get all images/dirs in view. More... | |
ImagePtrK | GetSelected () const |
Get current selection. More... | |
ImagePtrK | HasNext (int inc) const |
Peeks at next image in view but does not advance iterator. More... | |
ImagePtrK | HasPrev (int inc) const |
Peeks at previous image in view but does not decrement iterator. More... | |
ImagePtrK | Next (int inc) |
Advance iterator and return next image, wrapping if necessary. Regenerates unordered views on wrap. More... | |
ImagePtrK | Prev (int inc) |
Decrements iterator and returns previous image. Wraps at start. More... | |
QString | GetPosition () const |
Get positional status. More... | |
bool | Select (int id, int fallback=0) |
Selects first occurrence of an image. More... | |
virtual bool | LoadFromDb (int parentId) |
Populate view with database images from a directory. More... | |
QStringList | ClearImage (int id, bool remove=false) |
Clear file from UI cache and optionally from view. More... | |
void | ClearCache () |
Clears UI cache. More... | |
bool | Update (int id) |
Updates view with images that have been updated. More... | |
void | Rotate (int id) |
Rotate view so that starting image is at front. More... | |
void | Clear (bool resetParent=true) |
Reset view. More... | |
QString | GetCachedThumbUrl (int id) const |
Protected Member Functions | |
void | Populate (ImageList &files) |
Fills view with Db images, re-ordering them as required. More... | |
void | Cache (int id, int parent, const QString &url, const QString &thumb) |
Cache image properties to optimize UI. More... | |
Static Protected Member Functions | |
static WeightList | CalculateSeasonalWeights (ImageList &files) |
This method calculates a weight for the item based on how closely it was taken to the current time of year. This means that New Year's pictures will be displayed very frequently on every New Year's, and that anniversary pictures will be favored again every anniversary. The weights are chosen using a beta distribution with a tunable shape parameter. More... | |
Protected Attributes | |
int | m_parentId {-1} |
SlideOrderType | m_order {kOrdered} |
ImageManagerFe & | m_mgr |
QHash< int, ImagePtrK > | m_images |
Image objects currently displayed. More... | |
ImageIdList | m_sequence |
The sequence in which to display images. More... | |
int | m_active {0} |
Sequence index of current selected image. More... | |
QHash< int, FileCacheEntry > | m_fileCache |
Caches displayed image files. More... | |
A datastore of images for display by a screen.
A flat view provides a list of ordered images (no dirs) from a single directory (as required by a slideshow of a directory).
Definition at line 98 of file galleryviews.h.
|
inlineexplicit |
Definition at line 101 of file galleryviews.h.
|
inlinevirtual |
Definition at line 103 of file galleryviews.h.
|
inline |
Definition at line 105 of file galleryviews.h.
Referenced by GalleryThumbView::customEvent(), GalleryThumbView::DoShowHidden(), GalleryThumbView::DoShowType(), and GalleryThumbView::ShowSettings().
ImageListK FlatView::GetAllNodes | ( | ) | const |
Get all images/dirs in view.
Definition at line 53 of file galleryviews.cpp.
Referenced by GalleryThumbView::BuildImageList().
ImagePtrK FlatView::GetSelected | ( | ) | const |
Get current selection.
Definition at line 66 of file galleryviews.cpp.
Referenced by GalleryThumbView::BuildImageList(), GallerySlideView::Close(), GalleryThumbView::customEvent(), GallerySlideView::customEvent(), GalleryThumbView::DirSelectDown(), GalleryThumbView::DoMarkItem(), DirectoryView::GetMenuSubjects(), GalleryThumbView::keyPressEvent(), DirectoryView::LoadFromDb(), GalleryThumbView::ShowDetails(), GallerySlideView::ShowSlide(), GalleryThumbView::StartSlideshow(), GallerySlideView::Transform(), GalleryThumbView::TransformItem(), and Update().
ImagePtrK FlatView::HasNext | ( | int | inc | ) | const |
Peeks at next image in view but does not advance iterator.
Definition at line 154 of file galleryviews.cpp.
Referenced by GallerySlideView::ShowNextSlide(), and GallerySlideView::TransitionComplete().
ImagePtrK FlatView::HasPrev | ( | int | inc | ) | const |
Peeks at previous image in view but does not decrement iterator.
Definition at line 188 of file galleryviews.cpp.
Referenced by GallerySlideView::ShowPrevSlide().
ImagePtrK FlatView::Next | ( | int | inc | ) |
Advance iterator and return next image, wrapping if necessary. Regenerates unordered views on wrap.
Definition at line 166 of file galleryviews.cpp.
Referenced by GallerySlideView::ShowNextSlide().
ImagePtrK FlatView::Prev | ( | int | inc | ) |
Decrements iterator and returns previous image. Wraps at start.
Definition at line 199 of file galleryviews.cpp.
Referenced by GallerySlideView::ShowPrevSlide().
QString FlatView::GetPosition | ( | ) | const |
Get positional status.
Definition at line 77 of file galleryviews.cpp.
Referenced by GallerySlideView::SlideAvailable().
bool FlatView::Select | ( | int | id, |
int | fallback = 0 |
||
) |
Selects first occurrence of an image.
id | Image id |
fallback | View index to select if image is not in view. Defaults to first image. If negative then current selection is not changed if the image is not found |
Definition at line 119 of file galleryviews.cpp.
Referenced by GalleryThumbView::DirSelectUp(), DirectoryView::LoadFromDb(), GalleryThumbView::SelectImage(), GalleryThumbView::SetUiSelection(), and GallerySlideView::Start().
|
virtual |
Populate view with database images from a directory.
parentId | The dir id, if positive. Otherwise the view is refreshed using the existing parent dir |
Reimplemented in TreeView, and DirectoryView.
Definition at line 367 of file galleryviews.cpp.
Referenced by Next(), and GallerySlideView::Start().
Clear file from UI cache and optionally from view.
id | |
remove | If true, file is also deleted from view |
Definition at line 399 of file galleryviews.cpp.
Referenced by DirectoryView::RemoveImage().
void FlatView::ClearCache | ( | ) |
Clears UI cache.
Definition at line 386 of file galleryviews.cpp.
Referenced by DirectoryView::ClearCache().
bool FlatView::Update | ( | int | id | ) |
Updates view with images that have been updated.
id | Image id to update |
Definition at line 88 of file galleryviews.cpp.
Referenced by GallerySlideView::customEvent().
void FlatView::Rotate | ( | int | id | ) |
Rotate view so that starting image is at front.
id | The image to be positioned |
Definition at line 426 of file galleryviews.cpp.
Referenced by GallerySlideView::Start().
Reset view.
resetParent | parent id is only reset to root when this is set |
Definition at line 140 of file galleryviews.cpp.
Referenced by DirectoryView::Clear(), Populate(), and ~FlatView().
|
inline |
Definition at line 121 of file galleryviews.h.
Referenced by GalleryThumbView::customEvent().
|
staticprotected |
This method calculates a weight for the item based on how closely it was taken to the current time of year. This means that New Year's pictures will be displayed very frequently on every New Year's, and that anniversary pictures will be favored again every anniversary. The weights are chosen using a beta distribution with a tunable shape parameter.
files | List of database images |
Definition at line 308 of file galleryviews.cpp.
Referenced by Populate().
|
protected |
Fills view with Db images, re-ordering them as required.
files | List of images from database |
Definition at line 217 of file galleryviews.cpp.
Referenced by LoadFromDb(), DirectoryView::LoadFromDb(), and TreeView::LoadFromDb().
|
protected |
Cache image properties to optimize UI.
Definition at line 447 of file galleryviews.cpp.
Referenced by DirectoryView::Cache(), and Populate().
|
protected |
Definition at line 130 of file galleryviews.h.
Referenced by Clear(), GetParentId(), LoadFromDb(), DirectoryView::LoadFromDb(), TreeView::LoadFromDb(), and Next().
|
protected |
Definition at line 131 of file galleryviews.h.
Referenced by Next(), and Populate().
|
protected |
Definition at line 132 of file galleryviews.h.
Referenced by DirectoryView::LoadDirThumbs(), LoadFromDb(), DirectoryView::LoadFromDb(), TreeView::LoadFromDb(), and Update().
|
protected |
Image objects currently displayed.
Definition at line 133 of file galleryviews.h.
Referenced by Clear(), ClearImage(), GetAllNodes(), DirectoryView::GetMenuSubjects(), DirectoryView::GetParent(), GetSelected(), HasNext(), HasPrev(), Next(), Populate(), Prev(), and Update().
|
protected |
The sequence in which to display images.
Definition at line 134 of file galleryviews.h.
Referenced by Clear(), ClearImage(), GetAllNodes(), DirectoryView::GetChildren(), DirectoryView::GetMenuSubjects(), DirectoryView::GetParent(), GetPosition(), DirectoryView::GetPosition(), GetSelected(), HasNext(), HasPrev(), Next(), Populate(), Prev(), Rotate(), and Select().
|
protected |
Sequence index of current selected image.
Definition at line 135 of file galleryviews.h.
Referenced by Clear(), GetPosition(), DirectoryView::GetPosition(), GetSelected(), HasNext(), HasPrev(), Next(), Prev(), and Select().
|
protected |
Caches displayed image files.
Definition at line 138 of file galleryviews.h.
Referenced by Cache(), DirectoryView::Cache(), ClearCache(), ClearImage(), GetCachedThumbUrl(), and DirectoryView::RemoveImage().