MythTV  master
v2videoStreamInfoList.h
Go to the documentation of this file.
1 // Program Name: videoStreamInfoList.h
3 // Created : May. 30, 2020
4 //
5 // Copyright (c) 2011 Peter Bennett <pbennett@mythtv.org>
6 //
7 // Licensed under the GPL v2 or later, see COPYING for details
8 //
10 
11 #ifndef V2VIDEOSTREAMINFOLIST_H_
12 #define V2VIDEOSTREAMINFOLIST_H_
13 
14 #include <QVariantList>
15 
17 
18 #include "v2videoStreamInfo.h"
19 
20 class V2VideoStreamInfoList : public QObject
21 {
22  Q_OBJECT
23  Q_CLASSINFO( "Version", "1.00" );
24 
25  // Q_CLASSINFO Used to augment Metadata for properties.
26 
27  Q_CLASSINFO( "VideoStreamInfos", "type=V2VideoStreamInfo");
28  Q_CLASSINFO( "AsOf" , "transient=true" );
29 
30  SERVICE_PROPERTY2( int , Count )
31  SERVICE_PROPERTY2( QDateTime , AsOf )
32  SERVICE_PROPERTY2( QString , Version )
33  SERVICE_PROPERTY2( QString , ProtoVer )
34  SERVICE_PROPERTY2( int , ErrorCode )
35  SERVICE_PROPERTY2( QString , ErrorMsg )
36 
37  SERVICE_PROPERTY2( QVariantList, VideoStreamInfos );
38 
39  public:
40 
41  Q_INVOKABLE V2VideoStreamInfoList(QObject *parent = nullptr)
42  : QObject( parent )
43  {
44  }
45 
46  void Copy( const V2VideoStreamInfoList *src )
47  {
48  m_Count = src->m_Count ;
49  m_AsOf = src->m_AsOf ;
50  m_Version = src->m_Version ;
51  m_ProtoVer = src->m_ProtoVer ;
52  m_ErrorCode = src->m_ErrorCode ;
53  m_ErrorMsg = src->m_ErrorMsg ;
54 
55  CopyListContents< V2VideoStreamInfo >( this, m_VideoStreamInfos, src->m_VideoStreamInfos );
56  }
57 
59  {
60  // We must make sure the object added to the QVariantList has
61  // a parent of 'this'
62 
63  auto *pObject = new V2VideoStreamInfo( this );
64  m_VideoStreamInfos.append( QVariant::fromValue<QObject *>( pObject ));
65 
66  return pObject;
67  }
68 
69  private:
71 };
72 
74 
75 #endif
V2VideoStreamInfoList
Definition: v2videoStreamInfoList.h:20
V2VideoStreamInfoList::Q_CLASSINFO
Q_CLASSINFO("Version", "1.00")
V2VideoStreamInfoList::AddNewVideoStreamInfo
V2VideoStreamInfo * AddNewVideoStreamInfo()
Definition: v2videoStreamInfoList.h:58
V2VideoStreamInfo
Definition: v2videoStreamInfo.h:21
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(StandardSetting *)
V2VideoStreamInfoList::SERVICE_PROPERTY2
SERVICE_PROPERTY2(QVariantList, VideoStreamInfos)
V2VideoStreamInfoList::Q_DISABLE_COPY
Q_DISABLE_COPY(V2VideoStreamInfoList)
mythhttpservice.h
v2videoStreamInfo.h
V2VideoStreamInfoList::V2VideoStreamInfoList
Q_INVOKABLE V2VideoStreamInfoList(QObject *parent=nullptr)
Definition: v2videoStreamInfoList.h:41
V2VideoStreamInfoList::Copy
void Copy(const V2VideoStreamInfoList *src)
Definition: v2videoStreamInfoList.h:46