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) const
 
int maxPendingConnections (void) const
 
void setMaxPendingConnections (int n)
 
quint16 serverPort (void) const
 
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 newControlConnection (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, const 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
 
QRecursiveMutex m_clientLock
 
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 (qintptr socket)
 

Detailed Description

Definition at line 95 of file networkcontrol.h.

Constructor & Destructor Documentation

◆ NetworkControl()

NetworkControl::NetworkControl ( )

Definition at line 83 of file networkcontrol.cpp.

◆ ~NetworkControl()

NetworkControl::~NetworkControl ( )
override

Definition at line 250 of file networkcontrol.cpp.

Member Function Documentation

◆ newControlConnection

void NetworkControl::newControlConnection ( QTcpSocket *  client)
privateslot

Definition at line 377 of file networkcontrol.cpp.

Referenced by NetworkControl().

◆ receiveCommand

void NetworkControl::receiveCommand ( QString &  command)
privateslot

Definition at line 450 of file networkcontrol.cpp.

Referenced by newControlConnection().

◆ deleteClient [1/2]

void NetworkControl::deleteClient ( void  )
privateslot

Definition at line 346 of file networkcontrol.cpp.

Referenced by customEvent(), and newControlConnection().

◆ run()

void NetworkControl::run ( void  )
overrideprotected

Definition at line 281 of file networkcontrol.cpp.

◆ processJump()

QString NetworkControl::processJump ( NetworkCommand nc)
private

Definition at line 464 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processKey()

QString NetworkControl::processKey ( NetworkCommand nc)
private

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

Referenced by processNetworkControlCommand().

◆ processQuery()

QString NetworkControl::processQuery ( NetworkCommand nc)
private

Definition at line 947 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processSet()

QString NetworkControl::processSet ( NetworkCommand nc)
staticprivate

Definition at line 1103 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processMessage()

QString NetworkControl::processMessage ( NetworkCommand nc)
staticprivate

Definition at line 1536 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processNotification()

QString NetworkControl::processNotification ( NetworkCommand nc)
staticprivate

Definition at line 1549 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processTheme()

QString NetworkControl::processTheme ( NetworkCommand nc)
private

Definition at line 1188 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ processHelp()

QString NetworkControl::processHelp ( NetworkCommand nc)
private

Definition at line 1351 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand().

◆ notifyDataAvailable()

void NetworkControl::notifyDataAvailable ( void  )
private

◆ sendReplyToClient()

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

Definition at line 1567 of file networkcontrol.cpp.

Referenced by customEvent().

◆ customEvent()

void NetworkControl::customEvent ( QEvent *  e)
overrideprivate

Definition at line 1596 of file networkcontrol.cpp.

◆ listRecordings()

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

Definition at line 1737 of file networkcontrol.cpp.

Referenced by processQuery().

◆ listSchedule()

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

Definition at line 1683 of file networkcontrol.cpp.

Referenced by processQuery().

◆ listChannels()

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

Definition at line 1792 of file networkcontrol.cpp.

Referenced by processQuery().

◆ saveScreenshot()

QString NetworkControl::saveScreenshot ( NetworkCommand nc)
staticprivate

Definition at line 1843 of file networkcontrol.cpp.

Referenced by processNetworkControlCommand(), and processPlay().

◆ processNetworkControlCommand()

void NetworkControl::processNetworkControlCommand ( NetworkCommand nc)
private

Definition at line 301 of file networkcontrol.cpp.

Referenced by run().

◆ deleteClient() [2/2]

void NetworkControl::deleteClient ( NetworkControlClient ncc)
private

Definition at line 363 of file networkcontrol.cpp.

◆ getWidgetType()

QString NetworkControl::getWidgetType ( MythUIType type)
staticprivate

Definition at line 1144 of file networkcontrol.cpp.

Referenced by processTheme().

Member Data Documentation

◆ m_prompt

QString NetworkControl::m_prompt {"# "}
private

Definition at line 138 of file networkcontrol.h.

Referenced by sendReplyToClient().

◆ m_gotAnswer

bool NetworkControl::m_gotAnswer {false}
private

Definition at line 139 of file networkcontrol.h.

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

◆ m_answer

QString NetworkControl::m_answer {""}
private

Definition at line 140 of file networkcontrol.h.

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

◆ m_jumpMap

QMap<QString, QString> NetworkControl::m_jumpMap
private

Definition at line 141 of file networkcontrol.h.

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

◆ m_keyMap

QMap<QString, int> NetworkControl::m_keyMap
private

Definition at line 142 of file networkcontrol.h.

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

◆ m_keyTextMap

QMap<int, QString> NetworkControl::m_keyTextMap
private

Definition at line 143 of file networkcontrol.h.

Referenced by NetworkControl(), and processKey().

◆ m_clientLock

QRecursiveMutex NetworkControl::m_clientLock
mutableprivate

◆ m_clients

QList<NetworkControlClient*> NetworkControl::m_clients
private

◆ m_networkControlCommands

QList<NetworkCommand*> NetworkControl::m_networkControlCommands
private

Definition at line 148 of file networkcontrol.h.

Referenced by receiveCommand(), and run().

◆ m_ncLock

QMutex NetworkControl::m_ncLock
private

Definition at line 149 of file networkcontrol.h.

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

◆ m_ncCond

QWaitCondition NetworkControl::m_ncCond
private

Definition at line 150 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 155 of file networkcontrol.h.

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

◆ m_stopCommandThread

bool NetworkControl::m_stopCommandThread {false}
private

Definition at line 156 of file networkcontrol.h.

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


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