#include <mediamonitor-unix.h>

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" |
| 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.
| void MediaMonitorUnix::CheckDevices | ( | void | ) | [protected] |
| 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] |
| 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().
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.
| dev | path to sysfs block device. | |
| checkPartitions | check for partitions on block device. |
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.
| sysfs | system filesystem path of removable block device. |
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().
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().
1.5.5