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