MythTV
master
|
Manages image sources, ie. More...
#include <libmythmetadata/imagemanager.h>
Public Member Functions | |
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 |
Protected Member Functions | |
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 () | |
Private Types | |
using | DeviceMap = QMap< int, Device * > |
Private Attributes | |
DeviceMap | m_devices |
Device store. More... | |
Manages image sources, ie.
SG, local media (USBs, CDs etc), import directories. A single SG device is opened on first use & never closed (no cleanup) . Imports are created by user & deleted when 'ejected' or FE exits, which cleans up thumbnails and imported images. Gallery scans local devices (MediaMonitor) whenever the UI starts. A local device is opened when first detected, closed when Gallery UI exits (to allow unmounting) but persists for subsequent Gallery use. It and its thumbnails are deleted by FE exit, user 'eject', system unmount or if it is no longer present when Gallery re-starts
Definition at line 94 of file imagemanager.h.
|
private |
Definition at line 116 of file imagemanager.h.
|
protecteddefault |
|
protected |
Definition at line 129 of file imagemanager.cpp.
QStringList DeviceManager::CloseDevices | ( | int | devId, |
const QString & | action | ||
) |
Remove a device (or all devices)
devId | Id of device to remove |
action | What action to take. |
Definition at line 200 of file imagemanager.cpp.
QString DeviceManager::DeviceMount | ( | int | devId | ) | const |
Get path at which the device is mounted.
Definition at line 136 of file imagemanager.cpp.
Referenced by ImageManagerFe::CrumbName().
QString DeviceManager::DeviceName | ( | int | devId | ) | const |
Get model name of the device.
Definition at line 143 of file imagemanager.cpp.
Referenced by ImageManagerFe::CrumbName(), and ImageManagerFe::DeviceCaption().
|
inline |
Definition at line 100 of file imagemanager.h.
Referenced by ImageManagerFe::DetectLocalDevices().
QString DeviceManager::ThumbDir | ( | int | fs | ) | const |
Definition at line 149 of file imagemanager.cpp.
Referenced by ImageAdapterLocal::CreateItem(), and ImageAdapterSg::CreateItem().
|
protected |
Define a new device and assign it a unique id. If the device is already known, its existing id is returned.
name | Device model/volume/id |
mount | Device mountpoint |
media | Set for MediaMonitor devices only |
dir | Dir path of images: import devices only |
Definition at line 164 of file imagemanager.cpp.
Referenced by ImageManagerFe::CreateImport(), ImageManagerFe::DetectLocalDevices(), ImageManagerFe::DeviceEvent(), and ImageDbSg::ImageDbSg().
|
protected |
Find the id of a device.
mount | Device mountpoint |
Definition at line 243 of file imagemanager.cpp.
Referenced by ImageManagerFe::DeviceEvent(), and OpenDevice().
|
protected |
Get all known devices.
Definition at line 257 of file imagemanager.cpp.
Referenced by ImageAdapterLocal::GetScanDirs().
|
protected |
Get list of mountpoints for non-import devices.
Definition at line 271 of file imagemanager.cpp.
Referenced by ImageManagerFe::DetectLocalDevices().
|
private |
Device store.
Definition at line 119 of file imagemanager.h.
Referenced by CloseDevices(), DeviceMount(), DeviceName(), GetAbsentees(), GetDeviceDirs(), LocateMount(), OpenDevice(), ThumbDir(), and ~DeviceManager().