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

#include <zmclient.h>

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

Public Member Functions

 ~ZMClient () override
 
void customEvent (QEvent *event) override
 
bool connectToHost (const QString &hostname, unsigned int port)
 
bool connected (void) const
 
bool checkProtoVersion (void)
 
void shutdown ()
 
void getServerStatus (QString &status, QString &cpuStat, QString &diskStat)
 
void updateMonitorStatus (void)
 
void getEventList (const QString &monitorName, bool oldestFirst, const QString &date, bool includeContinuous, std::vector< Event * > *eventList)
 
void getEventFrame (Event *event, int frameNo, MythImage **image)
 
void getAnalyseFrame (Event *event, int frameNo, QImage &image)
 
int getLiveFrame (int monitorID, QString &status, FrameData &buffer)
 
void getFrameList (int eventID, std::vector< Frame * > *frameList)
 
void deleteEvent (int eventID)
 
void deleteEventList (std::vector< Event * > *eventList)
 
int getMonitorCount (void)
 
MonitorgetMonitorAt (int pos)
 
MonitorgetMonitorByID (int monID)
 
void getCameraList (QStringList &cameraList)
 
void getEventDates (const QString &monitorName, bool oldestFirst, QStringList &dateList)
 
void setMonitorFunction (int monitorID, const QString &function, bool enabled)
 
bool updateAlarmStates (void)
 
bool isMiniPlayerEnabled (void) const
 
void setIsMiniPlayerEnabled (bool enabled)
 
void saveNotificationMonitors (void)
 
void showMiniPlayer (int monitorID) const
 

Static Public Member Functions

static ZMClientget (void)
 
static bool setupZMClient (void)
 

Protected Member Functions

 ZMClient ()
 

Static Protected Attributes

static ZMClientm_zmclient = nullptr
 

Private Slots

void restartConnection (void)
 

Private Member Functions

void doGetMonitorList (void)
 
bool readData (unsigned char *data, int dataSize)
 
bool sendReceiveStringList (QStringList &strList)
 

Private Attributes

QRecursiveMutex m_listLock
 
QRecursiveMutex m_commandLock
 
QList< Monitor * > m_monitorList
 
QMap< int, Monitor * > m_monitorMap
 
MythSocketm_socket {nullptr}
 
QRecursiveMutex m_socketLock
 
QString m_hostname {"localhost"}
 
uint m_port {6548}
 
bool m_bConnected {false}
 
QTimer * m_retryTimer {nullptr}
 
bool m_zmclientReady {false}
 
bool m_isMiniPlayerEnabled {true}
 

Detailed Description

Definition at line 19 of file zmclient.h.

Constructor & Destructor Documentation

◆ ZMClient()

ZMClient::ZMClient ( )
protected

Definition at line 25 of file zmclient.cpp.

Referenced by get().

◆ ~ZMClient()

ZMClient::~ZMClient ( )
override

Definition at line 240 of file zmclient.cpp.

Member Function Documentation

◆ get()

ZMClient * ZMClient::get ( void  )
static

◆ setupZMClient()

bool ZMClient::setupZMClient ( void  )
static

Definition at line 44 of file zmclient.cpp.

Referenced by checkConnection().

◆ customEvent()

void ZMClient::customEvent ( QEvent *  event)
override

Definition at line 962 of file zmclient.cpp.

◆ connectToHost()

bool ZMClient::connectToHost ( const QString &  hostname,
unsigned int  port 
)

Definition at line 61 of file zmclient.cpp.

Referenced by restartConnection(), sendReceiveStringList(), and setupZMClient().

◆ connected()

bool ZMClient::connected ( void  ) const
inline

Definition at line 38 of file zmclient.h.

◆ checkProtoVersion()

bool ZMClient::checkProtoVersion ( void  )

Definition at line 179 of file zmclient.cpp.

Referenced by connectToHost().

◆ shutdown()

void ZMClient::shutdown ( )

Definition at line 229 of file zmclient.cpp.

◆ getServerStatus()

void ZMClient::getServerStatus ( QString &  status,
QString &  cpuStat,
QString &  diskStat 
)

Definition at line 256 of file zmclient.cpp.

Referenced by ZMConsole::getDaemonStatus().

◆ updateMonitorStatus()

void ZMClient::updateMonitorStatus ( void  )

Definition at line 276 of file zmclient.cpp.

Referenced by ZMConsole::updateMonitorList().

◆ getEventList()

void ZMClient::getEventList ( const QString &  monitorName,
bool  oldestFirst,
const QString &  date,
bool  includeContinuous,
std::vector< Event * > *  eventList 
)

Definition at line 398 of file zmclient.cpp.

◆ getEventFrame()

void ZMClient::getEventFrame ( Event event,
int  frameNo,
MythImage **  image 
)

Definition at line 639 of file zmclient.cpp.

◆ getAnalyseFrame()

void ZMClient::getAnalyseFrame ( Event event,
int  frameNo,
QImage &  image 
)

Definition at line 690 of file zmclient.cpp.

◆ getLiveFrame()

int ZMClient::getLiveFrame ( int  monitorID,
QString &  status,
FrameData buffer 
)

Definition at line 737 of file zmclient.cpp.

Referenced by ZMLivePlayer::updateFrame().

◆ getFrameList()

void ZMClient::getFrameList ( int  eventID,
std::vector< Frame * > *  frameList 
)

Definition at line 499 of file zmclient.cpp.

◆ deleteEvent()

void ZMClient::deleteEvent ( int  eventID)

Definition at line 545 of file zmclient.cpp.

◆ deleteEventList()

void ZMClient::deleteEventList ( std::vector< Event * > *  eventList)

Definition at line 554 of file zmclient.cpp.

◆ getMonitorCount()

int ZMClient::getMonitorCount ( void  )

◆ getMonitorAt()

Monitor * ZMClient::getMonitorAt ( int  pos)

◆ getMonitorByID()

Monitor * ZMClient::getMonitorByID ( int  monID)

◆ getCameraList()

void ZMClient::getCameraList ( QStringList &  cameraList)

Definition at line 795 of file zmclient.cpp.

◆ getEventDates()

void ZMClient::getEventDates ( const QString &  monitorName,
bool  oldestFirst,
QStringList &  dateList 
)

Definition at line 453 of file zmclient.cpp.

◆ setMonitorFunction()

void ZMClient::setMonitorFunction ( int  monitorID,
const QString &  function,
bool  enabled 
)

Definition at line 930 of file zmclient.cpp.

Referenced by FunctionDialog::setMonitorFunction().

◆ updateAlarmStates()

bool ZMClient::updateAlarmStates ( void  )

Definition at line 347 of file zmclient.cpp.

◆ isMiniPlayerEnabled()

bool ZMClient::isMiniPlayerEnabled ( void  ) const
inline

Definition at line 67 of file zmclient.h.

Referenced by showMiniPlayer().

◆ setIsMiniPlayerEnabled()

void ZMClient::setIsMiniPlayerEnabled ( bool  enabled)
inline

Definition at line 68 of file zmclient.h.

Referenced by ZMLivePlayer::ZMLivePlayer(), and ZMLivePlayer::~ZMLivePlayer().

◆ saveNotificationMonitors()

void ZMClient::saveNotificationMonitors ( void  )

Definition at line 943 of file zmclient.cpp.

Referenced by FunctionDialog::setMonitorFunction().

◆ showMiniPlayer()

void ZMClient::showMiniPlayer ( int  monitorID) const

Definition at line 985 of file zmclient.cpp.

Referenced by customEvent().

◆ restartConnection

void ZMClient::restartConnection ( void  )
privateslot

Definition at line 219 of file zmclient.cpp.

Referenced by ZMClient().

◆ doGetMonitorList()

void ZMClient::doGetMonitorList ( void  )
private

Definition at line 863 of file zmclient.cpp.

Referenced by connectToHost().

◆ readData()

bool ZMClient::readData ( unsigned char *  data,
int  dataSize 
)
private

Definition at line 582 of file zmclient.cpp.

Referenced by getAnalyseFrame(), getEventFrame(), and getLiveFrame().

◆ sendReceiveStringList()

bool ZMClient::sendReceiveStringList ( QStringList &  strList)
private

Member Data Documentation

◆ m_zmclient

ZMClient * ZMClient::m_zmclient = nullptr
staticprotected

Definition at line 26 of file zmclient.h.

Referenced by get(), and ~ZMClient().

◆ m_listLock

QRecursiveMutex ZMClient::m_listLock
private

◆ m_commandLock

QRecursiveMutex ZMClient::m_commandLock
private

◆ m_monitorList

QList<Monitor*> ZMClient::m_monitorList
private

◆ m_monitorMap

QMap<int, Monitor*> ZMClient::m_monitorMap
private

◆ m_socket

MythSocket* ZMClient::m_socket {nullptr}
private

Definition at line 91 of file zmclient.h.

Referenced by connectToHost(), readData(), sendReceiveStringList(), shutdown(), and ~ZMClient().

◆ m_socketLock

QRecursiveMutex ZMClient::m_socketLock
private

Definition at line 95 of file zmclient.h.

Referenced by connectToHost(), and shutdown().

◆ m_hostname

QString ZMClient::m_hostname {"localhost"}
private

Definition at line 97 of file zmclient.h.

Referenced by connectToHost(), restartConnection(), and sendReceiveStringList().

◆ m_port

uint ZMClient::m_port {6548}
private

Definition at line 98 of file zmclient.h.

Referenced by connectToHost(), restartConnection(), and sendReceiveStringList().

◆ m_bConnected

bool ZMClient::m_bConnected {false}
private

Definition at line 99 of file zmclient.h.

Referenced by connectToHost(), restartConnection(), sendReceiveStringList(), and shutdown().

◆ m_retryTimer

QTimer* ZMClient::m_retryTimer {nullptr}
private

Definition at line 100 of file zmclient.h.

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

◆ m_zmclientReady

bool ZMClient::m_zmclientReady {false}
private

Definition at line 101 of file zmclient.h.

Referenced by connectToHost(), restartConnection(), shutdown(), and ~ZMClient().

◆ m_isMiniPlayerEnabled

bool ZMClient::m_isMiniPlayerEnabled {true}
private

Definition at line 102 of file zmclient.h.


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