1#ifndef MYTH_MEDIA_MONITOR_H
2#define MYTH_MEDIA_MONITOR_H
6#include <QRecursiveMutex>
7#include <QWaitCondition>
41 void run(
void)
override;
55 virtual void deleteLater(
void);
56 bool eventFilter(QObject *obj, QEvent *event)
override;
59 virtual void StartMonitoring(
void);
60 void StopMonitoring(
void);
61 void ChooseAndEjectMedia(
void);
62 void EjectMedia(
const QString &path);
65 static QString GetMountPath(
const QString& devPath);
66 static void SetCDSpeed(
const char *device,
int speed);
74 QList<MythMediaDevice*> GetRemovable(
bool showMounted =
false,
75 bool showUsable =
false);
76 QList<MythMediaDevice*> GetMedias(
unsigned mediatypes);
79 void RegisterMediaHandler(
const QString &destination,
80 const QString &description,
83 const QString &extensions);
84 void JumpToMediaHandler(
MythMediaDevice* pMedia,
bool forcePlayback =
false);
87 static QString defaultCDdevice();
88 static QString defaultVCDdevice();
89 static QString defaultDVDdevice();
90 static QString defaultCDWriter();
91 static QString defaultDVDWriter();
93 static void ejectOpticalDisc(
void);
102 MediaMonitor(QObject *par,
unsigned long interval,
bool allowEject);
106 void CheckDevices(
void);
109 bool RemoveDevice(
const QString &dev);
112 QString listDevices(
void);
114 static QString defaultDevice(
const QString &setting,
115 const QString &label,
116 const char *hardCodedDefault);
119 bool showMounted =
false,
120 bool showUsable =
false);
131 bool volatile m_active {
false};
144 const QString& description,
147 const QString& extensions)
150 callback, mediaType, extensions);
This is a wrapper around QThread that does several additional things.
MThreadInternal * m_thread
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
void run(void) override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
QDateTime m_lastCheckTime
MonitorThread(MediaMonitor *pMon, unsigned long interval)
void setMonitor(MediaMonitor *pMon)
QPointer< MediaMonitor > m_monitor
~MonitorThread() override
Stores details of media handlers.