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 COPYING for details
8 //
10 
11 #ifndef RECORDING_H_
12 #define RECORDING_H_
13 
14 #include <QDateTime>
15 #include <QString>
16 
17 #include "serviceexp.h"
18 #include "datacontracthelper.h"
19 #include "enums/recStatus.h"
20 #include "programtypes.h"
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 DESIGNABLE SerializeDetails ) // v1.3
37  Q_PROPERTY( QString FileName READ FileName WRITE setFileName DESIGNABLE SerializeDetails ) // v1.3
38  Q_PROPERTY( QString HostName READ HostName WRITE setHostName DESIGNABLE SerializeDetails ) // v1.3
39  Q_PROPERTY( QDateTime LastModified READ LastModified WRITE setLastModified DESIGNABLE SerializeDetails ) // v1.3
40 
41  Q_PROPERTY( int RecordId READ RecordId WRITE setRecordId DESIGNABLE SerializeDetails )
42  Q_PROPERTY( QString RecGroup READ RecGroup WRITE setRecGroup DESIGNABLE SerializeDetails )
43  Q_PROPERTY( QString PlayGroup READ PlayGroup WRITE setPlayGroup DESIGNABLE SerializeDetails )
44  Q_PROPERTY( QString StorageGroup READ StorageGroup WRITE setStorageGroup DESIGNABLE SerializeDetails )
45  Q_PROPERTY( int RecType READ RecType WRITE setRecType DESIGNABLE SerializeDetails )
46  Q_PROPERTY( int DupInType READ DupInType WRITE setDupInType DESIGNABLE SerializeDetails )
47  Q_PROPERTY( int DupMethod READ DupMethod WRITE setDupMethod DESIGNABLE SerializeDetails )
48  Q_PROPERTY( int EncoderId READ EncoderId WRITE setEncoderId DESIGNABLE SerializeDetails )
49  Q_PROPERTY( QString EncoderName READ EncoderName WRITE setEncoderName DESIGNABLE SerializeDetails )
50  Q_PROPERTY( QString Profile READ Profile WRITE setProfile DESIGNABLE SerializeDetails )
51 
52  PROPERTYIMP ( uint , RecordedId )
53  PROPERTYIMP_ENUM( RecStatus::Type , Status )
54  PROPERTYIMP ( int , Priority )
55  PROPERTYIMP ( QDateTime , StartTs )
56  PROPERTYIMP ( QDateTime , EndTs )
57 
58  PROPERTYIMP ( qlonglong , FileSize ) // v1.3
59  PROPERTYIMP ( QString , FileName ) // v1.3
60  PROPERTYIMP ( QString , HostName ) // v1.3
61  PROPERTYIMP ( QDateTime , LastModified) // v1.3
62 
63  PROPERTYIMP ( int , RecordId )
64  PROPERTYIMP ( QString , RecGroup )
65  PROPERTYIMP ( QString , StorageGroup)
66  PROPERTYIMP ( QString , PlayGroup )
67  PROPERTYIMP_ENUM( RecordingType , RecType )
70  PROPERTYIMP ( int , EncoderId )
71  PROPERTYIMP ( QString , EncoderName )
72  PROPERTYIMP ( 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 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
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:91
enum RecordingDupInTypes RecordingDupInType
unsigned int uint
Definition: compat.h:140
#define PROPERTYIMP(type, name)
RecordingDupMethodType
#define PROPERTYIMP_ENUM(type, name)
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
void Copy(const RecordingInfo *src)
Definition: recording.h:96
static void InitializeCustomTypes()
Definition: recording.h:124
static void InitializeCustomTypes()
Definition: recStatus.h:66