MythTV  master
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | List of all members
ImageAdapterLocal Class Reference

Filesystem adapter for Frontend, managing local devices iaw MediaMonitor. More...

#include <imagemanager.h>

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

Public Member Functions

 ImageAdapterLocal ()=default
 
ImageItemCreateItem (const QFileInfo &fi, int parentId, int devId, const QString &base) const
 Construct a local image from a file. More...
 
StringMap GetScanDirs () const
 Returns local device dirs to scan. More...
 
- Public Member Functions inherited from ImageAdapterBase
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 QString GetAbsFilePath (const ImagePtrK &im)
 Get absolute filepath for a local image. More...
 
static QString MakeFileUrl (const QString &path)
 Construct URL of a local image, which is an absolute path. More...
 
static QString MakeThumbUrl (const QString &devPath, const QString &path="")
 Construct URL of the thumbnail of a local image (An absolute path) More...
 
static void Notify (const QString &mesg, const QStringList &extra)
 Send local message to UI about local ids. More...
 
- Static Public Member Functions inherited from ImageAdapterBase
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...
 

Static Protected Member Functions

static int ImageId (int id)
 
static QString ImageId (const QString &id)
 
static int DbId (int id)
 
static QString DbIds (const QString &ids)
 

Additional Inherited Members

- Protected Member Functions inherited from ImageAdapterBase
 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 ()=default
 
 ~DeviceManager ()
 

Detailed Description

Filesystem adapter for Frontend, managing local devices iaw MediaMonitor.

Scanner will scan these devices. Creates images with negative ids and absolute filepaths Thumbnails are stored locally and deleted when FE exits.

Definition at line 189 of file imagemanager.h.

Constructor & Destructor Documentation

◆ ImageAdapterLocal()

ImageAdapterLocal::ImageAdapterLocal ( )
default

Member Function Documentation

◆ CreateItem()

ImageItem * ImageAdapterLocal::CreateItem ( const QFileInfo &  fi,
int  parentId,
int  devId,
const QString &  base 
) const

Construct a local image from a file.

Parameters
fiFile
parentIdId of the parent dir
devIdId of device containing the file
baseUnused but required for adapter interface
Returns
ImageItem An image object

Definition at line 335 of file imagemanager.cpp.

◆ GetScanDirs()

StringMap ImageAdapterLocal::GetScanDirs ( ) const
inline

Returns local device dirs to scan.

Definition at line 198 of file imagemanager.h.

◆ GetAbsFilePath()

static QString ImageAdapterLocal::GetAbsFilePath ( const ImagePtrK im)
inlinestatic

Get absolute filepath for a local image.

Definition at line 201 of file imagemanager.h.

◆ MakeFileUrl()

static QString ImageAdapterLocal::MakeFileUrl ( const QString &  path)
inlinestatic

Construct URL of a local image, which is an absolute path.

Definition at line 205 of file imagemanager.h.

Referenced by ImageManagerFe::BuildTransferUrl().

◆ MakeThumbUrl()

static QString ImageAdapterLocal::MakeThumbUrl ( const QString &  devPath,
const QString &  path = "" 
)
inlinestatic

Construct URL of the thumbnail of a local image (An absolute path)

Definition at line 208 of file imagemanager.h.

◆ Notify()

void ImageAdapterLocal::Notify ( const QString &  mesg,
const QStringList &  extra 
)
static

Send local message to UI about local ids.

Parameters
mesgMessage name
extraMessage data

Definition at line 394 of file imagemanager.cpp.

◆ ImageId() [1/2]

static int ImageAdapterLocal::ImageId ( int  id)
inlinestaticprotected

Definition at line 215 of file imagemanager.h.

◆ ImageId() [2/2]

static QString ImageAdapterLocal::ImageId ( const QString &  id)
inlinestaticprotected

Definition at line 216 of file imagemanager.h.

◆ DbId()

static int ImageAdapterLocal::DbId ( int  id)
inlinestaticprotected

Definition at line 217 of file imagemanager.h.

◆ DbIds()

static QString ImageAdapterLocal::DbIds ( const QString &  ids)
inlinestaticprotected

Definition at line 218 of file imagemanager.h.


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