MythTV  master
v2recordingProfile.h
Go to the documentation of this file.
1 // Program Name: v2RecordingProfile.h
3 // Created : Feb 28, 2023
4 //
5 // Copyright (c) 2023 Peter Bennett <pbennett@mythtv.org>
6 //
7 // Licensed under the GPL v2 or later, see COPYING for details
8 //
10 
11 #ifndef V2RECORDINGPROFILE_H_
12 #define V2RECORDINGPROFILE_H_
13 
14 #include <QString>
15 
17 
19 
20 class V2RecProfParam : public QObject {
21  Q_OBJECT
22  Q_CLASSINFO( "Version" , "1.0" );
23 
24  SERVICE_PROPERTY2( QString , Name )
25  SERVICE_PROPERTY2( QString , Value )
26 
27  public:
28 
29  Q_INVOKABLE V2RecProfParam(QObject *parent = nullptr)
30  : QObject ( parent )
31  {
32  }
33 
34  private:
36 };
37 
39 
40 
41 
42 class V2RecProfile : public QObject
43 {
44  Q_OBJECT
45  Q_CLASSINFO( "Version" , "1.0" );
46  Q_CLASSINFO( "RecProfParams", "type=V2RecProfParam");
47 
48  SERVICE_PROPERTY2( int , Id )
49  SERVICE_PROPERTY2( QString , Name )
50  SERVICE_PROPERTY2( QString , VideoCodec )
51  SERVICE_PROPERTY2( QString , AudioCodec )
52  SERVICE_PROPERTY2( QVariantList, RecProfParams )
53 
54  public:
55 
57  {
58  // We must make sure the object added to the QVariantList has
59  // a parent of 'this'
60 
61  auto *pObject = new V2RecProfParam( this );
62  m_RecProfParams.append( QVariant::fromValue<QObject *>( pObject ));
63  return pObject;
64  }
65 
66 
67  Q_INVOKABLE V2RecProfile(QObject *parent = nullptr)
68  : QObject ( parent )
69  {
70  }
71 
72  private:
73  Q_DISABLE_COPY(V2RecProfile);
74 };
75 
77 
78 
79 class V2RecProfileGroup : public QObject
80 {
81  Q_OBJECT
82  Q_CLASSINFO( "Version" , "1.0" );
83  Q_CLASSINFO( "RecProfiles", "type=V2RecProfile");
84 
85  SERVICE_PROPERTY2( int , Id )
86  SERVICE_PROPERTY2( QString , Name )
87  SERVICE_PROPERTY2( QString , CardType )
88  SERVICE_PROPERTY2( QVariantList, RecProfiles )
89 
90  public:
91 
92  Q_INVOKABLE V2RecProfileGroup(QObject *parent = nullptr)
93  : QObject ( parent )
94  {
95  }
96 
98  {
99  // We must make sure the object added to the QVariantList has
100  // a parent of 'this'
101 
102  auto *pObject = new V2RecProfile( this );
103  m_RecProfiles.append( QVariant::fromValue<QObject *>( pObject ));
104  return pObject;
105  }
106 
107  private:
108  Q_DISABLE_COPY(V2RecProfileGroup);
109 };
110 
112 
113 class V2RecProfileGroupList : public QObject
114 {
115  Q_OBJECT
116  Q_CLASSINFO( "Version" , "1.0" );
117  Q_CLASSINFO( "RecProfileGroups", "type=V2RecProfileGroup");
118 
119  SERVICE_PROPERTY2( QVariantList, RecProfileGroups )
120 
121  public:
122 
123  Q_INVOKABLE V2RecProfileGroupList(QObject *parent = nullptr)
124  : QObject ( parent )
125  {
126  }
127 
129  {
130  // We must make sure the object added to the QVariantList has
131  // a parent of 'this'
132 
133  auto *pObject = new V2RecProfileGroup( this );
134  m_RecProfileGroups.append( QVariant::fromValue<QObject *>( pObject ));
135  return pObject;
136  }
137 
138 
139 
140  private:
141  Q_DISABLE_COPY(V2RecProfileGroupList);
142 };
143 
145 
146 
147 
148 #endif
V2RecProfParam::Q_DISABLE_COPY
Q_DISABLE_COPY(V2RecProfParam)
V2RecProfParam::V2RecProfParam
Q_INVOKABLE V2RecProfParam(QObject *parent=nullptr)
Definition: v2recordingProfile.h:29
V2RecProfileGroup::V2RecProfileGroup
Q_INVOKABLE V2RecProfileGroup(QObject *parent=nullptr)
Definition: v2recordingProfile.h:92
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(StandardSetting *)
V2RecProfileGroupList::V2RecProfileGroupList
Q_INVOKABLE V2RecProfileGroupList(QObject *parent=nullptr)
Definition: v2recordingProfile.h:123
SERVICE_PROPERTY2
#define SERVICE_PROPERTY2(Type, Name)
Definition: mythhttpservice.h:72
V2RecProfile::V2RecProfile
Q_INVOKABLE V2RecProfile(QObject *parent=nullptr)
Definition: v2recordingProfile.h:67
V2RecProfileGroupList
Definition: v2recordingProfile.h:113
V2RecProfile
Definition: v2recordingProfile.h:42
V2RecProfParam
Definition: v2recordingProfile.h:20
CardType
Definition: videosource.h:326
mythhttpservice.h
V2RecProfileGroupList::AddProfileGroup
V2RecProfileGroup * AddProfileGroup()
Definition: v2recordingProfile.h:128
Name
Definition: channelsettings.cpp:71
V2RecProfileGroup
Definition: v2recordingProfile.h:79
V2RecProfileGroup::AddProfile
V2RecProfile * AddProfile()
Definition: v2recordingProfile.h:97
V2RecProfile::AddParam
V2RecProfParam * AddParam()
Definition: v2recordingProfile.h:56
V2RecProfParam::Q_CLASSINFO
Q_CLASSINFO("Version", "1.0")