MythTV  master
Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
NetworkControl Class Reference

#include <networkcontrol.h>

Inheritance diagram for NetworkControl:
Inheritance graph
[legend]
Collaboration diagram for NetworkControl:
Collaboration graph
[legend]

Public Member Functions

 NetworkControl ()
 
 ~NetworkControl ()
 
- Public Member Functions inherited from ServerPool
 ServerPool (QObject *parent=nullptr)
 
 ~ServerPool (void)
 
bool listen (QList< QHostAddress > addrs, quint16 port, bool requireall=true, PoolServerType type=kTCPServer)
 
bool listen (QStringList addrs, quint16 port, bool requireall=true, PoolServerType type=kTCPServer)
 
bool listen (quint16 port, bool requireall=true, PoolServerType type=kTCPServer)
 
bool bind (QList< QHostAddress > addrs, quint16 port, bool requireall=true)
 
bool bind (QStringList addrs, quint16 port, bool requireall=true)
 
bool bind (quint16 port, bool requireall=true)
 
qint64 writeDatagram (const char *data, qint64 size, const QHostAddress &addr, quint16 port)
 
qint64 writeDatagram (const QByteArray &datagram, const QHostAddress &addr, quint16 port)
 
bool isListening (void)
 
int maxPendingConnections (void)
 
void setMaxPendingConnections (int n)
 
quint16 serverPort (void)
 
QNetworkProxy proxy (void)
 
void setProxy (const QNetworkProxy &proxy)
 
void close (void)
 
int tryListeningPort (int baseport, int range=1)
 tryListeningPort More...
 
int tryBindingPort (int baseport, int range=1)
 tryBindingPort More...
 

Protected Member Functions

void run (void) override
 

Private Slots

void newConnection (QTcpSocket *socket)
 
void receiveCommand (QString &command)
 
void deleteClient (void)
 

Private Member Functions

QString processJump (NetworkCommand *nc)
 
QString processKey (NetworkCommand *nc)
 
QString processLiveTV (NetworkCommand *nc)
 
QString processPlay (NetworkCommand *nc, int clientID)
 
QString processQuery (NetworkCommand *nc)
 
QString processSet (NetworkCommand *nc)
 
QString processMessage (NetworkCommand *nc)
 
QString processNotification (NetworkCommand *nc)
 
QString processTheme (NetworkCommand *nc)
 
QString processHelp (NetworkCommand *nc)
 
void notifyDataAvailable (void)
 
void sendReplyToClient (NetworkControlClient *ncc, QString &reply)
 
void customEvent (QEvent *e) override
 
QString listRecordings (QString chanid="", QString starttime="")
 
QString listSchedule (const QString &chanID="") const
 
QString listChannels (const uint start, const uint limit) const
 
QString saveScreenshot (NetworkCommand *nc)
 
void processNetworkControlCommand (NetworkCommand *nc)
 
void deleteClient (NetworkControlClient *ncc)
 
QString getWidgetType (MythUIType *type)
 

Private Attributes

QString prompt
 
bool gotAnswer
 
QString answer
 
QMap< QString, QString > jumpMap
 
QMap< QString, int > keyMap
 
QMap< int, QString > keyTextMap
 
QMutex clientLock
 
QList< NetworkControlClient * > clients
 
QList< NetworkCommand * > networkControlCommands
 
QMutex ncLock
 
QWaitCondition ncCond
 
QList< NetworkCommand * > networkControlReplies
 
QMutex nrLock
 
MThreadcommandThread
 
bool stopCommandThread
 

Additional Inherited Members

- Signals inherited from ServerPool
void newConnection (QTcpSocket *)
 
void newDatagram (QByteArray, QHostAddress, quint16)
 
- Static Public Member Functions inherited from ServerPool
static void RefreshDefaultListen (void)
 
static QList< QHostAddress > DefaultListen (void)
 
static QList< QHostAddress > DefaultListenIPv4 (void)
 
static QList< QHostAddress > DefaultListenIPv6 (void)
 
static QList< QHostAddress > DefaultBroadcast (void)
 
static QList< QHostAddress > DefaultBroadcastIPv4 (void)
 
static QList< QHostAddress > DefaultBroadcastIPv6 (void)
 
static int tryListeningPort (QTcpServer *server, int baseport, int range=1, bool *isipv6=nullptr)
 tryListeningPort More...
 
static int tryBindingPort (QUdpSocket *socket, int baseport, int range=1, bool *isipv6=nullptr)
 tryBindingPort More...
 
- Protected Slots inherited from ServerPool
virtual void newUdpDatagram (void)
 
virtual void newTcpConnection (qt_socket_fd_t socket)
 

Detailed Description

Definition at line 93 of file networkcontrol.h.

Constructor & Destructor Documentation

◆ NetworkControl()

NetworkControl::NetworkControl ( )

Definition at line 77 of file networkcontrol.cpp.

◆ ~NetworkControl()

NetworkControl::~NetworkControl ( void  )

Definition at line 248 of file networkcontrol.cpp.

Member Function Documentation

◆ newConnection

void NetworkControl::newConnection ( QTcpSocket *  socket)
privateslot

Definition at line 368 of file networkcontrol.cpp.

Referenced by NetworkControl().

◆ receiveCommand

void NetworkControl::receiveCommand ( QString &  command)
privateslot

Definition at line 439 of file networkcontrol.cpp.

Referenced by newConnection().

◆ deleteClient [1/2]

void NetworkControl::deleteClient ( void  )
privateslot

Definition at line 335 of file networkcontrol.cpp.

Referenced by customEvent(), and newConnection().

◆ run()

void NetworkControl::run ( void  )
overrideprotected

Definition at line 276 of file networkcontrol.cpp.

◆ processJump()

QString NetworkControl::processJump ( NetworkCommand nc)
private

Definition at line 453 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processKey()

QString NetworkControl::processKey ( NetworkCommand nc)
private

Definition at line 474 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processLiveTV()

QString NetworkControl::processLiveTV ( NetworkCommand nc)
private

◆ processPlay()

QString NetworkControl::processPlay ( NetworkCommand nc,
int  clientID 
)
private

Definition at line 575 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processQuery()

QString NetworkControl::processQuery ( NetworkCommand nc)
private

Definition at line 903 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processSet()

QString NetworkControl::processSet ( NetworkCommand nc)
private

Definition at line 1060 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processMessage()

QString NetworkControl::processMessage ( NetworkCommand nc)
private

Definition at line 1491 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processNotification()

QString NetworkControl::processNotification ( NetworkCommand nc)
private

Definition at line 1504 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processTheme()

QString NetworkControl::processTheme ( NetworkCommand nc)
private

Definition at line 1143 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processHelp()

QString NetworkControl::processHelp ( NetworkCommand nc)
private

Definition at line 1307 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ notifyDataAvailable()

void NetworkControl::notifyDataAvailable ( void  )
private

◆ sendReplyToClient()

void NetworkControl::sendReplyToClient ( NetworkControlClient ncc,
QString &  reply 
)
private

Definition at line 1522 of file networkcontrol.cpp.

Referenced by customEvent().

◆ customEvent()

void NetworkControl::customEvent ( QEvent *  e)
overrideprivate

Definition at line 1549 of file networkcontrol.cpp.

◆ listRecordings()

QString NetworkControl::listRecordings ( QString  chanid = "",
QString  starttime = "" 
)
private

Definition at line 1689 of file networkcontrol.cpp.

Referenced by processQuery().

◆ listSchedule()

QString NetworkControl::listSchedule ( const QString &  chanID = "") const
private

Definition at line 1634 of file networkcontrol.cpp.

Referenced by processQuery().

◆ listChannels()

QString NetworkControl::listChannels ( const uint  start,
const uint  limit 
) const
private

Definition at line 1739 of file networkcontrol.cpp.

Referenced by processQuery().

◆ saveScreenshot()

QString NetworkControl::saveScreenshot ( NetworkCommand nc)
private

Definition at line 1790 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand(), and processPlay().

◆ processNetworkControlCommand()

void NetworkControl::processNetworkControlCommand ( NetworkCommand nc)
private

Definition at line 294 of file networkcontrol.cpp.

Referenced by run().

◆ deleteClient() [2/2]

void NetworkControl::deleteClient ( NetworkControlClient ncc)
private

Definition at line 354 of file networkcontrol.cpp.

◆ getWidgetType()

QString NetworkControl::getWidgetType ( MythUIType type)
private

Definition at line 1099 of file networkcontrol.cpp.

Referenced by processTheme().

Member Data Documentation

◆ prompt

QString NetworkControl::prompt
private

Definition at line 136 of file networkcontrol.h.

Referenced by sendReplyToClient().

◆ gotAnswer

bool NetworkControl::gotAnswer
private

Definition at line 137 of file networkcontrol.h.

Referenced by customEvent(), processPlay(), and processQuery().

◆ answer

QString NetworkControl::answer
private

Definition at line 138 of file networkcontrol.h.

Referenced by customEvent(), processPlay(), and processQuery().

◆ jumpMap

QMap<QString, QString> NetworkControl::jumpMap
private

Definition at line 139 of file networkcontrol.h.

Referenced by NetworkControl(), processHelp(), processJump(), processPlay(), and processTheme().

◆ keyMap

QMap<QString, int> NetworkControl::keyMap
private

Definition at line 140 of file networkcontrol.h.

Referenced by NetworkControl(), processHelp(), and processKey().

◆ keyTextMap

QMap<int, QString> NetworkControl::keyTextMap
private

Definition at line 141 of file networkcontrol.h.

Referenced by NetworkControl(), and processKey().

◆ clientLock

QMutex NetworkControl::clientLock
mutableprivate

◆ clients

QList<NetworkControlClient*> NetworkControl::clients
private

◆ networkControlCommands

QList<NetworkCommand*> NetworkControl::networkControlCommands
private

Definition at line 146 of file networkcontrol.h.

Referenced by receiveCommand(), and run().

◆ ncLock

QMutex NetworkControl::ncLock
private

Definition at line 147 of file networkcontrol.h.

Referenced by receiveCommand(), run(), and ~NetworkControl().

◆ ncCond

QWaitCondition NetworkControl::ncCond
private

Definition at line 148 of file networkcontrol.h.

Referenced by receiveCommand(), run(), and ~NetworkControl().

◆ networkControlReplies

QList<NetworkCommand*> NetworkControl::networkControlReplies
private

◆ nrLock

QMutex NetworkControl::nrLock
private

◆ commandThread

MThread* NetworkControl::commandThread
private

Definition at line 153 of file networkcontrol.h.

Referenced by NetworkControl(), and ~NetworkControl().

◆ stopCommandThread

bool NetworkControl::stopCommandThread
private

Definition at line 154 of file networkcontrol.h.

Referenced by run(), and ~NetworkControl().


The documentation for this class was generated from the following files: