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 <mythplugins/mythzoneminder/mythzoneminder/zmclient.h>

Inheritance diagram for ZMClient:
[legend]
Collaboration diagram for ZMClient:
[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 239 of file zmclient.cpp.

Member Function Documentation

◆ checkProtoVersion()

bool ZMClient::checkProtoVersion ( void  )

Definition at line 178 of file zmclient.cpp.

Referenced by connectToHost().

◆ connected()

bool ZMClient::connected ( void  ) const
inline

Definition at line 38 of file zmclient.h.

◆ connectToHost()

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

Definition at line 61 of file zmclient.cpp.

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

◆ customEvent()

void ZMClient::customEvent ( QEvent *  event)
override

Definition at line 971 of file zmclient.cpp.

◆ deleteEvent()

void ZMClient::deleteEvent ( int  eventID)

Definition at line 544 of file zmclient.cpp.

◆ deleteEventList()

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

Definition at line 553 of file zmclient.cpp.

◆ doGetMonitorList()

void ZMClient::doGetMonitorList ( void  )
private

Definition at line 872 of file zmclient.cpp.

Referenced by connectToHost().

◆ get()

ZMClient * ZMClient::get ( void  )
static

◆ getAnalyseFrame()

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

Definition at line 694 of file zmclient.cpp.

◆ getCameraList()

void ZMClient::getCameraList ( QStringList &  cameraList)

Definition at line 804 of file zmclient.cpp.

◆ getEventDates()

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

Definition at line 452 of file zmclient.cpp.

◆ getEventFrame()

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

Definition at line 638 of file zmclient.cpp.

◆ getEventList()

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

Definition at line 397 of file zmclient.cpp.

◆ getFrameList()

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

Definition at line 498 of file zmclient.cpp.

◆ getLiveFrame()

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

Definition at line 746 of file zmclient.cpp.

Referenced by ZMLivePlayer::updateFrame().

◆ getMonitorAt()

Monitor * ZMClient::getMonitorAt ( int  pos)

◆ getMonitorByID()

Monitor * ZMClient::getMonitorByID ( int  monID)

◆ getMonitorCount()

int ZMClient::getMonitorCount ( void  )

◆ getServerStatus()

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

Definition at line 255 of file zmclient.cpp.

Referenced by ZMConsole::getDaemonStatus().

◆ isMiniPlayerEnabled()

bool ZMClient::isMiniPlayerEnabled ( void  ) const
inline

Definition at line 67 of file zmclient.h.

Referenced by showMiniPlayer().

◆ readData()

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

Definition at line 581 of file zmclient.cpp.

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

◆ restartConnection

void ZMClient::restartConnection ( void  )
privateslot

Definition at line 218 of file zmclient.cpp.

Referenced by ZMClient().

◆ saveNotificationMonitors()

void ZMClient::saveNotificationMonitors ( void  )

Definition at line 952 of file zmclient.cpp.

Referenced by FunctionDialog::setMonitorFunction().

◆ sendReceiveStringList()

bool ZMClient::sendReceiveStringList ( QStringList &  strList)
private

◆ setIsMiniPlayerEnabled()

void ZMClient::setIsMiniPlayerEnabled ( bool  enabled)
inline

Definition at line 68 of file zmclient.h.

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

◆ setMonitorFunction()

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

Definition at line 939 of file zmclient.cpp.

Referenced by FunctionDialog::setMonitorFunction().

◆ setupZMClient()

bool ZMClient::setupZMClient ( void  )
static

Definition at line 44 of file zmclient.cpp.

Referenced by checkConnection().

◆ showMiniPlayer()

void ZMClient::showMiniPlayer ( int  monitorID) const

Definition at line 994 of file zmclient.cpp.

Referenced by customEvent().

◆ shutdown()

void ZMClient::shutdown ( )

Definition at line 228 of file zmclient.cpp.

◆ updateAlarmStates()

bool ZMClient::updateAlarmStates ( void  )

Definition at line 346 of file zmclient.cpp.

◆ updateMonitorStatus()

void ZMClient::updateMonitorStatus ( void  )

Definition at line 275 of file zmclient.cpp.

Referenced by ZMConsole::updateMonitorList().

Member Data Documentation

◆ m_bConnected

bool ZMClient::m_bConnected {false}
private

Definition at line 90 of file zmclient.h.

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

◆ m_commandLock

QRecursiveMutex ZMClient::m_commandLock
private

◆ m_hostname

QString ZMClient::m_hostname {"localhost"}
private

Definition at line 88 of file zmclient.h.

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

◆ m_isMiniPlayerEnabled

bool ZMClient::m_isMiniPlayerEnabled {true}
private

Definition at line 93 of file zmclient.h.

◆ m_listLock

QRecursiveMutex ZMClient::m_listLock
private

◆ m_monitorList

QList<Monitor*> ZMClient::m_monitorList
private

◆ m_monitorMap

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

◆ m_port

uint ZMClient::m_port {6548}
private

Definition at line 89 of file zmclient.h.

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

◆ m_retryTimer

QTimer* ZMClient::m_retryTimer {nullptr}
private

Definition at line 91 of file zmclient.h.

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

◆ m_socket

MythSocket* ZMClient::m_socket {nullptr}
private

Definition at line 86 of file zmclient.h.

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

◆ m_socketLock

QRecursiveMutex ZMClient::m_socketLock
private

Definition at line 87 of file zmclient.h.

Referenced by connectToHost(), and shutdown().

◆ m_zmclient

ZMClient * ZMClient::m_zmclient = nullptr
staticprotected

Definition at line 26 of file zmclient.h.

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

◆ m_zmclientReady

bool ZMClient::m_zmclientReady {false}
private

Definition at line 92 of file zmclient.h.

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


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