MythTV
master
|
Public Member Functions | |
MythCDROMLinux (QObject *par, const QString &DevicePath, bool SuperMount, bool AllowEject) | |
MythMediaError | testMedia (void) override |
bool | mediaChanged (void) override |
bool | checkOK (void) override |
MythMediaStatus | checkMedia (void) override |
MythMediaError | eject (bool open_close=true) override |
void | setDeviceSpeed (const char *device, int speed) override |
bool | isSameDevice (const QString &path) override |
MythMediaError | lock (void) override |
MythMediaError | unlock (void) override |
![]() | |
~MythCDROM () override=default | |
MythMediaStatus | checkMedia (void) override |
void | setDeviceSpeed (const char *devicePath, int speed) override |
![]() | |
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 bool | openDevice () |
virtual bool | closeDevice () |
virtual void | setSpeed (int speed) |
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 () |
Protected Member Functions | |
MythMediaError | ejectCDROM (bool open_close) |
MythMediaError | ejectSCSI () |
![]() | |
MythCDROM (QObject *par, const QString &DevicePath, bool SuperMount, bool AllowEject) | |
void | onDeviceMounted () override |
Override this to perform any post mount logic. More... | |
![]() | |
~MythMediaDevice () override=default | |
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) |
Private Member Functions | |
int | driveStatus (void) |
Exhaustively determine the status. More... | |
bool | hasWritableMedia (void) |
Is there blank or eraseable media in the drive? More... | |
int | SCSIstatus (void) |
Use a SCSI query packet to see if the drive is really open. More... | |
Additional Inherited Members | |
![]() | |
enum | ImageType { kUnknown, kBluray, kDVD } |
![]() | |
void | statusChanged (MythMediaStatus oldStatus, MythMediaDevice *pMedia) |
![]() | |
static MythCDROM * | get (QObject *par, const QString &devicePath, bool SuperMount, bool AllowEject) |
static ImageType | inspectImage (const QString &path) |
![]() | |
static void | RegisterMediaExtensions (uint mediatype, const QString &extensions) |
Used to register media types with extensions. More... | |
static QString | MediaTypeString (uint type) |
![]() | |
static const std::array< const QString, 9 > | kMediaStatusStrings |
static const std::array< const QString, 3 > | kMediaErrorStrings |
![]() | |
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... | |
Use Linux-specific ioctl()s to detect Audio-CDs, changed media, open trays and blank writable media.
Definition at line 133 of file mythcdrom-linux.cpp.
|
inline |
Definition at line 136 of file mythcdrom-linux.cpp.
|
overridevirtual |
Reimplemented from MythMediaDevice.
Definition at line 418 of file mythcdrom-linux.cpp.
|
overridevirtual |
Reimplemented from MythCDROM.
Definition at line 406 of file mythcdrom-linux.cpp.
Referenced by checkMedia().
|
overridevirtual |
Reimplemented from MythCDROM.
Definition at line 411 of file mythcdrom-linux.cpp.
|
overridevirtual |
Implements MythMediaDevice.
Definition at line 454 of file mythcdrom-linux.cpp.
|
overridevirtual |
Reimplemented from MythMediaDevice.
Definition at line 284 of file mythcdrom-linux.cpp.
|
overridevirtual |
Reimplemented from MythMediaDevice.
|
overridevirtual |
Reimplemented from MythMediaDevice.
Definition at line 729 of file mythcdrom-linux.cpp.
|
overridevirtual |
Reimplemented from MythMediaDevice.
Definition at line 695 of file mythcdrom-linux.cpp.
Referenced by checkMedia().
|
overridevirtual |
Reimplemented from MythMediaDevice.
Definition at line 710 of file mythcdrom-linux.cpp.
Referenced by checkMedia().
|
protected |
Definition at line 299 of file mythcdrom-linux.cpp.
Referenced by eject().
|
protected |
Definition at line 334 of file mythcdrom-linux.cpp.
Referenced by eject().
|
private |
Exhaustively determine the status.
If the CDROM is managed by the SCSI driver, then CDROM_DRIVE_STATUS as reported by ioctl will always return CDS_TRAY_OPEN if the tray is closed with no media. To determine the actual drive status we need to ask the drive directly by sending a SCSI packet to the drive.
Definition at line 176 of file mythcdrom-linux.cpp.
Referenced by checkMedia(), ejectCDROM(), and testMedia().
|
private |
Is there blank or eraseable media in the drive?
Definition at line 195 of file mythcdrom-linux.cpp.
Referenced by checkMedia().
|
private |
Use a SCSI query packet to see if the drive is really open.
Note that in recent kernels, whether you have an IDE/ATA/SATA or SCSI CDROM, the drive is managed by the SCSI driver and therefore needs this workaround. This code is based on the routine cdrom_get_media_event in cdrom.c of the linux kernel
Definition at line 241 of file mythcdrom-linux.cpp.
Referenced by driveStatus().