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
ServerPool
Manages a collection of sockets listening on different ports.
Definition: serverpool.h:60
mythtvexp.h
slots
unsigned int slots[4]
Definition: element.cpp:38
MythRAOPDevice::gMythRAOPDeviceMutex
static QMutex * gMythRAOPDeviceMutex
Definition: mythraopdevice.h:44
BonjourRegister
Definition: bonjourregister.h:12
ServerPool::newConnection
void newConnection(QTcpSocket *)
MythRAOPDevice
Definition: mythraopdevice.h:17
MythRAOPDevice::gMythRAOPDevice
static MythRAOPDevice * gMythRAOPDevice
Definition: mythraopdevice.h:43
MythRAOPDevice::m_clients
QList< MythRAOPConnection * > m_clients
Definition: mythraopdevice.h:55
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
MythRAOPDevice::m_hardwareId
QByteArray m_hardwareId
Definition: mythraopdevice.h:49
m_name
const char * m_name
Definition: ParseText.cpp:329
MythRAOPDevice::RAOPSharedInstance
static MythRAOPDevice * RAOPSharedInstance(void)
Definition: mythraopdevice.h:23
serverpool.h
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:49
MythRAOPConnection
Definition: mythraopconnection.h:46
MythRAOPDevice::gMythRAOPDeviceThread
static MThread * gMythRAOPDeviceThread
Definition: mythraopdevice.h:45