MythTV  0.26-pre
Public Member Functions | Private Member Functions
MythCDROMLinux Class Reference

Use Linux-specific ioctl()s to detect Audio-CDs, changed media, open trays and blank writable media. More...

Inheritance diagram for MythCDROMLinux:
MythCDROM MythMediaDevice

List of all members.

Public Member Functions

 MythCDROMLinux (QObject *par, const char *DevicePath, bool SuperMount, bool AllowEject)
virtual MythMediaError testMedia (void)
virtual bool mediaChanged (void)
virtual bool checkOK (void)
virtual MythMediaStatus checkMedia (void)
virtual MythMediaError eject (bool open_close=true)
virtual void setSpeed (int speed)
virtual void setSpeed (const char *device, int speed)
virtual bool isSameDevice (const QString &path)
virtual MythMediaError lock (void)
virtual MythMediaError unlock (void)

Private Member Functions

int driveStatus (void)
 Exhaustively determine the status.
bool hasWritableMedia (void)
 Is there blank or eraseable media in the drive?
int SCSIstatus (void)
 Use a SCSI query packet to see if the drive is _really_ open.

Detailed Description

Use Linux-specific ioctl()s to detect Audio-CDs, changed media, open trays and blank writable media.

Definition at line 124 of file mythcdrom-linux.cpp.


Constructor & Destructor Documentation

MythCDROMLinux::MythCDROMLinux ( QObject *  par,
const char *  DevicePath,
bool  SuperMount,
bool  AllowEject 
) [inline]

Definition at line 127 of file mythcdrom-linux.cpp.


Member Function Documentation

Reimplemented from MythMediaDevice.

Definition at line 324 of file mythcdrom-linux.cpp.

Reimplemented from MythCDROM.

Definition at line 312 of file mythcdrom-linux.cpp.

Referenced by checkMedia().

Reimplemented from MythCDROM.

Definition at line 317 of file mythcdrom-linux.cpp.

Reimplemented from MythCDROM.

Definition at line 361 of file mythcdrom-linux.cpp.

MythMediaError MythCDROMLinux::eject ( bool  open_close = true) [virtual]

Reimplemented from MythMediaDevice.

Definition at line 286 of file mythcdrom-linux.cpp.

void MythCDROMLinux::setSpeed ( int  speed) [virtual]

Reimplemented from MythMediaDevice.

Definition at line 651 of file mythcdrom-linux.cpp.

void MythCDROMLinux::setSpeed ( const char *  device,
int  speed 
) [virtual]

Reimplemented from MythCDROM.

Definition at line 656 of file mythcdrom-linux.cpp.

bool MythCDROMLinux::isSameDevice ( const QString &  path) [virtual]

Reimplemented from MythMediaDevice.

Definition at line 624 of file mythcdrom-linux.cpp.

Reimplemented from MythMediaDevice.

Definition at line 599 of file mythcdrom-linux.cpp.

Referenced by checkMedia().

Reimplemented from MythMediaDevice.

Definition at line 608 of file mythcdrom-linux.cpp.

Referenced by checkMedia().

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 164 of file mythcdrom-linux.cpp.

Referenced by checkMedia(), eject(), and testMedia().

Is there blank or eraseable media in the drive?

Definition at line 183 of file mythcdrom-linux.cpp.

Referenced by checkMedia().

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 236 of file mythcdrom-linux.cpp.

Referenced by driveStatus().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends