Ticket #1753: mythmediamonitor-darwin.3.h

File mythmediamonitor-darwin.3.h, 1.2 KB (added by awk@…, 13 years ago)

Updated Darwin specific media monitor subclass

Line 
1#ifndef MYTH_MEDIA_MONITOR_DARWIN_H
2#define MYTH_MEDIA_MONITOR_DARWIN_H
3
4#include <DiskArbitration/DiskArbitration.h>
5#include "mythmedia.h"
6#include "mythmediamonitor.h"
7
8extern "C" void diskAppearedCallback(DADiskRef disk, void *context);
9extern "C" void diskDisappearedCallback(DADiskRef disk, void *context);
10extern "C" MediaType MediaTypeForBSDName(const char *bsdName);
11
12class MonitorThreadDarwin : public MonitorThread
13{
14  public:
15    MonitorThreadDarwin( MediaMonitor* pMon,  unsigned long interval);
16    virtual void run(void);
17
18    void registerDiskArbitrationCallbacks();
19    void unregisterDiskArbitrationCallbacks();
20    void diskAppeared(QString devName);
21    void diskDisappeared(QString devName);
22
23  protected:
24    void *m_DiskArbitrationSession;         // Really a DASessionRef, but the void* here lets us avoid Mac Headers in this file 8-)
25};
26
27class MediaMonitorDarwin : public MediaMonitor
28{
29    friend class MediaMonitor;
30   
31    protected:
32      MediaMonitorDarwin(QObject* par, unsigned long interval, bool allowEject) : MediaMonitor(par, interval, allowEject) {}
33
34    public:
35        virtual void StartMonitoring(void);
36    protected:
37        virtual bool AddDevice(MythMediaDevice* pDevice);
38};
39#endif // MYTH_MEDIA_MONITOR_DARWIN_H