1#ifndef MYTH_MEDIA_MONITOR_H
2#define MYTH_MEDIA_MONITOR_H
6#include <QRecursiveMutex>
7#include <QWaitCondition>
39 void run(
void)
override;
54 virtual void deleteLater(
void);
57 virtual void StartMonitoring(
void);
58 void StopMonitoring(
void);
59 void ChooseAndEjectMedia(
void);
60 void EjectMedia(
const QString &path);
63 static QString GetMountPath(
const QString& devPath);
64 static void SetCDSpeed(
const char *device,
int speed);
72 QList<MythMediaDevice*> GetRemovable(
bool showMounted =
false,
73 bool showUsable =
false);
74 QList<MythMediaDevice*> GetMedias(
unsigned mediatypes);
77 void RegisterMediaHandler(
const QString &destination,
78 const QString &description,
81 const QString &extensions);
82 void JumpToMediaHandler(
MythMediaDevice* pMedia,
bool forcePlayback =
false);
85 static QString defaultCDdevice();
86 static QString defaultVCDdevice();
87 static QString defaultDVDdevice();
88 static QString defaultCDWriter();
89 static QString defaultDVDWriter();
91 static void ejectOpticalDisc(
void);
99 MediaMonitor(QObject *par,
unsigned long interval,
bool allowEject);
103 void CheckDevices(
void);
106 bool RemoveDevice(
const QString &dev);
108 bool eventFilter(QObject *obj, QEvent *event)
override;
110 QString listDevices(
void);
112 static QString defaultDevice(
const QString &setting,
113 const QString &label,
114 const char *hardCodedDefault);
117 bool showMounted =
false,
118 bool showUsable =
false);
129 bool volatile m_active {
false};
142 const QString& description,
145 const QString& extensions)
148 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.