MythTV  master
mythraopdevice.h
Go to the documentation of this file.
1 #ifndef MYTHRAOPDEVICE_H
2 #define MYTHRAOPDEVICE_H
3 
4 #include <QObject>
5 #include <QRecursiveMutex>
6 
8 #include "libmythtv/mythtvexp.h"
9 
10 class MThread;
11 class BonjourRegister;
12 class MythRAOPConnection;
13 
14 static constexpr int 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 newRaopConnection(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 QRecursiveMutex *gMythRAOPDeviceMutex;
46 
47  // Members
48  QString m_name {"MythTV"};
49  QByteArray m_hardwareId;
50  BonjourRegister *m_bonjour {nullptr};
51  bool m_valid {false};
52  QRecursiveMutex *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:59
mythtvexp.h
BonjourRegister
Definition: bonjourregister.h:11
MythRAOPDevice
Definition: mythraopdevice.h:16
MythRAOPDevice::gMythRAOPDeviceMutex
static QRecursiveMutex * gMythRAOPDeviceMutex
Definition: mythraopdevice.h:44
MythRAOPDevice::gMythRAOPDevice
static MythRAOPDevice * gMythRAOPDevice
Definition: mythraopdevice.h:43
MythRAOPDevice::m_clients
QList< MythRAOPConnection * > m_clients
Definition: mythraopdevice.h:55
RAOP_PORT_RANGE
static constexpr int RAOP_PORT_RANGE
Definition: mythraopdevice.h:14
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
MythRAOPDevice::m_hardwareId
QByteArray m_hardwareId
Definition: mythraopdevice.h:49
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:48
MythRAOPConnection
Definition: mythraopconnection.h:46
MythRAOPDevice::gMythRAOPDeviceThread
static MThread * gMythRAOPDeviceThread
Definition: mythraopdevice.h:45