MythTV master
v2encoder.h
Go to the documentation of this file.
1
2// Program Name: encoder.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 V2ENCODER_H_
12#define V2ENCODER_H_
13
14#include <QString>
15
17
18#include "v2input.h"
19#include "v2programAndChannel.h"
20
22
23class V2Encoder : public QObject
24{
25 Q_OBJECT
26 Q_CLASSINFO( "Version" , "1.0" );
27
28 Q_CLASSINFO( "Inputs", "type=V2Input");
29
30 SERVICE_PROPERTY2( int , Id )
31 SERVICE_PROPERTY2( QString , HostName )
32 SERVICE_PROPERTY2( bool , Local )
33 SERVICE_PROPERTY2( bool , Connected )
36 SERVICE_PROPERTY2( bool , LowOnFreeSpace )
37 Q_PROPERTY( QObject* Recording READ Recording USER true )
39 SERVICE_PROPERTY2( QVariantList, Inputs )
40
41 public:
42
43 Q_INVOKABLE V2Encoder(QObject *parent = nullptr)
44 : QObject ( parent ),
45 m_Local ( true )
46 {
47 }
48
49 void Copy( const V2Encoder *src )
50 {
51 m_Id = src->m_Id ;
52 m_HostName = src->m_HostName ;
53 m_Local = src->m_Local ;
54 m_Connected = src->m_Connected ;
55 m_State = src->m_State ;
56 m_SleepStatus = src->m_SleepStatus ;
57 m_LowOnFreeSpace= src->m_LowOnFreeSpace;
58 m_Recording = nullptr ;
59
60 if ( src->m_Recording != nullptr)
61 Recording()->Copy( src->m_Recording );
62
63 CopyListContents< V2Input >( this, m_Inputs, src->m_Inputs );
64 }
65
67 {
68 // We must make sure the object added to the QVariantList has
69 // a parent of 'this'
70
71 auto *pObject = new V2Input( this );
72 m_Inputs.append( QVariant::fromValue<QObject *>( pObject ));
73
74 return pObject;
75 }
76
77 private:
79};
80
82
83#endif
Q_DISABLE_COPY(V2Encoder)
Q_CLASSINFO("Inputs", "type=V2Input")
void Copy(const V2Encoder *src)
Definition: v2encoder.h:49
Q_INVOKABLE V2Encoder(QObject *parent=nullptr)
Definition: v2encoder.h:43
Q_CLASSINFO("Version", "1.0")
QObject * Recording
Definition: v2encoder.h:37
V2Input * AddNewInput()
Definition: v2encoder.h:66
Q_DECLARE_METATYPE(std::chrono::seconds)
#define SERVICE_PROPERTY2(Type, Name)
#define SERVICE_PROPERTY_PTR(type, name)
SleepStatus
SleepStatus is an enumeration of the awake/sleep status of a slave.
Definition: tv.h:100
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:95
State
Definition: zmserver.h:69