MediaMonitorUnix Class Reference

#include <mediamonitor-unix.h>

Inheritance diagram for MediaMonitorUnix:

MediaMonitor

List of all members.


Detailed Description

Definition at line 4 of file mediamonitor-unix.h.


Public Member Functions

 MediaMonitorUnix (QObject *par, unsigned long interval, bool allowEject)
 ~MediaMonitorUnix ()

Protected Member Functions

void CheckDevices (void)
 Poll the devices in our list.
void CheckDeviceNotifications (void)
 Checks the named pipe, kUDEV_FIFO, for hotplug events from the udev system.
bool CheckFileSystemTable (void)
bool CheckMountable (void)
 Search /sys/block for valid removable media devices.
bool FindPartitions (const QString &dev, bool checkPartitions)
 Creates MythMedia instances for sysfs removable media devices.
virtual bool AddDevice (MythMediaDevice *pDevice)
 Given a media device, add it to our collection.
bool AddDevice (const char *dev)
bool AddDevice (struct fstab *mep)
QString GetDeviceFile (const QString &sysfs)
 Returns the device special file associated with the /sys/block node.
QStringList GetCDROMBlockDevices (void)

Protected Attributes

int m_fifo

Static Protected Attributes

static const QString kUDEV_FIFO = "/tmp/mythtv_media"

Constructor & Destructor Documentation

MediaMonitorUnix::MediaMonitorUnix ( QObject *  par,
unsigned long  interval,
bool  allowEject 
)

Definition at line 82 of file mediamonitor-unix.cpp.

MediaMonitorUnix::~MediaMonitorUnix (  ) 

Definition at line 93 of file mediamonitor-unix.cpp.


Member Function Documentation

void MediaMonitorUnix::CheckDevices ( void   )  [protected]

Poll the devices in our list.

Reimplemented from MediaMonitor.

void MediaMonitorUnix::CheckDeviceNotifications ( void   )  [protected, virtual]

Checks the named pipe, kUDEV_FIFO, for hotplug events from the udev system.

NOTE: Currently only Linux w/udev 0.71+ provides these events.

Reimplemented from MediaMonitor.

Definition at line 596 of file mediamonitor-unix.cpp.

bool MediaMonitorUnix::CheckFileSystemTable ( void   )  [protected]

Definition at line 104 of file mediamonitor-unix.cpp.

Referenced by MediaMonitorUnix().

bool MediaMonitorUnix::CheckMountable ( void   )  [protected]

Search /sys/block for valid removable media devices.

This function creates MediaDevice instances for valid removable media devices found under the /sys/block filesystem in Linux. CD and DVD devices are created as MythCDROM instances. MythHDD instances will be created for each partition on removable hard disk devices, if they exists. Otherwise a single MythHDD instance will be created for the entire disc.

NOTE: Floppy disks are ignored.

Definition at line 138 of file mediamonitor-unix.cpp.

Referenced by MediaMonitorUnix().

bool MediaMonitorUnix::FindPartitions ( const QString &  dev,
bool  checkPartitions 
) [protected]

Creates MythMedia instances for sysfs removable media devices.

Block devices are represented as directories in sysfs with directories for each partition underneath the parent device directory.

This function recursively calls itself to find all partitions on a block device and creates a MythHDD instance for each partition found. If no partitions are found and the device is a CD or DVD device a MythCDROM instance is created. Otherwise a MythHDD instance is created for the entire block device.

Parameters:
dev path to sysfs block device.
checkPartitions check for partitions on block device.
Returns:
true if MythMedia instances are created.

Definition at line 526 of file mediamonitor-unix.cpp.

Referenced by CheckDeviceNotifications(), and CheckMountable().

bool MediaMonitorUnix::AddDevice ( MythMediaDevice pDevice  )  [protected, virtual]

Given a media device, add it to our collection.

Implements MediaMonitor.

Definition at line 306 of file mediamonitor-unix.cpp.

Referenced by AddDevice(), CheckFileSystemTable(), and FindPartitions().

bool MediaMonitorUnix::AddDevice ( const char *  dev  )  [protected]

Definition at line 460 of file mediamonitor-unix.cpp.

bool MediaMonitorUnix::AddDevice ( struct fstab *  mep  )  [protected]

Definition at line 372 of file mediamonitor-unix.cpp.

QString MediaMonitorUnix::GetDeviceFile ( const QString &  sysfs  )  [protected]

Returns the device special file associated with the /sys/block node.

Parameters:
sysfs system filesystem path of removable block device.
Returns:
path to the device special file

Definition at line 183 of file mediamonitor-unix.cpp.

Referenced by FindPartitions().

QStringList MediaMonitorUnix::GetCDROMBlockDevices ( void   )  [protected, virtual]

Implements MediaMonitor.

Definition at line 216 of file mediamonitor-unix.cpp.

Referenced by FindPartitions().


Member Data Documentation

int MediaMonitorUnix::m_fifo [protected]

Definition at line 26 of file mediamonitor-unix.h.

Referenced by CheckDeviceNotifications(), CheckMountable(), and ~MediaMonitorUnix().

const QString MediaMonitorUnix::kUDEV_FIFO = "/tmp/mythtv_media" [static, protected]

Definition at line 27 of file mediamonitor-unix.h.

Referenced by CheckMountable(), and ~MediaMonitorUnix().


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

Generated on Sat Dec 18 05:16:05 2010 for MythTV by  doxygen 1.5.5