#include <mythmedia.h>
Signals | |
| void | statusChanged (MythMediaStatus oldStatus, MythMediaDevice *pMedia) |
Public Member Functions | |
| MythMediaDevice (QObject *par, const char *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? | |
| 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 MythMediaStatus | checkMedia ()=0 |
| virtual MythMediaError | eject (bool open_close=true) |
| 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. | |
| bool | findMountPath () |
| Try to find a mount of m_DevicePath in the mounts file. | |
| void | RegisterMediaExtensions (uint mediatype, const QString &extensions) |
| Used to register media types with extensions. | |
| void | clearData () |
| const char * | MediaTypeString () |
Static Public Member Functions | |
| static const char * | MediaTypeString (MythMediaType type) |
Static Public Attributes | |
| static const char * | MediaStatusStrings [] |
| static const char * | MediaErrorStrings [] |
Protected Member Functions | |
| virtual | ~MythMediaDevice () |
| virtual void | onDeviceMounted (void) |
| Override this to perform any post mount logic. | |
| virtual void | onDeviceUnmounted () |
| Override this to perform any post unmount logic. | |
| MythMediaType | DetectMediaType (void) |
| Returns guessed media type based on file extensions. | |
| bool | ScanMediaType (const QString &directory, ext_cnt_t &counts) |
| Recursively scan directories and create an associative array with the number of times we've seen each extension. | |
| MythMediaStatus | setStatus (MythMediaStatus newStat, bool CloseIt=false) |
Protected Attributes | |
| QString | m_DeviceModel |
| The device Manufacturer/Model. Read/write. | |
| QString | m_DevicePath |
| The path to this media's device. | |
| QString | m_KeyID |
| KeyID of the media. | |
| QString | m_MountPath |
| The path to this media's mount point. | |
| QString | m_RealDevice |
| If m_DevicePath is a symlink, its target. | |
| QString | m_VolumeID |
| The volume ID of the media. Read/write. | |
| MythMediaStatus | m_Status |
| The status of the media as of the. | |
| MythMediaType | m_MediaType |
| last call to checkMedia. Read only | |
| bool | m_AllowEject |
| Allow the user to eject the media?. Read only. | |
| bool | m_Locked |
| Is this media locked?. Read only. | |
| bool | m_SuperMount |
| Is this a supermount device?. Read only. | |
| int | m_DeviceHandle |
| A file handle for opening and closing the device, ioctls(), et c. | |
Private Attributes | |
| ext_to_media_t | m_ext_to_media |
| Map of extension to media type. | |
Friends | |
| class | MediaMonitorDarwin |
| class | MonitorThreadDarwin |
Definition at line 48 of file mythmedia.h.
| MythMediaDevice::MythMediaDevice | ( | QObject * | par, | |
| const char * | DevicePath, | |||
| bool | SuperMount, | |||
| bool | AllowEject | |||
| ) |
Definition at line 67 of file mythmedia.cpp.
| virtual MythMediaDevice::~MythMediaDevice | ( | ) | [inline, protected, virtual] |
Definition at line 129 of file mythmedia.h.
| const QString& MythMediaDevice::getMountPath | ( | ) | const [inline] |
Definition at line 58 of file mythmedia.h.
Referenced by MediaMonitor::GetMountPath(), handleMedia(), and MediaMonitor::shouldIgnore().
| void MythMediaDevice::setMountPath | ( | const char * | path | ) | [inline] |
Definition at line 59 of file mythmedia.h.
Referenced by MediaMonitorUnix::AddDevice(), MonitorThreadDarwin::diskInsert(), and MonitorThreadDarwin::diskRename().
| const QString& MythMediaDevice::getDevicePath | ( | ) | const [inline] |
Definition at line 61 of file mythmedia.h.
Referenced by MediaMonitorWindows::AddDevice(), MediaMonitorUnix::AddDevice(), MythMainWindow::customEvent(), MediaMonitor::defaultDevice(), DevName(), handleDVDMedia(), handleMedia(), and MediaMonitor::shouldIgnore().
| const QString& MythMediaDevice::getRealDevice | ( | ) | const [inline] |
Definition at line 63 of file mythmedia.h.
Referenced by LookupModel(), and MediaMonitor::shouldIgnore().
| const QString& MythMediaDevice::getDeviceModel | ( | ) | const [inline] |
Definition at line 67 of file mythmedia.h.
Referenced by DevName().
| void MythMediaDevice::setDeviceModel | ( | const char * | model | ) | [inline] |
Definition at line 68 of file mythmedia.h.
Referenced by MediaMonitorWindows::AddDevice(), MonitorThreadDarwin::diskInsert(), and LookupModel().
| MythMediaStatus MythMediaDevice::getStatus | ( | ) | const [inline] |
Definition at line 70 of file mythmedia.h.
Referenced by MediaMonitor::AttemptEject(), MythMainWindow::customEvent(), MythThemedMenu::mediaEvent(), and MediaMonitor::mediaStatusChanged().
| const QString& MythMediaDevice::getVolumeID | ( | ) | const [inline] |
Definition at line 72 of file mythmedia.h.
Referenced by DevName().
| void MythMediaDevice::setVolumeID | ( | const char * | vol | ) | [inline] |
Definition at line 73 of file mythmedia.h.
Referenced by MonitorThreadDarwin::diskInsert(), MonitorThreadDarwin::diskRename(), and MediaMonitorWindows::MediaMonitorWindows().
| const QString& MythMediaDevice::getKeyID | ( | ) | const [inline] |
Definition at line 75 of file mythmedia.h.
| bool MythMediaDevice::getAllowEject | ( | ) | const [inline] |
Definition at line 77 of file mythmedia.h.
| bool MythMediaDevice::getLocked | ( | ) | const [inline] |
Definition at line 79 of file mythmedia.h.
| bool MythMediaDevice::isDeviceOpen | ( | ) | const |
Definition at line 105 of file mythmedia.cpp.
Referenced by MythCDROMLinux::checkMedia(), closeDevice(), MythCDROMLinux::eject(), MythCDROMFreeBSD::eject(), openDevice(), performMountCmd(), MythCDROMLinux::testMedia(), MythCDROMFreeBSD::testMedia(), MythCDROMLinux::unlock(), and MythCDROMFreeBSD::unlock().
| bool MythMediaDevice::isUsable | ( | ) | const [inline] |
Is this device "ready", for a plugin to access?
Definition at line 84 of file mythmedia.h.
Referenced by MythCDROMLinux::checkMedia(), MediaMonitor::eventFilter(), handleDVDMedia(), and handleMedia().
| MythMediaType MythMediaDevice::getMediaType | ( | ) | const [inline] |
Definition at line 91 of file mythmedia.h.
Referenced by MediaMonitor::eventFilter(), MediaMonitor::JumpToMediaHandler(), and MythThemedMenu::mediaEvent().
| bool MythMediaDevice::isSuperMount | ( | ) | const [inline] |
Definition at line 93 of file mythmedia.h.
| virtual MythMediaError MythMediaDevice::testMedia | ( | void | ) | [inline, virtual] |
Reimplemented in MythCDROMFreeBSD, and MythCDROMLinux.
Definition at line 95 of file mythmedia.h.
Referenced by MediaMonitorUnix::AddDevice().
| bool MythMediaDevice::openDevice | ( | ) | [virtual] |
Definition at line 81 of file mythmedia.cpp.
Referenced by MythCDROMLinux::checkMedia(), MythCDROMLinux::eject(), MythCDROMFreeBSD::eject(), lock(), MythCDROMLinux::testMedia(), MythCDROMFreeBSD::testMedia(), MythCDROMLinux::unlock(), and MythCDROMFreeBSD::unlock().
| bool MythMediaDevice::closeDevice | ( | ) | [virtual] |
Definition at line 93 of file mythmedia.cpp.
Referenced by MythCDROMLinux::checkMedia(), performMountCmd(), setStatus(), MythCDROMLinux::testMedia(), and MythCDROMFreeBSD::testMedia().
| bool MythMediaDevice::isSameDevice | ( | const QString & | path | ) | [virtual] |
Reimplemented in MythCDROMLinux.
Definition at line 305 of file mythmedia.cpp.
| void MythMediaDevice::setSpeed | ( | int | speed | ) | [virtual] |
Reimplemented in MythCDROMDarwin, and MythCDROMLinux.
Definition at line 316 of file mythmedia.cpp.
Referenced by MediaMonitor::SetCDSpeed().
| virtual MythMediaStatus MythMediaDevice::checkMedia | ( | ) | [pure virtual] |
Implemented in MythCDROMLinux, MythCDROM, and MythHDD.
Referenced by MediaMonitor::CheckDevices().
| MythMediaError MythMediaDevice::eject | ( | bool | open_close = true |
) | [virtual] |
Reimplemented in MythCDROMFreeBSD, MythCDROMLinux, and MythHDD.
Definition at line 286 of file mythmedia.cpp.
Referenced by MediaMonitor::AttemptEject(), and Ripper::ejectCD().
| MythMediaError MythMediaDevice::lock | ( | void | ) | [virtual] |
Reimplemented in MythCDROMFreeBSD, and MythCDROMLinux.
Definition at line 323 of file mythmedia.cpp.
| MythMediaError MythMediaDevice::unlock | ( | void | ) | [virtual] |
Reimplemented in MythCDROMFreeBSD, and MythCDROMLinux.
Definition at line 336 of file mythmedia.cpp.
Referenced by MediaMonitor::AttemptEject(), and MythCDROM::onDeviceMounted().
Definition at line 110 of file mythmedia.cpp.
| bool MythMediaDevice::mount | ( | ) | [inline] |
Definition at line 106 of file mythmedia.h.
Referenced by MythHDD::checkMedia(), MythCDROMLinux::checkMedia(), and MonitorThreadDarwin::diskInsert().
| bool MythMediaDevice::unmount | ( | ) | [inline] |
Definition at line 107 of file mythmedia.h.
Referenced by MediaMonitor::AttemptEject(), MythCDROM::onDeviceMounted(), and setStatus().
Tells us if m_DevicePath is a mounted device.
Definition at line 344 of file mythmedia.cpp.
Referenced by MediaMonitor::AttemptEject(), MythHDD::checkMedia(), MythCDROMLinux::checkMedia(), performMountCmd(), setStatus(), MythCDROMLinux::testMedia(), and MythCDROMFreeBSD::testMedia().
| bool MythMediaDevice::findMountPath | ( | ) |
Try to find a mount of m_DevicePath in the mounts file.
Definition at line 353 of file mythmedia.cpp.
Referenced by MediaMonitor::GetMountPath(), isMounted(), and performMountCmd().
| void MythMediaDevice::RegisterMediaExtensions | ( | uint | mediatype, | |
| const QString & | extensions | |||
| ) |
Used to register media types with extensions.
| mediatype | MythMediaType flag. | |
| extensions | Comma separated list of extensions like 'mp3,ogg,flac'. |
Definition at line 278 of file mythmedia.cpp.
| void MythMediaDevice::clearData | ( | ) |
Definition at line 491 of file mythmedia.cpp.
Referenced by MediaMonitor::mediaStatusChanged().
| const char * MythMediaDevice::MediaTypeString | ( | ) |
Definition at line 498 of file mythmedia.cpp.
Referenced by MythCDROMLinux::checkMedia(), MediaMonitor::JumpToMediaHandler(), MediaMonitor::mediaStatusChanged(), performMountCmd(), and MediaMonitor::RegisterMediaHandler().
| const char * MythMediaDevice::MediaTypeString | ( | MythMediaType | type | ) | [static] |
Definition at line 503 of file mythmedia.cpp.
| void MythMediaDevice::statusChanged | ( | MythMediaStatus | oldStatus, | |
| MythMediaDevice * | pMedia | |||
| ) | [signal] |
Referenced by setStatus().
| virtual void MythMediaDevice::onDeviceMounted | ( | void | ) | [inline, protected, virtual] |
Override this to perform any post mount logic.
Reimplemented in MythCDROM.
Definition at line 132 of file mythmedia.h.
Referenced by performMountCmd().
| virtual void MythMediaDevice::onDeviceUnmounted | ( | ) | [inline, protected, virtual] |
Override this to perform any post unmount logic.
Definition at line 140 of file mythmedia.h.
Referenced by performMountCmd().
| MythMediaType MythMediaDevice::DetectMediaType | ( | void | ) | [protected] |
Returns guessed media type based on file extensions.
Definition at line 187 of file mythmedia.cpp.
Recursively scan directories and create an associative array with the number of times we've seen each extension.
Definition at line 240 of file mythmedia.cpp.
Referenced by DetectMediaType().
| MythMediaStatus MythMediaDevice::setStatus | ( | MythMediaStatus | newStat, | |
| bool | CloseIt = false | |||
| ) | [protected] |
Definition at line 450 of file mythmedia.cpp.
Referenced by MediaMonitorDarwin::AddDevice(), MythHDD::checkMedia(), MythCDROM::checkMedia(), MythCDROMLinux::checkMedia(), MonitorThreadDarwin::diskInsert(), MonitorThreadDarwin::diskRemove(), MonitorThreadDarwin::diskRename(), and MythHDD::eject().
friend class MediaMonitorDarwin [friend] |
Definition at line 51 of file mythmedia.h.
friend class MonitorThreadDarwin [friend] |
Definition at line 52 of file mythmedia.h.
const char * MythMediaDevice::MediaStatusStrings [static] |
{
"MEDIASTAT_ERROR",
"MEDIASTAT_UNKNOWN",
"MEDIASTAT_UNPLUGGED",
"MEDIASTAT_OPEN",
"MEDIASTAT_NODISK",
"MEDIASTAT_UNFORMATTED",
"MEDIASTAT_USEABLE",
"MEDIASTAT_NOTMOUNTED",
"MEDIASTAT_MOUNTED"
}
Definition at line 116 of file mythmedia.h.
Referenced by MythCDROMLinux::checkMedia(), and MediaMonitor::mediaStatusChanged().
const char * MythMediaDevice::MediaErrorStrings [static] |
{
"MEDIAERR_OK",
"MEDIAERR_FAILED",
"MEDIAERR_UNSUPPORTED"
}
Definition at line 117 of file mythmedia.h.
QString MythMediaDevice::m_DeviceModel [protected] |
The device Manufacturer/Model. Read/write.
Definition at line 147 of file mythmedia.h.
QString MythMediaDevice::m_DevicePath [protected] |
The path to this media's device.
(e.g. /dev/cdrom) Read only
Definition at line 148 of file mythmedia.h.
Referenced by MythHDD::checkMedia(), MythCDROMLinux::checkMedia(), MythCDROMLinux::driveStatus(), eject(), findMountPath(), MythCDROMLinux::hasWritableMedia(), isSameDevice(), MythCDROMLinux::isSameDevice(), MythHDD::MythHDD(), MythMediaDevice(), openDevice(), performMountCmd(), MythCDROMLinux::SCSIstatus(), setSpeed(), MythCDROMLinux::setSpeed(), MythCDROMDarwin::setSpeed(), and MythCDROMLinux::testMedia().
QString MythMediaDevice::m_KeyID [protected] |
KeyID of the media.
Read only (For ISO9660, volumeid + creation_date)
Definition at line 150 of file mythmedia.h.
Referenced by MythCDROMLinux::checkMedia(), and clearData().
QString MythMediaDevice::m_MountPath [protected] |
The path to this media's mount point.
(e.g. /mnt/cdrom) Read/write
Definition at line 152 of file mythmedia.h.
Referenced by MythHDD::checkMedia(), DetectMediaType(), findMountPath(), and MythCDROM::onDeviceMounted().
QString MythMediaDevice::m_RealDevice [protected] |
If m_DevicePath is a symlink, its target.
(e.g. /dev/hdc) Read only
Definition at line 154 of file mythmedia.h.
Referenced by findMountPath(), and MythMediaDevice().
QString MythMediaDevice::m_VolumeID [protected] |
The volume ID of the media. Read/write.
Definition at line 156 of file mythmedia.h.
Referenced by MythHDD::checkMedia(), MythCDROMLinux::checkMedia(), and clearData().
MythMediaStatus MythMediaDevice::m_Status [protected] |
The status of the media as of the.
Definition at line 158 of file mythmedia.h.
Referenced by MythHDD::checkMedia(), MythCDROMLinux::checkMedia(), isMounted(), MythHDD::MythHDD(), MythMediaDevice(), MythCDROM::onDeviceMounted(), performMountCmd(), and setStatus().
MythMediaType MythMediaDevice::m_MediaType [protected] |
last call to checkMedia. Read only
The type of media. Read only
Definition at line 160 of file mythmedia.h.
Referenced by MythCDROMLinux::checkMedia(), clearData(), MediaTypeString(), MythHDD::MythHDD(), MythMediaDevice(), and MythCDROM::onDeviceMounted().
bool MythMediaDevice::m_AllowEject [protected] |
Allow the user to eject the media?. Read only.
Definition at line 162 of file mythmedia.h.
Referenced by MythCDROMLinux::checkMedia(), MythMediaDevice(), and MythCDROM::onDeviceMounted().
bool MythMediaDevice::m_Locked [protected] |
Is this media locked?. Read only.
Definition at line 163 of file mythmedia.h.
Referenced by lock(), MythMediaDevice(), and unlock().
bool MythMediaDevice::m_SuperMount [protected] |
Is this a supermount device?. Read only.
Definition at line 164 of file mythmedia.h.
Referenced by MythMediaDevice(), and performMountCmd().
int MythMediaDevice::m_DeviceHandle [protected] |
A file handle for opening and closing the device, ioctls(), et c.
This should be private, but a subclass of a subclass needs it (MythCDRomLinux)
Definition at line 166 of file mythmedia.h.
Referenced by MythCDROMLinux::checkMedia(), MythCDROMLinux::checkOK(), closeDevice(), MythCDROMLinux::driveStatus(), MythCDROMLinux::eject(), MythCDROMFreeBSD::eject(), MythCDROMLinux::hasWritableMedia(), isDeviceOpen(), MythCDROMLinux::lock(), MythCDROMFreeBSD::lock(), MythCDROMLinux::mediaChanged(), MythMediaDevice(), openDevice(), MythCDROMLinux::SCSIstatus(), MythCDROMLinux::unlock(), and MythCDROMFreeBSD::unlock().
Map of extension to media type.
Definition at line 171 of file mythmedia.h.
Referenced by DetectMediaType(), and RegisterMediaExtensions().
1.6.3