MythTV  master
dvrServices.h
Go to the documentation of this file.
1 // Program Name: dvrServices.h
3 // Created : Mar. 7, 2011
4 //
5 // Purpose - DVR Services API Interface definition
6 //
7 // Copyright (c) 2010 David Blain <dblain@mythtv.org>
8 //
9 // Licensed under the GPL v2 or later, see LICENSE for details
10 //
12 
13 #ifndef DVRSERVICES_H_
14 #define DVRSERVICES_H_
15 
16 #include "service.h"
17 
20 #include "datacontracts/recRule.h"
25 #include "datacontracts/input.h"
27 #include "datacontracts/cutList.h"
29 
32 //
33 // Notes -
34 //
35 // * This implementation can't handle declared default parameters
36 //
37 // * When called, any missing params are sent default values for its datatype
38 //
39 // * Q_CLASSINFO( "<methodName>_Method", ...) is used to determine HTTP method
40 // type. Defaults to "BOTH", available values:
41 // "GET", "POST" or "BOTH"
42 //
45 
46 class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ???
47 {
48  Q_OBJECT
49  Q_CLASSINFO( "version" , "7.0" )
50  Q_CLASSINFO( "RemoveRecorded_Method", "POST" )
51  Q_CLASSINFO( "AddRecordedCredits_Method", "POST" )
52  Q_CLASSINFO( "AddRecordedProgram_Method", "POST" )
53  Q_CLASSINFO( "DeleteRecording_Method", "POST" )
54  Q_CLASSINFO( "UnDeleteRecording", "POST" )
55  Q_CLASSINFO( "UpdateRecordedWatchedStatus_Method", "POST" )
56  Q_CLASSINFO( "SetSavedBookmark_Method", "POST" )
57  Q_CLASSINFO( "AddRecordSchedule_Method", "POST" )
58  Q_CLASSINFO( "UpdateRecordSchedule_Method", "POST" )
59  Q_CLASSINFO( "RemoveRecordSchedule_Method", "POST" )
60  Q_CLASSINFO( "AddDontRecordSchedule", "POST" )
61  Q_CLASSINFO( "EnableRecordSchedule_Method", "POST" )
62  Q_CLASSINFO( "DisableRecordSchedule_Method", "POST" )
63  Q_CLASSINFO( "ManageJobQueue_Method", "POST" )
64  Q_CLASSINFO( "SetRecordedMarkup_Method", "POST" )
65 
66 
67  public:
68 
69  // Must call InitializeCustomTypes for each unique Custom Type used
70  // in public slots below.
71 
72  DvrServices( QObject *parent = nullptr ) : Service( parent )
73  {
82  }
83 
84  public slots:
85 
86  virtual DTC::ProgramList* GetExpiringList ( int StartIndex,
87  int Count ) = 0;
88 
89  virtual DTC::ProgramList* GetRecordedList ( bool Descending,
90  int StartIndex,
91  int Count,
92  const QString &TitleRegEx,
93  const QString &RecGroup,
94  const QString &StorageGroup,
95  const QString &Category,
96  const QString &Sort,
97  bool IgnoreLiveTV,
98  bool IgnoreDeleted ) = 0;
99 
100  virtual DTC::ProgramList* GetOldRecordedList ( bool Descending,
101  int StartIndex,
102  int Count,
103  const QDateTime &StartTime,
104  const QDateTime &EndTime,
105  const QString &Title,
106  const QString &SeriesId,
107  int RecordId,
108  const QString &Sort) = 0;
109 
110  virtual DTC::Program* GetRecorded ( int RecordedId,
111  int ChanId,
112  const QDateTime &StartTime ) = 0;
113 
114  virtual bool AddRecordedCredits ( int RecordedId,
115  const QJsonObject & json) = 0;
116 
117  virtual int AddRecordedProgram ( const QJsonObject & json ) = 0;
118 
119  virtual bool RemoveRecorded ( int RecordedId,
120  int ChanId,
121  const QDateTime &StartTime,
122  bool ForceDelete,
123  bool AllowRerecord ) = 0;
124 
125  virtual bool DeleteRecording ( int RecordedId,
126  int ChanId,
127  const QDateTime &StartTime,
128  bool ForceDelete,
129  bool AllowRerecord ) = 0;
130 
131  virtual bool UnDeleteRecording ( int RecordedId,
132  int ChanId,
133  const QDateTime &StartTime ) = 0;
134 
135  virtual bool StopRecording ( int RecordedId ) = 0;
136 
137  virtual bool ReactivateRecording ( int RecordedId,
138  int ChanId,
139  const QDateTime &StartTime ) = 0;
140 
141  virtual bool RescheduleRecordings ( void ) = 0;
142 
143  virtual bool AllowReRecord ( int RecordedId ) = 0;
144 
145  virtual bool UpdateRecordedWatchedStatus ( int RecordedId,
146  int ChanId,
147  const QDateTime &StartTime,
148  bool Watched) = 0;
149 
150  virtual long GetSavedBookmark ( int RecordedId,
151  int ChanId,
152  const QDateTime &StartTime,
153  const QString &OffsetType ) = 0;
154 
155  virtual bool SetSavedBookmark ( int RecordedId,
156  int ChanId,
157  const QDateTime &StartTime,
158  const QString &OffsetType,
159  long Offset ) = 0;
160 
161  virtual DTC::CutList* GetRecordedCutList ( int RecordedId,
162  int ChanId,
163  const QDateTime &StartTime,
164  const QString &OffsetType ) = 0;
165 
166  virtual DTC::CutList* GetRecordedCommBreak ( int RecordedId,
167  int ChanId,
168  const QDateTime &StartTime,
169  const QString &OffsetType ) = 0;
170 
171  virtual DTC::CutList* GetRecordedSeek ( int RecordedId,
172  const QString &OffsetType ) = 0;
173 
174  virtual DTC::MarkupList* GetRecordedMarkup ( int RecordedId ) = 0;
175 
176  virtual bool SetRecordedMarkup ( int RecordedId,
177  const QJsonObject & json ) = 0;
178 
179  virtual DTC::ProgramList* GetConflictList ( int StartIndex,
180  int Count,
181  int RecordId ) = 0;
182 
183  virtual DTC::ProgramList* GetUpcomingList ( int StartIndex,
184  int Count,
185  bool ShowAll,
186  int RecordId,
187  int RecStatus ) = 0;
188 
189  virtual DTC::EncoderList* GetEncoderList ( ) = 0;
190 
191  virtual DTC::InputList* GetInputList ( ) = 0;
192 
193  virtual QStringList GetRecGroupList ( ) = 0;
194 
195  virtual QStringList GetProgramCategories ( bool OnlyRecorded ) = 0;
196 
197  virtual QStringList GetRecStorageGroupList ( ) = 0;
198 
199  virtual QStringList GetPlayGroupList ( ) = 0;
200 
201  virtual DTC::RecRuleFilterList* GetRecRuleFilterList ( ) = 0;
202 
203  virtual QStringList GetTitleList ( const QString &RecGroup ) = 0;
204 
205  virtual DTC::TitleInfoList* GetTitleInfoList ( ) = 0;
206 
207  // Recording Rules
208 
209  virtual uint AddRecordSchedule ( const QString& Title,
210  const QString& Subtitle,
211  const QString& Description,
212  const QString& Category,
213  const QDateTime& StartTime,
214  const QDateTime& EndTime,
215  const QString& SeriesId,
216  const QString& ProgramId,
217  int ChanId,
218  const QString& Station,
219  int FindDay,
220  QTime FindTime,
221  int ParentId,
222  bool Inactive,
223  uint Season,
224  uint Episode,
225  const QString& Inetref,
226  QString Type,
227  QString SearchType,
228  int RecPriority,
229  uint PreferredInput,
230  int StartOffset,
231  int EndOffset,
232  const QDateTime& LastRecorded,
233  QString DupMethod,
234  QString DupIn,
235  bool NewEpisOnly,
236  uint Filter,
237  QString RecProfile,
238  QString RecGroup,
239  QString StorageGroup,
240  QString PlayGroup,
241  bool AutoExpire,
242  int MaxEpisodes,
243  bool MaxNewest,
244  bool AutoCommflag,
245  bool AutoTranscode,
246  bool AutoMetaLookup,
247  bool AutoUserJob1,
248  bool AutoUserJob2,
249  bool AutoUserJob3,
250  bool AutoUserJob4,
251  int Transcoder ) = 0;
252 
253  virtual bool UpdateRecordSchedule ( uint RecordId,
254  const QString& Title,
255  const QString& Subtitle,
256  const QString& Description,
257  const QString& Category,
258  const QDateTime& StartTime,
259  const QDateTime& EndTime,
260  const QString& SeriesId,
261  const QString& ProgramId,
262  int ChanId,
263  const QString& Station,
264  int FindDay,
265  QTime FindTime,
266  bool Inactive,
267  uint Season,
268  uint Episode,
269  const QString& Inetref,
270  QString Type,
271  QString SearchType,
272  int RecPriority,
273  uint PreferredInput,
274  int StartOffset,
275  int EndOffset,
276  QString DupMethod,
277  QString DupIn,
278  bool NewEpisOnly,
279  uint Filter,
280  QString RecProfile,
281  QString RecGroup,
282  QString StorageGroup,
283  QString PlayGroup,
284  bool AutoExpire,
285  int MaxEpisodes,
286  bool MaxNewest,
287  bool AutoCommflag,
288  bool AutoTranscode,
289  bool AutoMetaLookup,
290  bool AutoUserJob1,
291  bool AutoUserJob2,
292  bool AutoUserJob3,
293  bool AutoUserJob4,
294  int Transcoder ) = 0;
295 
296  virtual bool RemoveRecordSchedule ( uint RecordId ) = 0;
297 
298  virtual bool AddDontRecordSchedule ( int ChanId,
299  const QDateTime &StartTime,
300  bool NeverRecord ) = 0;
301 
302  virtual DTC::RecRuleList* GetRecordScheduleList ( int StartIndex,
303  int Count,
304  const QString &Sort,
305  bool Descending ) = 0;
306 
307  virtual DTC::RecRule* GetRecordSchedule ( uint RecordId,
308  const QString& Template,
309  int RecordedId,
310  int ChanId,
311  const QDateTime& StartTime,
312  bool MakeOverride ) = 0;
313 
314  virtual bool EnableRecordSchedule ( uint RecordId ) = 0;
315 
316  virtual bool DisableRecordSchedule ( uint RecordId ) = 0;
317 
318  virtual int RecordedIdForKey ( int ChanId,
319  const QDateTime &StartTime ) = 0;
320 
321  virtual int RecordedIdForPathname ( const QString &Pathname ) = 0;
322 
323  // The following are all temporary, pending implementation of a
324  // 'enum metadata' endpoint
325  virtual QString RecStatusToString ( int RecStatus ) = 0;
326 
327  virtual QString RecStatusToDescription( int RecStatus,
328  int RecType,
329  const QDateTime &StartTime ) = 0;
330 
331  virtual QString RecTypeToString ( const QString& RecType ) = 0;
332 
333  virtual QString RecTypeToDescription ( const QString& RecType ) = 0;
334 
335  virtual QString DupMethodToString ( const QString& DupMethod ) = 0;
336 
337  virtual QString DupMethodToDescription( const QString& DupMethod ) = 0;
338 
339  virtual QString DupInToString ( const QString& DupIn ) = 0;
340 
341  virtual QString DupInToDescription ( const QString& DupIn ) = 0;
342 
343  virtual int ManageJobQueue ( const QString &Action,
344  const QString &JobName,
345  int JobId,
346  int RecordedId,
347  QDateTime JobStartTime,
348  QString RemoteHost,
349  QString JobArgs ) = 0;
350 
351 };
352 
353 #endif
DTC::Program
Definition: programAndChannel.h:145
DTC::RecRuleFilterList::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: recRuleFilterList.h:81
recRuleFilterList.h
service.h
recRuleFilter.h
AutoExpire
Used to expire recordings to make space for new recordings.
Definition: autoexpire.h:60
DTC::TitleInfoList
Definition: titleInfoList.h:24
titleInfoList.h
DTC::RecRuleFilterList
Definition: recRuleFilterList.h:16
DTC::EncoderList::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: encoderList.h:67
DvrServices
Definition: dvrServices.h:46
DTC::ProgramList::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: programList.h:94
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
Action
An action (for this plugin) consists of a description, and a set of key sequences.
Definition: action.h:40
programList.h
DTC::CutList::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: cutList.h:68
DvrServices::DvrServices
DvrServices(QObject *parent=nullptr)
Definition: dvrServices.h:72
Service
Definition: service.h:42
markupList.h
DTC::RecRuleList
Definition: recRuleList.h:15
cutList.h
AutoTranscode
Definition: recordingprofile.cpp:1177
recRule.h
uint
unsigned int uint
Definition: compat.h:144
DTC::InputList
Definition: inputList.h:24
PlayGroup
Definition: playgroup.h:11
DTC::TitleInfoList::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: titleInfoList.h:67
DTC::InputList::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: inputList.h:67
DTC::RecRule
Definition: recRule.h:15
DTC::MarkupList
Definition: markupList.h:25
DTC::MarkupList::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: markupList.h:82
StorageGroup
Definition: storagegroup.h:11
RecStatus
Definition: recStatus.h:11
DTC::ProgramList
Definition: programList.h:26
DTC::RecRuleList::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: recRuleList.h:80
DTC::EncoderList
Definition: encoderList.h:24
input.h
encoderList.h
inputList.h
recRuleList.h
DTC::CutList
Definition: cutList.h:25