MythTV  master
mythraopdevice.h
Go to the documentation of this file.
1 #ifndef MYTHRAOPDEVICE_H
2 #define MYTHRAOPDEVICE_H
3 
4 #include <QObject>
5 
6 #include "serverpool.h"
7 #include "mythtvexp.h"
8 
9 class QMutex;
10 class MThread;
11 class BonjourRegister;
12 class MythRAOPConnection;
13 
14 #define RAOP_PORT_RANGE 100
15 
17 {
18  Q_OBJECT
19 
20  public:
21  static bool Create(void);
22  static void Cleanup(void);
23  static MythRAOPDevice *RAOPSharedInstance(void) { return gMythRAOPDevice; }
24 
26  void DeleteAllClients(MythRAOPConnection *keep);
27 
28  public slots:
29  void TVPlaybackStarting(void);
30 
31  private slots:
32  void Start();
33  void Stop();
34  void newConnection(QTcpSocket *client);
35  void deleteClient();
36 
37  private:
38  ~MythRAOPDevice(void) override;
39  void Teardown(void);
40  bool RegisterForBonjour(void);
41 
42  // Globals
44  static QMutex *gMythRAOPDeviceMutex;
46 
47  // Members
48  QString m_name {"MythTV"};
49  QByteArray m_hardwareId;
50  BonjourRegister *m_bonjour {nullptr};
51  bool m_valid {false};
52  QMutex *m_lock {nullptr};
53  int m_setupPort {5000};
54  int m_basePort {0};
55  QList<MythRAOPConnection*> m_clients;
56 };
57 
58 
59 #endif // MYTHRAOPDEVICE_H
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:46
unsigned int slots[4]
Definition: element.c:38
static MythRAOPDevice * gMythRAOPDevice
#define MTV_PUBLIC
Definition: mythtvexp.h:15
static QMutex * gMythRAOPDeviceMutex
Manages a collection of sockets listening on different ports.
Definition: serverpool.h:59
static MythRAOPDevice * RAOPSharedInstance(void)
QList< MythRAOPConnection * > m_clients
static MThread * gMythRAOPDeviceThread
QByteArray m_hardwareId
void newConnection(QTcpSocket *)