MythTV  master
Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Static 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 () override
 
- Public Member Functions inherited from ServerPool
 ServerPool (QObject *parent=nullptr)
 
 ~ServerPool (void) override
 
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 *client)
 
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 processTheme (NetworkCommand *nc)
 
QString processHelp (NetworkCommand *nc)
 
void notifyDataAvailable (void)
 
void sendReplyToClient (NetworkControlClient *ncc, QString &reply)
 
void customEvent (QEvent *e) override
 
void processNetworkControlCommand (NetworkCommand *nc)
 
void deleteClient (NetworkControlClient *ncc)
 

Static Private Member Functions

static QString processSet (NetworkCommand *nc)
 
static QString processMessage (NetworkCommand *nc)
 
static QString processNotification (NetworkCommand *nc)
 
static QString listRecordings (const QString &chanid="", const QString &starttime="")
 
static QString listSchedule (const QString &chanID="")
 
static QString listChannels (uint start, uint limit)
 
static QString saveScreenshot (NetworkCommand *nc)
 
static QString getWidgetType (MythUIType *type)
 

Private Attributes

QString m_prompt {"# "}
 
bool m_gotAnswer {false}
 
QString m_answer {""}
 
QMap< QString, QString > m_jumpMap
 
QMap< QString, int > m_keyMap
 
QMap< int, QString > m_keyTextMap
 
QMutex m_clientLock {QMutex::Recursive}
 
QList< NetworkControlClient * > m_clients
 
QList< NetworkCommand * > m_networkControlCommands
 
QMutex m_ncLock
 
QWaitCondition m_ncCond
 
QList< NetworkCommand * > m_networkControlReplies
 
QMutex m_nrLock
 
MThreadm_commandThread {nullptr}
 
bool m_stopCommandThread {false}
 

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 76 of file networkcontrol.cpp.

◆ ~NetworkControl()

NetworkControl::~NetworkControl ( void  )
override

Definition at line 243 of file networkcontrol.cpp.

Member Function Documentation

◆ newConnection

void NetworkControl::newConnection ( QTcpSocket *  client)
privateslot

Definition at line 367 of file networkcontrol.cpp.

Referenced by NetworkControl().

◆ receiveCommand

void NetworkControl::receiveCommand ( QString &  command)
privateslot

Definition at line 438 of file networkcontrol.cpp.

Referenced by newConnection().

◆ deleteClient [1/2]

void NetworkControl::deleteClient ( void  )
privateslot

Definition at line 334 of file networkcontrol.cpp.

Referenced by customEvent(), and newConnection().

◆ run()

void NetworkControl::run ( void  )
overrideprotected

Definition at line 271 of file networkcontrol.cpp.

◆ processJump()

QString NetworkControl::processJump ( NetworkCommand nc)
private

Definition at line 452 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processKey()

QString NetworkControl::processKey ( NetworkCommand nc)
private

Definition at line 473 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 573 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processQuery()

QString NetworkControl::processQuery ( NetworkCommand nc)
private

Definition at line 915 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processSet()

QString NetworkControl::processSet ( NetworkCommand nc)
staticprivate

Definition at line 1077 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processMessage()

QString NetworkControl::processMessage ( NetworkCommand nc)
staticprivate

Definition at line 1514 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processNotification()

QString NetworkControl::processNotification ( NetworkCommand nc)
staticprivate

Definition at line 1527 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processTheme()

QString NetworkControl::processTheme ( NetworkCommand nc)
private

Definition at line 1162 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processHelp()

QString NetworkControl::processHelp ( NetworkCommand nc)
private

Definition at line 1329 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 1545 of file networkcontrol.cpp.

Referenced by customEvent().

◆ customEvent()

void NetworkControl::customEvent ( QEvent *  e)
overrideprivate

Definition at line 1574 of file networkcontrol.cpp.

◆ listRecordings()

QString NetworkControl::listRecordings ( const QString &  chanid = "",
const QString &  starttime = "" 
)
staticprivate

Definition at line 1718 of file networkcontrol.cpp.

Referenced by processQuery().

◆ listSchedule()

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

Definition at line 1663 of file networkcontrol.cpp.

Referenced by processQuery().

◆ listChannels()

QString NetworkControl::listChannels ( uint  start,
uint  limit 
)
staticprivate

Definition at line 1774 of file networkcontrol.cpp.

Referenced by processQuery().

◆ saveScreenshot()

QString NetworkControl::saveScreenshot ( NetworkCommand nc)
staticprivate

Definition at line 1824 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand(), and processPlay().

◆ processNetworkControlCommand()

void NetworkControl::processNetworkControlCommand ( NetworkCommand nc)
private

Definition at line 289 of file networkcontrol.cpp.

Referenced by run().

◆ deleteClient() [2/2]

void NetworkControl::deleteClient ( NetworkControlClient ncc)
private

Definition at line 353 of file networkcontrol.cpp.

◆ getWidgetType()

QString NetworkControl::getWidgetType ( MythUIType type)
staticprivate

Definition at line 1118 of file networkcontrol.cpp.

Referenced by processTheme().

Member Data Documentation

◆ m_prompt

QString NetworkControl::m_prompt {"# "}
private

Definition at line 136 of file networkcontrol.h.

Referenced by sendReplyToClient().

◆ m_gotAnswer

bool NetworkControl::m_gotAnswer {false}
private

Definition at line 137 of file networkcontrol.h.

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

◆ m_answer

QString NetworkControl::m_answer {""}
private

Definition at line 138 of file networkcontrol.h.

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

◆ m_jumpMap

QMap<QString, QString> NetworkControl::m_jumpMap
private

Definition at line 139 of file networkcontrol.h.

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

◆ m_keyMap

QMap<QString, int> NetworkControl::m_keyMap
private

Definition at line 140 of file networkcontrol.h.

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

◆ m_keyTextMap

QMap<int, QString> NetworkControl::m_keyTextMap
private

Definition at line 141 of file networkcontrol.h.

Referenced by NetworkControl(), and processKey().

◆ m_clientLock

QMutex NetworkControl::m_clientLock {QMutex::Recursive}
mutableprivate

◆ m_clients

QList<NetworkControlClient*> NetworkControl::m_clients
private

◆ m_networkControlCommands

QList<NetworkCommand*> NetworkControl::m_networkControlCommands
private

Definition at line 146 of file networkcontrol.h.

Referenced by receiveCommand(), and run().

◆ m_ncLock

QMutex NetworkControl::m_ncLock
private

Definition at line 147 of file networkcontrol.h.

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

◆ m_ncCond

QWaitCondition NetworkControl::m_ncCond
private

Definition at line 148 of file networkcontrol.h.

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

◆ m_networkControlReplies

QList<NetworkCommand*> NetworkControl::m_networkControlReplies
private

◆ m_nrLock

QMutex NetworkControl::m_nrLock
private

◆ m_commandThread

MThread* NetworkControl::m_commandThread {nullptr}
private

Definition at line 153 of file networkcontrol.h.

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

◆ m_stopCommandThread

bool NetworkControl::m_stopCommandThread {false}
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: