MythTV master
v2encoderList.h
Go to the documentation of this file.
1
2// Program Name: encoderList.h
3// Created : Jan. 15, 2010
4//
5// Copyright (c) 2010 David Blain <dblain@mythtv.org>
6//
7// Licensed under the GPL v2 or later, see COPYING for details
8//
10
11#ifndef V2ENCODERLIST_H_
12#define V2ENCODERLIST_H_
13
14#include <QVariantList>
15
17
18#include "v2encoder.h"
19
20class V2EncoderList : public QObject
21{
22 Q_OBJECT
23 Q_CLASSINFO( "Version", "1.0" );
24
25 // Q_CLASSINFO Used to augment Metadata for properties.
26 // See datacontracthelper.h for details
27
28 Q_CLASSINFO( "Encoders", "type=V2Encoder");
29
30 SERVICE_PROPERTY2( QVariantList, Encoders );
31
32 public:
33
34 Q_INVOKABLE V2EncoderList(QObject *parent = nullptr)
35 : QObject( parent )
36 {
37 }
38
39 void Copy( const V2EncoderList *src )
40 {
41 CopyListContents< V2Encoder >( this, m_Encoders, src->m_Encoders );
42 }
43 // This is needed so that common routines can get a non-const m_Encoders
44 // reference
45 QVariantList& GetEncoders() {return m_Encoders;}
47 {
48 // We must make sure the object added to the QVariantList has
49 // a parent of 'this'
50
51 auto *pObject = new V2Encoder( this );
52 m_Encoders.append( QVariant::fromValue<QObject *>( pObject ));
53
54 return pObject;
55 }
56
57 private:
59};
60
62
63#endif
QVariantList & GetEncoders()
Definition: v2encoderList.h:45
V2Encoder * AddNewEncoder()
Definition: v2encoderList.h:46
Q_CLASSINFO("Encoders", "type=V2Encoder")
Q_DISABLE_COPY(V2EncoderList)
void Copy(const V2EncoderList *src)
Definition: v2encoderList.h:39
Q_CLASSINFO("Version", "1.0")
SERVICE_PROPERTY2(QVariantList, Encoders)
Q_INVOKABLE V2EncoderList(QObject *parent=nullptr)
Definition: v2encoderList.h:34
Q_DECLARE_METATYPE(std::chrono::seconds)
std::vector< uint32_t > Encoders