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

#include <mythhdd.h>

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

Public Member Functions

 MythHDD (QObject *par, const QString &DevicePath, bool SuperMount, bool AllowEject)
 Creates a new instance of a hard disc device. More...
 
MythMediaStatus checkMedia (void) override
 Checks the status of this media device. More...
 
MythMediaError eject (bool) override
 
- Public Member Functions inherited from MythMediaDevice
 MythMediaDevice (QObject *par, QString DevicePath, bool SuperMount, bool AllowEject)
 
const QString & getMountPath () const
 
void setMountPath (const char *path)
 
const QString & getDevicePath () const
 
const QString & getRealDevice () const
 
const QString & getDeviceModel () const
 
void setDeviceModel (const char *model)
 
MythMediaStatus getStatus () const
 
const QString & getVolumeID () const
 
void setVolumeID (const char *vol)
 
const QString & getKeyID () const
 
bool getAllowEject () const
 
bool getLocked () const
 
bool isDeviceOpen () const
 
bool isUsable () const
 Is this device "ready", for a plugin to access? More...
 
MythMediaType getMediaType () const
 
bool isSuperMount () const
 
virtual MythMediaError testMedia ()
 
virtual bool openDevice ()
 
virtual bool closeDevice ()
 
virtual bool isSameDevice (const QString &path)
 
virtual void setSpeed (int speed)
 
virtual void setDeviceSpeed (const char *, int)
 
virtual MythMediaError lock ()
 
virtual MythMediaError unlock ()
 
virtual bool performMountCmd (bool DoMount)
 
bool mount ()
 
bool unmount ()
 
bool isMounted (bool bVerify=true)
 Tells us if m_devicePath is a mounted device. More...
 
bool findMountPath ()
 Try to find a mount of m_devicePath in the mounts file. More...
 
void clearData ()
 
QString MediaTypeString ()
 

Static Public Member Functions

static MythHDDGet (QObject *par, const char *devicePath, bool SuperMount, bool AllowEject)
 Helper function used to create a new instance of a hard disk device. More...
 
- Static Public Member Functions inherited from MythMediaDevice
static void RegisterMediaExtensions (uint mediatype, const QString &extensions)
 Used to register media types with extensions. More...
 
static QString MediaTypeString (uint type)
 

Additional Inherited Members

- Signals inherited from MythMediaDevice
void statusChanged (MythMediaStatus oldStatus, MythMediaDevice *pMedia)
 
- Static Public Attributes inherited from MythMediaDevice
static const std::array< const QString, 9 > kMediaStatusStrings
 
static const std::array< const QString, 3 > kMediaErrorStrings
 
- Protected Member Functions inherited from MythMediaDevice
 ~MythMediaDevice () override=default
 
virtual void onDeviceMounted (void)
 Override this to perform any post mount logic. More...
 
virtual void onDeviceUnmounted ()
 Override this to perform any post unmount logic. More...
 
MythMediaType DetectMediaType (void)
 Returns guessed media type based on file extensions. More...
 
bool ScanMediaType (const QString &directory, ext_cnt_t &cnt)
 Recursively scan directories and create an associative array with the number of times we've seen each extension. More...
 
MythMediaStatus setStatus (MythMediaStatus newStat, bool CloseIt=false)
 
- Protected Attributes inherited from MythMediaDevice
QString m_deviceModel
 The device Manufacturer/Model. Read/write. More...
 
QString m_devicePath
 The path to this media's device. More...
 
QString m_keyID
 KeyID of the media. More...
 
QString m_mountPath
 The path to this media's mount point. More...
 
QString m_realDevice
 If m_devicePath is a symlink, its target. More...
 
QString m_volumeID
 The volume ID of the media. Read/write. More...
 
MythMediaStatus m_status {MEDIASTAT_UNKNOWN}
 The status of the media as of the last call to checkMedia. More...
 
MythMediaType m_mediaType {MEDIATYPE_UNKNOWN}
 The type of media. Read only. More...
 
bool m_allowEject
 Allow the user to eject the media?. Read only. More...
 
bool m_locked {false}
 Is this media locked?. Read only. More...
 
bool m_superMount
 Is this a supermount device?. More...
 
int m_deviceHandle {-1}
 A file handle for opening and closing the device, ioctls(), et c. More...
 

Detailed Description

Definition at line 6 of file mythhdd.h.

Constructor & Destructor Documentation

◆ MythHDD()

MythHDD::MythHDD ( QObject *  par,
const QString &  DevicePath,
bool  SuperMount,
bool  AllowEject 
)

Creates a new instance of a hard disc device.

Parameters
parThe parent object of this hdd object.
DevicePathpath to the device special file representing the device.
SuperMountTrue if this is a 'supermount' device.
See also
MythMediaDevice::m_SuperMount
Parameters
AllowEjectTrue if the user is allowed to eject the media.
Returns
new MythHDD instance.

Definition at line 30 of file mythhdd.cpp.

Referenced by Get().

Member Function Documentation

◆ checkMedia()

MythMediaStatus MythHDD::checkMedia ( void  )
overridevirtual

Checks the status of this media device.

Implements MythMediaDevice.

Definition at line 42 of file mythhdd.cpp.

◆ eject()

MythMediaError MythHDD::eject ( bool  )
overridevirtual

Reimplemented from MythMediaDevice.

Definition at line 88 of file mythhdd.cpp.

◆ Get()

MythHDD * MythHDD::Get ( QObject *  par,
const char *  devicePath,
bool  SuperMount,
bool  AllowEject 
)
static

Helper function used to create a new instance of a hard disk device.

Parameters
parThe parent object of this hdd object.
devicePathpath to the device special file representing the device.
SuperMountTrue if this is a 'supermount' device.
See also
MythMediaDevice::m_SuperMount
Parameters
AllowEjectTrue if the user is allowed to eject the media.
Returns
new MythHDD instance.

Definition at line 15 of file mythhdd.cpp.

Referenced by MediaMonitorUnix::CheckMountable(), MonitorThreadDarwin::diskInsert(), MediaMonitorUnix::FindPartitions(), and MediaMonitorWindows::MediaMonitorWindows().


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