#include <mythmedia.h>

Definition at line 44 of file mythmedia.h.
Signals | |
| void | statusChanged (MediaStatus 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) |
| MediaStatus | 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? | |
| MediaType | getMediaType () const |
| bool | isSuperMount () const |
| virtual MediaError | testMedia () |
| virtual bool | openDevice () |
| virtual bool | closeDevice () |
| virtual bool | isSameDevice (const QString &path) |
| virtual void | setSpeed (int speed) |
| virtual MediaStatus | checkMedia ()=0 |
| virtual MediaError | eject (bool open_close=true) |
| virtual MediaError | lock () |
| virtual MediaError | unlock () |
| virtual bool | performMountCmd (bool DoMount) |
| bool | mount () |
| bool | unmount () |
| bool | isMounted (bool bVerify=false) |
| Tells us if m_DevicePath is a mounted device. | |
| 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 (MediaType 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. | |
| MediaType | 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. | |
| MediaStatus | setStatus (MediaStatus 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. | |
| MediaStatus | m_Status |
| The status of the media as of the last call to checkMedia. | |
| MediaType | m_MediaType |
| The type of media. 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 |
| MythMediaDevice::MythMediaDevice | ( | QObject * | par, | |
| const char * | DevicePath, | |||
| bool | SuperMount, | |||
| bool | AllowEject | |||
| ) |
Definition at line 54 of file mythmedia.cpp.
| virtual MythMediaDevice::~MythMediaDevice | ( | ) | [inline, protected, virtual] |
Definition at line 123 of file mythmedia.h.
| const QString& MythMediaDevice::getMountPath | ( | ) | const [inline] |
Definition at line 54 of file mythmedia.h.
Referenced by VideoListImp::buildFsysList(), MediaMonitor::GetMountPath(), handleMedia(), IconView::HandleMediaDeviceSelect(), IconView::HandleSettings(), IconView::SetupMediaMonitor(), and MediaMonitor::shouldIgnore().
| void MythMediaDevice::setMountPath | ( | const char * | path | ) | [inline] |
Definition at line 55 of file mythmedia.h.
Referenced by MediaMonitorUnix::AddDevice(), MonitorThreadDarwin::diskInsert(), and MonitorThreadDarwin::diskRename().
| const QString& MythMediaDevice::getDevicePath | ( | ) | const [inline] |
Definition at line 57 of file mythmedia.h.
Referenced by MediaMonitorWindows::AddDevice(), MediaMonitorUnix::AddDevice(), MediaMonitor::defaultDevice(), DevName(), handleDVDMedia(), handleMedia(), IconView::SetupMediaMonitor(), and MediaMonitor::shouldIgnore().
| const QString& MythMediaDevice::getRealDevice | ( | ) | const [inline] |
Definition at line 59 of file mythmedia.h.
Referenced by LookupModel(), and MediaMonitor::shouldIgnore().
| const QString& MythMediaDevice::getDeviceModel | ( | ) | const [inline] |
| void MythMediaDevice::setDeviceModel | ( | const char * | model | ) | [inline] |
Definition at line 64 of file mythmedia.h.
Referenced by MediaMonitorWindows::AddDevice(), MonitorThreadDarwin::diskInsert(), and LookupModel().
| MediaStatus MythMediaDevice::getStatus | ( | ) | const [inline] |
Definition at line 66 of file mythmedia.h.
Referenced by MediaMonitor::ChooseAndEjectMedia(), and MediaMonitor::mediaStatusChanged().
| const QString& MythMediaDevice::getVolumeID | ( | ) | const [inline] |
| void MythMediaDevice::setVolumeID | ( | const char * | vol | ) | [inline] |
Definition at line 69 of file mythmedia.h.
Referenced by MonitorThreadDarwin::diskInsert(), MonitorThreadDarwin::diskRename(), and MediaMonitorWindows::MediaMonitorWindows().
| const QString& MythMediaDevice::getKeyID | ( | ) | const [inline] |
Definition at line 71 of file mythmedia.h.
| bool MythMediaDevice::getAllowEject | ( | ) | const [inline] |
Definition at line 73 of file mythmedia.h.
| bool MythMediaDevice::getLocked | ( | ) | const [inline] |
Definition at line 75 of file mythmedia.h.
| bool MythMediaDevice::isDeviceOpen | ( | ) | const |
Definition at line 96 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 80 of file mythmedia.h.
Referenced by MythCDROMLinux::checkMedia(), MythMainWindow::customEvent(), handleDVDMedia(), handleMedia(), and handleVCDMedia().
| MediaType MythMediaDevice::getMediaType | ( | ) | const [inline] |
| bool MythMediaDevice::isSuperMount | ( | ) | const [inline] |
Definition at line 89 of file mythmedia.h.
| virtual MediaError MythMediaDevice::testMedia | ( | void | ) | [inline, virtual] |
Reimplemented in MythCDROMFreeBSD, and MythCDROMLinux.
Definition at line 91 of file mythmedia.h.
Referenced by MediaMonitorUnix::AddDevice().
| bool MythMediaDevice::openDevice | ( | ) | [virtual] |
Definition at line 73 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 84 of file mythmedia.cpp.
Referenced by MythCDROMLinux::checkMedia(), performMountCmd(), setStatus(), MythCDROMLinux::testMedia(), and MythCDROMFreeBSD::testMedia().
| bool MythMediaDevice::isSameDevice | ( | const QString & | path | ) | [virtual] |
| void MythMediaDevice::setSpeed | ( | int | speed | ) | [virtual] |
Reimplemented in MythCDROMLinux.
Definition at line 300 of file mythmedia.cpp.
Referenced by MediaMonitor::SetCDSpeed().
| virtual MediaStatus MythMediaDevice::checkMedia | ( | ) | [pure virtual] |
| MediaError MythMediaDevice::eject | ( | bool | open_close = true |
) | [virtual] |
Reimplemented in MythCDROMFreeBSD, and MythCDROMLinux.
Definition at line 270 of file mythmedia.cpp.
Referenced by MediaMonitor::ChooseAndEjectMedia(), and Ripper::ejectCD().
| MediaError MythMediaDevice::lock | ( | void | ) | [virtual] |
Reimplemented in MythCDROMFreeBSD, and MythCDROMLinux.
Definition at line 307 of file mythmedia.cpp.
Referenced by MythCDROMLinux::lock(), and MythCDROMFreeBSD::lock().
| MediaError MythMediaDevice::unlock | ( | void | ) | [virtual] |
Reimplemented in MythCDROMFreeBSD, and MythCDROMLinux.
Definition at line 320 of file mythmedia.cpp.
Referenced by MediaMonitor::ChooseAndEjectMedia(), MythCDROM::onDeviceMounted(), MythCDROMLinux::unlock(), and MythCDROMFreeBSD::unlock().
Definition at line 101 of file mythmedia.cpp.
| bool MythMediaDevice::mount | ( | ) | [inline] |
Definition at line 102 of file mythmedia.h.
Referenced by MythHDD::checkMedia(), MythCDROMLinux::checkMedia(), MonitorThreadDarwin::diskInsert(), IconView::HandleMediaDeviceSelect(), and IconView::SetupMediaMonitor().
| bool MythMediaDevice::unmount | ( | ) | [inline] |
Definition at line 103 of file mythmedia.h.
Referenced by MediaMonitor::ChooseAndEjectMedia(), MythCDROM::onDeviceMounted(), and setStatus().
Tells us if m_DevicePath is a mounted device.
Definition at line 328 of file mythmedia.cpp.
Referenced by MythHDD::checkMedia(), MythCDROMLinux::checkMedia(), MediaMonitor::ChooseAndEjectMedia(), IconView::HandleMediaDeviceSelect(), performMountCmd(), setStatus(), IconView::SetupMediaMonitor(), MythCDROMLinux::testMedia(), and MythCDROMFreeBSD::testMedia().
| void MythMediaDevice::RegisterMediaExtensions | ( | uint | mediatype, | |
| const QString & | extensions | |||
| ) |
Used to register media types with extensions.
| mediatype | MediaType flag. | |
| extensions | Comma separated list of extensions like 'mp3,ogg,flac'. |
Definition at line 262 of file mythmedia.cpp.
| void MythMediaDevice::clearData | ( | ) |
| const char * MythMediaDevice::MediaTypeString | ( | ) |
Definition at line 462 of file mythmedia.cpp.
Referenced by MythCDROMLinux::checkMedia(), MediaMonitor::mediaStatusChanged(), and performMountCmd().
| const char * MythMediaDevice::MediaTypeString | ( | MediaType | type | ) | [static] |
Definition at line 467 of file mythmedia.cpp.
| void MythMediaDevice::statusChanged | ( | MediaStatus | 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 126 of file mythmedia.h.
Referenced by MythCDROM::onDeviceMounted(), and performMountCmd().
| virtual void MythMediaDevice::onDeviceUnmounted | ( | ) | [inline, protected, virtual] |
Override this to perform any post unmount logic.
Definition at line 134 of file mythmedia.h.
Referenced by performMountCmd().
| MediaType MythMediaDevice::DetectMediaType | ( | void | ) | [protected] |
Recursively scan directories and create an associative array with the number of times we've seen each extension.
Definition at line 225 of file mythmedia.cpp.
Referenced by DetectMediaType().
| MediaStatus MythMediaDevice::setStatus | ( | MediaStatus | newStat, | |
| bool | CloseIt = false | |||
| ) | [protected] |
Definition at line 415 of file mythmedia.cpp.
Referenced by MediaMonitorDarwin::AddDevice(), MythHDD::checkMedia(), MythCDROM::checkMedia(), MythCDROMLinux::checkMedia(), MonitorThreadDarwin::diskRemove(), and MonitorThreadDarwin::diskRename().
friend class MediaMonitorDarwin [friend] |
Definition at line 47 of file mythmedia.h.
friend class MonitorThreadDarwin [friend] |
Definition at line 48 of file mythmedia.h.
const char * MythMediaDevice::MediaStatusStrings [static] |
Initial value:
{
"MEDIASTAT_ERROR",
"MEDIASTAT_UNKNOWN",
"MEDIASTAT_UNPLUGGED",
"MEDIASTAT_OPEN",
"MEDIASTAT_NODISK",
"MEDIASTAT_UNFORMATTED",
"MEDIASTAT_USEABLE",
"MEDIASTAT_NOTMOUNTED",
"MEDIASTAT_MOUNTED"
}
Definition at line 110 of file mythmedia.h.
Referenced by MythCDROMLinux::checkMedia(), and MediaMonitor::mediaStatusChanged().
const char * MythMediaDevice::MediaErrorStrings [static] |
Initial value:
{
"MEDIAERR_OK",
"MEDIAERR_FAILED",
"MEDIAERR_UNSUPPORTED"
}
Definition at line 111 of file mythmedia.h.
QString MythMediaDevice::m_DeviceModel [protected] |
QString MythMediaDevice::m_DevicePath [protected] |
The path to this media's device.
(e.g. /dev/cdrom) Read only
Definition at line 142 of file mythmedia.h.
Referenced by MythCDROMLinux::checkMedia(), MythCDROMLinux::driveStatus(), eject(), MythCDROMLinux::hasWritableMedia(), isMounted(), isSameDevice(), MythCDROMLinux::isSameDevice(), MythMediaDevice(), openDevice(), performMountCmd(), MythCDROMLinux::SCSIstatus(), setSpeed(), MythCDROMLinux::setSpeed(), and MythCDROMLinux::testMedia().
QString MythMediaDevice::m_KeyID [protected] |
KeyID of the media.
Read only (For ISO9660, volumeid + creation_date)
Definition at line 144 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 146 of file mythmedia.h.
Referenced by MythHDD::checkMedia(), DetectMediaType(), isMounted(), 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 148 of file mythmedia.h.
Referenced by isMounted(), and MythMediaDevice().
QString MythMediaDevice::m_VolumeID [protected] |
The volume ID of the media. Read/write.
Definition at line 150 of file mythmedia.h.
Referenced by MythHDD::checkMedia(), MythCDROMLinux::checkMedia(), and clearData().
MediaStatus MythMediaDevice::m_Status [protected] |
The status of the media as of the last call to checkMedia.
Read only
Definition at line 152 of file mythmedia.h.
Referenced by MythHDD::checkMedia(), MythCDROMLinux::checkMedia(), isMounted(), MythHDD::MythHDD(), MythMediaDevice(), MythCDROM::onDeviceMounted(), performMountCmd(), and setStatus().
MediaType MythMediaDevice::m_MediaType [protected] |
The type of media. Read only.
Definition at line 154 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 156 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 157 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 158 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 160 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 165 of file mythmedia.h.
Referenced by DetectMediaType(), and RegisterMediaExtensions().
1.5.5