MythTV master
upnp.h
Go to the documentation of this file.
1
2// Program Name: upnp.h
3// Created : Oct. 24, 2005
4//
5// Purpose : UPnp Main Class
6//
7// Copyright (c) 2005 David Blain <dblain@mythtv.org>
8//
9// Licensed under the GPL v2 or later, see LICENSE for details
10//
12
13#ifndef UPNP_H
14#define UPNP_H
15
16// Qt
17#include <QObject>
18
19// MythTV
21
23//
25
26#include "upnpdevice.h"
27#include "httpserver.h"
28
31//
32//
33//
36
37class UPNP_PUBLIC UPnp : public QObject
38{
39 Q_OBJECT
40
41 protected:
42
43 HttpServer *m_pHttpServer {nullptr};
44 int m_nServicePort {0};
45
46 public:
47
49 static QList<QHostAddress> g_IPAddrList;
50
51 public:
52 UPnp();
53 ~UPnp() override;
54
55 bool Initialize( int nServicePort, HttpServer *pHttpServer );
56 bool Initialize( QList<QHostAddress> &sIPAddrList, int nServicePort,
57 HttpServer *pHttpServer );
58
59 bool isInitialized() { return (m_pHttpServer != nullptr); }
60
61 virtual void Start();
62
63 static void CleanUp ();
64
65 static UPnpDevice *RootDevice() { return &(g_UPnpDeviceDesc.m_rootDevice); }
66
67 HttpServer *GetHttpServer() { return m_pHttpServer; }
68
69 static UPnpDeviceDesc *GetDeviceDesc( QString &sURL );
70
71 public slots:
72 static void DisableNotifications(std::chrono::milliseconds /*unused*/);
73 void EnableNotificatins(std::chrono::milliseconds /*unused*/) const;
74
75 private:
77};
78
79#endif // UPNP_H
UPnpDevice m_rootDevice
Definition: upnpdevice.h:158
Definition: upnp.h:38
static UPnpDevice * RootDevice()
Definition: upnp.h:65
static QList< QHostAddress > g_IPAddrList
Definition: upnp.h:49
bool isInitialized()
Definition: upnp.h:59
MythPower * m_power
Definition: upnp.h:76
HttpServer * GetHttpServer()
Definition: upnp.h:67
static UPnpDeviceDesc g_UPnpDeviceDesc
Definition: upnp.h:48
#define UPNP_PUBLIC
Definition: upnpexp.h:9