MythTV  master
Public Member Functions | List of all members
MediaMonitorDarwin Class Reference

This currently depends on Apple's DiskArbitration framework. More...

#include <mediamonitor-darwin.h>

Inheritance diagram for MediaMonitorDarwin:
Inheritance graph
[legend]
Collaboration diagram for MediaMonitorDarwin:
Collaboration graph
[legend]

Public Member Functions

 MediaMonitorDarwin (QObject *par, unsigned long interval, bool allowEject)
 
void StartMonitoring (void) override
 Start the monitoring thread if needed. More...
 
bool AddDevice (MythMediaDevice *pDevice) override
 Simpler version of MediaMonitorUnix::AddDevice() More...
 
QStringList GetCDROMBlockDevices (void) override
 List of CD/DVD devices. More...
 
- Public Member Functions inherited from MediaMonitor
virtual void deleteLater (void)
 
bool IsActive (void) const
 
void StopMonitoring (void)
 Stop the monitoring thread if needed. More...
 
void ChooseAndEjectMedia (void)
 Unmounts and ejects removable media devices. More...
 
void EjectMedia (const QString &path)
 
bool ValidateAndLock (MythMediaDevice *pMedia)
 Validates the MythMediaDevice and increments its reference count. More...
 
void Unlock (MythMediaDevice *pMedia)
 decrements the MythMediaDevices reference count More...
 
QList< MythMediaDevice * > GetRemovable (bool showMounted=false, bool showUsable=false)
 Generate a list of removable drives. More...
 
QList< MythMediaDevice * > GetMedias (unsigned mediatypes)
 Ask for available media. More...
 
MythMediaDeviceGetMedia (const QString &path)
 Get media device by pathname. More...
 
void RegisterMediaHandler (const QString &destination, const QString &description, void(*callback)(MythMediaDevice *), int mediaType, const QString &extensions)
 Register a handler for media related events. More...
 
void JumpToMediaHandler (MythMediaDevice *pMedia)
 Find a relevant jump point for this type of media. More...
 

Additional Inherited Members

- Public Slots inherited from MediaMonitor
void mediaStatusChanged (MythMediaStatus oldStatus, MythMediaDevice *pMedia)
 Slot which is called when the device status changes and posts a media event to the mainwindow. More...
 
- Static Public Member Functions inherited from MediaMonitor
static MediaMonitorGetMediaMonitor (void)
 
static QString GetMountPath (const QString &devPath)
 If the device is being monitored, return its mountpoint. More...
 
static void SetCDSpeed (const char *device, int speed)
 
static QString defaultCDdevice ()
 CDDevice, user-selected drive, or /dev/cdrom. More...
 
static QString defaultVCDdevice ()
 VCDDeviceLocation, user-selected drive, or /dev/cdrom. More...
 
static QString defaultDVDdevice ()
 DVDDeviceLocation, user-selected drive, or /dev/dvd. More...
 
static QString defaultCDWriter ()
 CDWriterDeviceLocation, user-selected drive, or /dev/cdrom. More...
 
static QString defaultDVDWriter ()
 MythArchiveDVDLocation, user-selected drive, or /dev/dvd. More...
 
static void ejectOpticalDisc (void)
 Eject a disk, unmount a drive, open a tray. More...
 
- Protected Member Functions inherited from MediaMonitor
 MediaMonitor (QObject *par, unsigned long interval, bool allowEject)
 Lookup some settings, and do OS-specific stuff in sub-classes. More...
 
virtual ~MediaMonitor ()=default
 
void AttemptEject (MythMediaDevice *device)
 
void CheckDevices (void)
 Poll the devices in our list. More...
 
virtual void CheckDeviceNotifications (void)
 
bool RemoveDevice (const QString &dev)
 Remove a device from the media monitor. More...
 
bool shouldIgnore (const MythMediaDevice *device)
 Check user preferences to see if this device should be monitored. More...
 
bool eventFilter (QObject *obj, QEvent *event) override
 Installed into the main window's event chain, so that the main thread can safely jump to plugin code. More...
 
const QString listDevices (void)
 A string summarising the current devices, for debugging. More...
 
MythMediaDeviceselectDrivePopup (const QString &label, bool showMounted=false, bool showUsable=false)
 List removable drives, let the user select one. More...
 
- Static Protected Member Functions inherited from MediaMonitor
static QString defaultDevice (const QString &setting, const QString &label, const char *hardCodedDefault)
 
- Protected Attributes inherited from MediaMonitor
QMutex m_DevicesLock
 
QList< MythMediaDevice * > m_Devices
 
QList< MythMediaDevice * > m_RemovedDevices
 
QMap< MythMediaDevice *, int > m_UseCount
 
QStringList m_IgnoreList
 
bool volatile m_Active
 Was MonitorThread started? More...
 
QWaitCondition m_wait
 
MonitorThreadm_Thread
 
unsigned long m_MonitorPollingInterval
 
bool m_AllowEject
 
QMap< QString, MHDatam_handlerMap
 Registered Media Handlers. More...
 
- Static Protected Attributes inherited from MediaMonitor
static MediaMonitorc_monitor = nullptr
 

Detailed Description

This currently depends on Apple's DiskArbitration framework.

Only recent versions of OS X have this.

Definition at line 21 of file mediamonitor-darwin.h.

Constructor & Destructor Documentation

◆ MediaMonitorDarwin()

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

Definition at line 24 of file mediamonitor-darwin.h.

Member Function Documentation

◆ StartMonitoring()

void MediaMonitorDarwin::StartMonitoring ( void  )
overridevirtual

Start the monitoring thread if needed.

Reimplemented from MediaMonitor.

Definition at line 522 of file mediamonitor-darwin.cpp.

◆ AddDevice()

bool MediaMonitorDarwin::AddDevice ( MythMediaDevice pDevice)
overridevirtual

Simpler version of MediaMonitorUnix::AddDevice()

This doesn't do the stat() or duplicate checking.

Implements MediaMonitor.

Definition at line 549 of file mediamonitor-darwin.cpp.

◆ GetCDROMBlockDevices()

QStringList MediaMonitorDarwin::GetCDROMBlockDevices ( void  )
overridevirtual

List of CD/DVD devices.

On Unix, this returns a list of /dev nodes which can be open()d. Darwin doesn't have fixed devices for removables/pluggables, so this method is actually useless as it stands. In the long term, this method should return both a name, and an opaque type? (for the IOKit io_object_t)

Implements MediaMonitor.

Definition at line 626 of file mediamonitor-darwin.cpp.


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