Go to the documentation of this file. 1 #ifndef MYTH_MEDIA_MONITOR_H
2 #define MYTH_MEDIA_MONITOR_H
6 #include <QRecursiveMutex>
7 #include <QWaitCondition>
37 void run(
void)
override;
52 virtual void deleteLater(
void);
55 virtual void StartMonitoring(
void);
56 void StopMonitoring(
void);
57 void ChooseAndEjectMedia(
void);
58 void EjectMedia(
const QString &path);
61 static QString GetMountPath(
const QString& devPath);
62 static void SetCDSpeed(
const char *device,
int speed);
70 QList<MythMediaDevice*> GetRemovable(
bool showMounted =
false,
71 bool showUsable =
false);
72 QList<MythMediaDevice*> GetMedias(
unsigned mediatypes);
75 void RegisterMediaHandler(
const QString &destination,
76 const QString &description,
79 const QString &extensions);
83 static QString defaultCDdevice();
84 static QString defaultVCDdevice();
85 static QString defaultDVDdevice();
86 static QString defaultCDWriter();
87 static QString defaultDVDWriter();
89 static void ejectOpticalDisc(
void);
91 virtual QStringList GetCDROMBlockDevices(
void) = 0;
97 MediaMonitor(QObject *par,
unsigned long interval,
bool allowEject);
101 void CheckDevices(
void);
104 bool RemoveDevice(
const QString &dev);
106 bool eventFilter(QObject *obj, QEvent *event)
override;
108 QString listDevices(
void);
110 static QString defaultDevice(
const QString &setting,
111 const QString &label,
112 const char *hardCodedDefault);
114 bool showMounted =
false,
115 bool showUsable =
false);
126 bool volatile m_active {
false};
139 const QString& description,
142 const QString& extensions)
145 callback, mediaType, extensions);
149 #endif // MYTH_MEDIA_MONITOR_H
MonitorThread(MediaMonitor *pMon, unsigned long interval)
void(* callback)(MythMediaDevice *mediadevice)
void run(void) override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
~MonitorThread() override
QDateTime m_lastCheckTime
QPointer< MediaMonitor > m_monitor
void setMonitor(MediaMonitor *pMon)
Stores details of media handlers.
This is a wrapper around QThread that does several additional things.
MThreadInternal * m_thread