MythTV master
v2videoSourceList.h
Go to the documentation of this file.
1#ifndef V2VIDEOSOURCELIST_H_
2#define V2VIDEOSOURCELIST_H_
3
4#include <QVariantList>
5#include <QDateTime>
6
8
9#include "v2videoSource.h"
10
11
12class V2VideoSourceList : public QObject
13{
14 Q_OBJECT
15 Q_CLASSINFO( "Version", "1.0" );
16
17 Q_CLASSINFO( "VideoSources", "type=V2VideoSource");
18 Q_CLASSINFO( "AsOf" , "transient=true" );
19
20
21 SERVICE_PROPERTY2( QDateTime , AsOf )
22 SERVICE_PROPERTY2( QString , Version )
23 SERVICE_PROPERTY2( QString , ProtoVer )
24 SERVICE_PROPERTY2( QVariantList, VideoSources )
25
26 public:
27
28 Q_INVOKABLE V2VideoSourceList(QObject *parent = nullptr)
29 : QObject( parent )
30 {
31 }
32
33 void Copy( const V2VideoSourceList *src )
34 {
35 m_AsOf = src->m_AsOf ;
36 m_Version = src->m_Version ;
37 m_ProtoVer = src->m_ProtoVer ;
38
39 CopyListContents< V2VideoSource >( this, m_VideoSources, src->m_VideoSources );
40 }
41
43 {
44 // We must make sure the object added to the QVariantList has
45 // a parent of 'this'
46
47 auto *pObject = new V2VideoSource( this );
48 m_VideoSources.append( QVariant::fromValue<QObject *>( pObject ));
49
50 return pObject;
51 }
52
53 private:
55};
56
58
59#endif
V2VideoSource * AddNewVideoSource()
Q_CLASSINFO("VideoSources", "type=V2VideoSource")
Q_CLASSINFO("AsOf", "transient=true")
void Copy(const V2VideoSourceList *src)
Q_CLASSINFO("Version", "1.0")
Q_INVOKABLE V2VideoSourceList(QObject *parent=nullptr)
Q_DISABLE_COPY(V2VideoSourceList)
Q_DECLARE_METATYPE(std::chrono::seconds)
#define SERVICE_PROPERTY2(Type, Name)