00001 #ifndef MYTHRAOPDEVICE_H
00002 #define MYTHRAOPDEVICE_H
00003
00004 #include <QObject>
00005
00006 #include "serverpool.h"
00007 #include "mythtvexp.h"
00008
00009 class QMutex;
00010 class MThread;
00011 class BonjourRegister;
00012 class MythRAOPConnection;
00013
00014 #define RAOP_PORT_RANGE 100
00015 #define RAOP_HARDWARE_ID_SIZE 6
00016
00017 class MTV_PUBLIC MythRAOPDevice : public ServerPool
00018 {
00019 Q_OBJECT
00020
00021 public:
00022 static bool Create(void);
00023 static void Cleanup(void);
00024
00025 MythRAOPDevice();
00026 bool NextInAudioQueue(MythRAOPConnection* conn);
00027 static QString HardwareId();
00028
00029 private slots:
00030 void Start();
00031 void newConnection(QTcpSocket *client);
00032 void deleteClient();
00033
00034 private:
00035 virtual ~MythRAOPDevice(void);
00036 void Teardown(void);
00037
00038
00039 static MythRAOPDevice *gMythRAOPDevice;
00040 static QMutex *gMythRAOPDeviceMutex;
00041 static MThread *gMythRAOPDeviceThread;
00042
00043
00044 QString m_name;
00045 QByteArray m_hardwareId;
00046 BonjourRegister *m_bonjour;
00047 bool m_valid;
00048 QMutex *m_lock;
00049 int m_setupPort;
00050 QList<MythRAOPConnection*> m_clients;
00051 };
00052
00053
00054 #endif // MYTHRAOPDEVICE_H