MythTV master
v2videoStreamInfoList.h
Go to the documentation of this file.
1
2// 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
20class 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
V2VideoStreamInfo * AddNewVideoStreamInfo()
void Copy(const V2VideoStreamInfoList *src)
Q_CLASSINFO("VideoStreamInfos", "type=V2VideoStreamInfo")
Q_CLASSINFO("AsOf", "transient=true")
SERVICE_PROPERTY2(QVariantList, VideoStreamInfos)
Q_DISABLE_COPY(V2VideoStreamInfoList)
Q_CLASSINFO("Version", "1.00")
Q_DECLARE_METATYPE(std::chrono::seconds)