MythTV  master
liveStreamInfo.h
Go to the documentation of this file.
1 #ifndef LIVESTREAMINFO_H_
2 #define LIVESTREAMINFO_H_
3 
4 #include <QDateTime>
5 #include <QString>
6 
7 #include "serviceexp.h"
8 #include "datacontracthelper.h"
9 
10 namespace DTC
11 {
12 
14 
15 class SERVICE_PUBLIC LiveStreamInfo : public QObject
16 {
17  Q_OBJECT
18  Q_CLASSINFO( "version" , "1.0" );
19 
20  Q_PROPERTY( int Id READ Id WRITE setId )
21  Q_PROPERTY( int Width READ Width WRITE setWidth )
22  Q_PROPERTY( int Height READ Height WRITE setHeight )
23  Q_PROPERTY( int Bitrate READ Bitrate WRITE setBitrate )
24  Q_PROPERTY( int AudioBitrate READ AudioBitrate WRITE setAudioBitrate )
25  Q_PROPERTY( int SegmentSize READ SegmentSize WRITE setSegmentSize )
26  Q_PROPERTY( int MaxSegments READ MaxSegments WRITE setMaxSegments )
27  Q_PROPERTY( int StartSegment READ StartSegment WRITE setStartSegment )
28  Q_PROPERTY( int CurrentSegment READ CurrentSegment WRITE setCurrentSegment )
29  Q_PROPERTY( int SegmentCount READ SegmentCount WRITE setSegmentCount )
30  Q_PROPERTY( int PercentComplete READ PercentComplete WRITE setPercentComplete )
31  Q_PROPERTY( QDateTime Created READ Created WRITE setCreated )
32  Q_PROPERTY( QDateTime LastModified READ LastModified WRITE setLastModified )
33  Q_PROPERTY( QString RelativeURL READ RelativeURL WRITE setRelativeURL )
34  Q_PROPERTY( QString FullURL READ FullURL WRITE setFullURL )
35  Q_PROPERTY( QString StatusStr READ StatusStr WRITE setStatusStr )
36  Q_PROPERTY( int StatusInt READ StatusInt WRITE setStatusInt )
37  Q_PROPERTY( QString StatusMessage READ StatusMessage WRITE setStatusMessage )
38  Q_PROPERTY( QString SourceFile READ SourceFile WRITE setSourceFile )
39  Q_PROPERTY( QString SourceHost READ SourceHost WRITE setSourceHost )
40  Q_PROPERTY( int SourceWidth READ SourceWidth WRITE setSourceWidth )
41  Q_PROPERTY( int SourceHeight READ SourceHeight WRITE setSourceHeight )
42  Q_PROPERTY( int AudioOnlyBitrate READ AudioOnlyBitrate WRITE setAudioOnlyBitrate )
43 
44  PROPERTYIMP ( int , Id )
45  PROPERTYIMP ( int , Width )
46  PROPERTYIMP ( int , Height )
47  PROPERTYIMP ( int , Bitrate )
48  PROPERTYIMP ( int , AudioBitrate )
49  PROPERTYIMP ( int , SegmentSize )
50  PROPERTYIMP ( int , MaxSegments )
51  PROPERTYIMP ( int , StartSegment )
52  PROPERTYIMP ( int , CurrentSegment )
53  PROPERTYIMP ( int , SegmentCount )
54  PROPERTYIMP ( int , PercentComplete )
55  PROPERTYIMP ( QDateTime , Created )
56  PROPERTYIMP ( QDateTime , LastModified )
57  PROPERTYIMP ( QString , RelativeURL )
58  PROPERTYIMP ( QString , FullURL )
59  PROPERTYIMP ( QString , StatusStr )
60  PROPERTYIMP ( int , StatusInt )
61  PROPERTYIMP ( QString , StatusMessage )
62  PROPERTYIMP ( QString , SourceFile )
63  PROPERTYIMP ( QString , SourceHost )
64  PROPERTYIMP ( int , SourceWidth )
65  PROPERTYIMP ( int , SourceHeight )
66  PROPERTYIMP ( int , AudioOnlyBitrate );
67 
68  public:
69 
70  static inline void InitializeCustomTypes();
71 
72  Q_INVOKABLE explicit LiveStreamInfo(QObject *parent = nullptr)
73  : QObject ( parent ),
74  m_Id ( 0 ),
75  m_Width ( 0 ),
76  m_Height ( 0 ),
77  m_Bitrate ( 0 ),
78  m_AudioBitrate ( 0 ),
79  m_SegmentSize ( 0 ),
80  m_MaxSegments ( 0 ),
81  m_StartSegment ( 0 ),
82  m_CurrentSegment ( 0 ),
83  m_SegmentCount ( 0 ),
84  m_PercentComplete ( 0 ),
85  m_StatusInt ( 0 ),
86  m_SourceWidth ( 0 ),
87  m_SourceHeight ( 0 ),
88  m_AudioOnlyBitrate ( 0 )
89  {
90  }
91 
92  void Copy( const LiveStreamInfo *src )
93  {
94  m_Id = src->m_Id ;
95  m_Width = src->m_Width ;
96  m_Height = src->m_Height ;
97  m_Bitrate = src->m_Bitrate ;
98  m_AudioBitrate = src->m_AudioBitrate ;
99  m_SegmentSize = src->m_SegmentSize ;
100  m_MaxSegments = src->m_MaxSegments ;
101  m_StartSegment = src->m_StartSegment ;
102  m_CurrentSegment = src->m_CurrentSegment ;
103  m_SegmentCount = src->m_SegmentCount ;
104  m_PercentComplete = src->m_PercentComplete ;
105  m_Created = src->m_Created ;
106  m_LastModified = src->m_LastModified ;
107  m_RelativeURL = src->m_RelativeURL ;
108  m_FullURL = src->m_FullURL ;
109  m_StatusStr = src->m_StatusStr ;
110  m_StatusInt = src->m_StatusInt ;
111  m_StatusMessage = src->m_StatusMessage ;
112  m_SourceFile = src->m_SourceFile ;
113  m_SourceHost = src->m_SourceHost ;
114  m_SourceWidth = src->m_SourceWidth ;
115  m_SourceHeight = src->m_SourceHeight ;
116  m_AudioOnlyBitrate = src->m_AudioOnlyBitrate ;
117  }
118 
119  private:
120  Q_DISABLE_COPY(LiveStreamInfo);
121 };
122 
124 {
125  qRegisterMetaType< LiveStreamInfo* >();
126 }
127 
128 } // namespace DTC
129 
130 #endif
#define PROPERTYIMP(type, name)
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
void Copy(const LiveStreamInfo *src)
static void InitializeCustomTypes()