MythTV  master
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
ImageAdapterBase Class Reference

Common filesystem facilities. More...

#include <imagemanager.h>

Inheritance diagram for ImageAdapterBase:
Inheritance graph
[legend]
Collaboration diagram for ImageAdapterBase:
Collaboration graph
[legend]

Public Member Functions

QDir GetImageFilters () const
 Get filters for detecting recognised images/videos. More...
 
ImageNodeType GetImageType (const QString &ext) const
 Determine file type from its extension. More...
 
- Public Member Functions inherited from DeviceManager
QStringList CloseDevices (int devId, const QString &action)
 Remove a device (or all devices) More...
 
QString DeviceMount (int devId) const
 Get path at which the device is mounted. More...
 
QString DeviceName (int devId) const
 Get model name of the device. More...
 
int DeviceCount () const
 
QString ThumbDir (int fs) const
 

Static Public Member Functions

static QStringList SupportedImages ()
 Return recognised pictures. More...
 
static QStringList SupportedVideos ()
 Return recognised video extensions. More...
 
static QString ConstructPath (const QString &path, const QString &name)
 Assembles a canonical file path without corrupting its absolute/relative nature. More...
 
static QString BaseNameOf (const QString &path)
 Extracts file name (incl extension) from a filepath. More...
 
static QString PathOf (const QString &path)
 Extracts path from a filepath. More...
 
static QString FormatSize (int sizeKib)
 
static QString GetAbsThumbPath (const QString &devPath, const QString &path)
 Get absolute filepath for thumbnail of an image. More...
 
static QString ThumbPath (const ImageItem &im)
 Thumbnails of videos are a JPEG snapshot with jpg suffix appended. More...
 

Protected Member Functions

 ImageAdapterBase ()
 Constructor. More...
 
virtual ~ImageAdapterBase ()=default
 
- Protected Member Functions inherited from DeviceManager
int OpenDevice (const QString &name, const QString &mount, MythMediaDevice *media=nullptr, QTemporaryDir *dir=nullptr)
 Define a new device and assign it a unique id. If the device is already known, its existing id is returned. More...
 
int LocateMount (const QString &mount) const
 Find the id of a device. More...
 
StringMap GetDeviceDirs () const
 Get all known devices. More...
 
QList< int > GetAbsentees ()
 Get list of mountpoints for non-import devices. More...
 
 DeviceManager ()
 
 ~DeviceManager ()
 

Private Attributes

QDir m_dirFilter
 A pre-configured dir for reading image/video files. More...
 
QStringList m_imageFileExt
 List of file extensions recognised as pictures. More...
 
QStringList m_videoFileExt
 List of file extensions recognised as videos. More...
 

Detailed Description

Common filesystem facilities.

Definition at line 120 of file imagemanager.h.

Constructor & Destructor Documentation

◆ ImageAdapterBase()

ImageAdapterBase::ImageAdapterBase ( )
protected

Constructor.

Definition at line 275 of file imagemanager.cpp.

◆ ~ImageAdapterBase()

virtual ImageAdapterBase::~ImageAdapterBase ( )
protectedvirtualdefault

Member Function Documentation

◆ SupportedImages()

QStringList ImageAdapterBase::SupportedImages ( )
static

Return recognised pictures.

Returns
List of file extensions

Definition at line 298 of file imagemanager.cpp.

Referenced by internal_media_init().

◆ SupportedVideos()

QStringList ImageAdapterBase::SupportedVideos ( )
static

Return recognised video extensions.

Returns
List of file extensions

Definition at line 312 of file imagemanager.cpp.

Referenced by internal_media_init().

◆ ConstructPath()

static QString ImageAdapterBase::ConstructPath ( const QString &  path,
const QString &  name 
)
inlinestatic

Assembles a canonical file path without corrupting its absolute/relative nature.

Definition at line 128 of file imagemanager.h.

Referenced by GalleryThumbView::Copy(), and GalleryThumbView::Move().

◆ BaseNameOf()

static QString ImageAdapterBase::BaseNameOf ( const QString &  path)
inlinestatic

Extracts file name (incl extension) from a filepath.

Definition at line 132 of file imagemanager.h.

Referenced by ReadMetaThread::run().

◆ PathOf()

static QString ImageAdapterBase::PathOf ( const QString &  path)
inlinestatic

Extracts path from a filepath.

Definition at line 136 of file imagemanager.h.

Referenced by ReadMetaThread::run().

◆ FormatSize()

static QString ImageAdapterBase::FormatSize ( int  sizeKib)
inlinestatic

Definition at line 139 of file imagemanager.h.

Referenced by InfoList::CreateCount(), TransferThread::run(), and ReadMetaThread::run().

◆ GetAbsThumbPath()

static QString ImageAdapterBase::GetAbsThumbPath ( const QString &  devPath,
const QString &  path 
)
inlinestatic

Get absolute filepath for thumbnail of an image.

Definition at line 144 of file imagemanager.h.

Referenced by ImageAdapterLocal::CreateItem(), ImageAdapterSg::CreateItem(), and ImageAdapterLocal::MakeThumbUrl().

◆ ThumbPath()

static QString ImageAdapterBase::ThumbPath ( const ImageItem im)
inlinestatic

Thumbnails of videos are a JPEG snapshot with jpg suffix appended.

Definition at line 148 of file imagemanager.h.

Referenced by ImageAdapterLocal::CreateItem(), and ImageAdapterSg::CreateItem().

◆ GetImageFilters()

QDir ImageAdapterBase::GetImageFilters ( ) const
inline

Get filters for detecting recognised images/videos.

Supported pictures are determined by QImage; supported videos are determined from the mythplayer settings (Video Associations)

See also
http://qt-project.org/doc/qt-4.8/qimagereader.html#supportedImageFormats
Returns
QDir A QDir initialised with filters for detecting images/videos

Definition at line 158 of file imagemanager.h.

◆ GetImageType()

ImageNodeType ImageAdapterBase::GetImageType ( const QString &  ext) const
inline

Determine file type from its extension.

Definition at line 161 of file imagemanager.h.

Referenced by ImageAdapterLocal::CreateItem(), and ImageAdapterSg::CreateItem().

Member Data Documentation

◆ m_dirFilter

QDir ImageAdapterBase::m_dirFilter
private

A pre-configured dir for reading image/video files.

Definition at line 171 of file imagemanager.h.

Referenced by ImageAdapterBase().

◆ m_imageFileExt

QStringList ImageAdapterBase::m_imageFileExt
private

List of file extensions recognised as pictures.

Definition at line 173 of file imagemanager.h.

Referenced by ImageAdapterBase().

◆ m_videoFileExt

QStringList ImageAdapterBase::m_videoFileExt
private

List of file extensions recognised as videos.

Definition at line 175 of file imagemanager.h.

Referenced by ImageAdapterBase().


The documentation for this class was generated from the following files: