MythTV  master
zmdefines.h
Go to the documentation of this file.
1 /* ============================================================
2  * This program is free software; you can redistribute it
3  * and/or modify it under the terms of the GNU General
4  * Public License as published bythe Free Software Foundation;
5  * either version 2, or (at your option)
6  * any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * ============================================================ */
14 
15 #ifndef ZMDEFINES_H
16 #define ZMDEFINES_H
17 
18 #include <vector>
19 
20 // qt
21 #include <QString>
22 #include <QDateTime>
23 
25 class Event
26 {
27  public:
29  const QString &eventName,
30  int monitorID,
31  const QString &monitorName,
32  const QDateTime &startTime,
33  const QString &length) :
39  m_startTime(startTime.toLocalTime())
40  {
41  }
42 
43  Event() : m_monitorID(-1), m_eventID(-1) {}
44 
45  int monitorID(void) const { return m_monitorID; }
46 
47  int eventID(void) const { return m_eventID; }
48 
49  QString eventName(void) const { return m_eventName; }
50 
51  QString monitorName(void) const { return m_monitorName; }
52 
54  QDateTime startTime(Qt::TimeSpec spec) const
55  {
60  return (Qt::LocalTime == spec) ?
61  m_startTime : m_startTime.toTimeSpec(spec);
62  }
63 
66  QDateTime startTime(void) const { return m_startTime; }
67 
68  QString length(void) const { return m_length; }
69 
70  private:
72  int m_eventID;
73  QString m_eventName;
74  QString m_monitorName;
75  QString m_length;
79  QDateTime m_startTime;
80 };
81 
82 typedef enum
83 {
89 } State;
90 
91 // event frame details
92 typedef struct
93 {
94  QString type;
95  double delta;
96 } Frame;
97 
98 class Monitor
99 {
100  public:
102  id(0), enabled(false), events(0),
103  width(0), height(0), bytes_per_pixel(0),
106  {
107  }
108 
109  public:
110  // used by console view
111  int id;
112  QString name;
113  QString type;
114  QString function;
115  bool enabled;
116  QString device;
117  QString zmcStatus;
118  QString zmaStatus;
119  int events;
120  // used by live view
121  QString status;
122  int width;
123  int height;
125  // used by the alarm notiftications
129 };
130 
132 
133 #endif
QString type
Definition: zmdefines.h:113
int height
Definition: zmdefines.h:123
int m_eventID
Definition: zmdefines.h:72
QDateTime startTime(void) const
Returns time with native Qt::TimeSpec (subject to revision).
Definition: zmdefines.h:66
QString m_length
Definition: zmdefines.h:75
QString zmaStatus
Definition: zmdefines.h:118
QString device
Definition: zmdefines.h:116
QString m_monitorName
Definition: zmdefines.h:74
Q_DECLARE_METATYPE(GrabberScript *)
bool enabled
Definition: zmdefines.h:115
State
Definition: zmserver.h:62
double delta
Definition: zmdefines.h:95
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
Definition: zmdefines.h:84
State state
Definition: zmdefines.h:127
int id
Definition: zmdefines.h:111
QString status
Definition: zmdefines.h:121
int bytes_per_pixel
Definition: zmdefines.h:124
Event(int eventID, const QString &eventName, int monitorID, const QString &monitorName, const QDateTime &startTime, const QString &length)
Definition: zmdefines.h:28
State previousState
Definition: zmdefines.h:128
int width
Definition: zmdefines.h:122
QString zmcStatus
Definition: zmdefines.h:117
int m_monitorID
Definition: zmdefines.h:71
State
Definition: zmdefines.h:82
QString eventName(void) const
Definition: zmdefines.h:49
Monitor()
Definition: zmdefines.h:101
int eventID(void) const
Definition: zmdefines.h:47
Definition: zmdefines.h:88
Event()
Definition: zmdefines.h:43
Event details.
Definition: zmdefines.h:25
QString length(void) const
Definition: zmdefines.h:68
QString type
Definition: zmdefines.h:94
QString m_eventName
Definition: zmdefines.h:73
bool showNotifications
Definition: zmdefines.h:126
int monitorID(void) const
Definition: zmdefines.h:45
QDateTime m_startTime
The start time is stored in local time interally since all uses are currently using local time and co...
Definition: zmdefines.h:79
QString name
Definition: zmdefines.h:112
int events
Definition: zmdefines.h:119
QDateTime startTime(Qt::TimeSpec spec) const
Returns time using specified Qt::TimeSpec.
Definition: zmdefines.h:54
QString monitorName(void) const
Definition: zmdefines.h:51