MythTV  master
recording.h
Go to the documentation of this file.
1 // Program Name: recording.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 LICENSE for details
8 //
10 
11 #ifndef RECORDING_H_
12 #define RECORDING_H_
13 
14 #include <QDateTime>
15 #include <QString>
16 
21 
22 namespace DTC
23 {
24 
25 class SERVICE_PUBLIC RecordingInfo : public QObject
26 {
27  Q_OBJECT
28  Q_CLASSINFO( "version", "1.3" );
29 
30  Q_PROPERTY( uint RecordedId READ RecordedId WRITE setRecordedId )
31  Q_PROPERTY( RecStatus::Type Status READ Status WRITE setStatus )
32  Q_PROPERTY( int Priority READ Priority WRITE setPriority )
33  Q_PROPERTY( QDateTime StartTs READ StartTs WRITE setStartTs )
34  Q_PROPERTY( QDateTime EndTs READ EndTs WRITE setEndTs )
35 
36  Q_PROPERTY( qlonglong FileSize READ FileSize WRITE setFileSize ) // v1.3
37  Q_PROPERTY( QString FileName READ FileName WRITE setFileName ) // v1.3
38  Q_PROPERTY( QString HostName READ HostName WRITE setHostName ) // v1.3
39  Q_PROPERTY( QDateTime LastModified READ LastModified WRITE setLastModified ) // v1.3
40 
41  Q_PROPERTY( int RecordId READ RecordId WRITE setRecordId )
42  Q_PROPERTY( QString RecGroup READ RecGroup WRITE setRecGroup )
43  Q_PROPERTY( QString PlayGroup READ PlayGroup WRITE setPlayGroup )
44  Q_PROPERTY( QString StorageGroup READ StorageGroup WRITE setStorageGroup )
45  Q_PROPERTY( int RecType READ RecType WRITE setRecType )
46  Q_PROPERTY( int DupInType READ DupInType WRITE setDupInType )
47  Q_PROPERTY( int DupMethod READ DupMethod WRITE setDupMethod )
48  Q_PROPERTY( int EncoderId READ EncoderId WRITE setEncoderId )
49  Q_PROPERTY( QString EncoderName READ EncoderName WRITE setEncoderName )
50  Q_PROPERTY( QString Profile READ Profile WRITE setProfile )
51 
52  PROPERTYIMP ( uint , RecordedId )
53  PROPERTYIMP_ENUM( RecStatus::Type , Status )
54  PROPERTYIMP ( int , Priority )
55  PROPERTYIMP_REF ( QDateTime , StartTs )
56  PROPERTYIMP_REF ( QDateTime , EndTs )
57 
58  PROPERTYIMP ( qlonglong , FileSize ) // v1.3
59  PROPERTYIMP_REF ( QString , FileName ) // v1.3
60  PROPERTYIMP_REF ( QString , HostName ) // v1.3
61  PROPERTYIMP_REF ( QDateTime , LastModified) // v1.3
62 
63  PROPERTYIMP ( int , RecordId )
64  PROPERTYIMP_REF ( QString , RecGroup )
65  PROPERTYIMP_REF ( QString , StorageGroup)
66  PROPERTYIMP_REF ( QString , PlayGroup )
67  PROPERTYIMP_ENUM( RecordingType , RecType )
70  PROPERTYIMP ( int , EncoderId )
71  PROPERTYIMP_REF ( QString , EncoderName )
72  PROPERTYIMP_REF ( QString , Profile )
73 
74  // Used only by Serializer
75  PROPERTYIMP( bool, SerializeDetails );
76 
77  public:
78 
79  static inline void InitializeCustomTypes();
80 
81  Q_INVOKABLE explicit RecordingInfo(QObject *parent = nullptr)
82  : QObject ( parent ),
83  m_RecordedId ( 0 ),
84  m_Status ( RecStatus::Unknown ),
85  m_Priority ( 0 ),
86  m_FileSize ( 0 ),
87  m_RecordId ( 0 ),
88  m_RecType ( kNotRecording ),
89  m_DupInType ( kDupsInRecorded ),
90  m_DupMethod ( kDupCheckNone ),
91  m_EncoderId ( 0 ),
92  m_SerializeDetails( true )
93  {
94  }
95 
96  void Copy( const RecordingInfo *src )
97  {
98  m_RecordedId = src->m_RecordedId ;
99  m_Status = src->m_Status ;
100  m_Priority = src->m_Priority ;
101  m_StartTs = src->m_StartTs ;
102  m_EndTs = src->m_EndTs ;
103  m_FileSize = src->m_FileSize ;
104  m_FileName = src->m_FileName ;
105  m_HostName = src->m_HostName ;
106  m_LastModified = src->m_LastModified ;
107  m_RecordId = src->m_RecordId ;
108  m_RecGroup = src->m_RecGroup ;
109  m_StorageGroup = src->m_StorageGroup ;
110  m_PlayGroup = src->m_PlayGroup ;
111  m_RecType = src->m_RecType ;
112  m_DupInType = src->m_DupInType ;
113  m_DupMethod = src->m_DupMethod ;
114  m_EncoderId = src->m_EncoderId ;
115  m_EncoderName = src->m_EncoderName ;
116  m_Profile = src->m_Profile ;
117  m_SerializeDetails= src->m_SerializeDetails ;
118  }
119 
120  private:
121  Q_DISABLE_COPY(RecordingInfo);
122 };
123 
125 {
126  qRegisterMetaType< RecordingInfo* >();
127 
129 }
130 
131 } // namespace DTC
132 
133 #endif
recordingstatus.h
RecordingDupMethodType
RecordingDupMethodType
Definition: recordingtypes.h:62
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
true
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:95
programtypes.h
kDupsInRecorded
@ kDupsInRecorded
Definition: recordingtypes.h:48
RecStatus::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: recordingstatus.h:65
RecordingDupInType
RecordingDupInType
Definition: recordingtypes.h:45
datacontracthelper.h
serviceexp.h
DTC::RecordingInfo
Definition: recording.h:25
uint
unsigned int uint
Definition: compat.h:79
DTC::RecordingInfo::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: recording.h:124
PlayGroup
Definition: playgroup.h:11
PROPERTYIMP
#define PROPERTYIMP(type, name)
Definition: datacontracthelper.h:56
DTC
Definition: datacontracthelper.h:123
kNotRecording
@ kNotRecording
Definition: recordingtypes.h:22
kDupCheckNone
@ kDupCheckNone
Definition: recordingtypes.h:65
DTC::RecordingInfo::Copy
void Copy(const RecordingInfo *src)
Definition: recording.h:96
StorageGroup
Definition: storagegroup.h:11
RecStatus
Definition: recordingstatus.h:11
PROPERTYIMP_REF
#define PROPERTYIMP_REF(type, name)
Definition: datacontracthelper.h:70
PROPERTYIMP_ENUM
#define PROPERTYIMP_ENUM(type, name)
Definition: datacontracthelper.h:84
RecordingType
RecordingType
Definition: recordingtypes.h:20
Priority
Definition: channelsettings.cpp:192