MythTV  master
contentServices.h
Go to the documentation of this file.
1 // Program Name: contentServices.h
3 // Created : Mar. 7, 2011
4 //
5 // Purpose - Content 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 CONTENTSERVICES_H_
14 #define CONTENTSERVICES_H_
15 
16 #include <QFileInfo>
17 #include <QStringList>
18 
19 #include "service.h"
22 
25 //
26 // Notes -
27 //
28 // * This implementation can't handle declared default parameters
29 //
30 // * When called, any missing params are sent default values for its datatype
31 //
32 // * Q_CLASSINFO( "<methodName>_Method", ...) is used to determine HTTP method
33 // type. Defaults to "BOTH", available values:
34 // "GET", "POST" or "BOTH"
35 //
38 
39 class SERVICE_PUBLIC ContentServices : public Service //, public QScriptable ???
40 {
41  Q_OBJECT
42  Q_CLASSINFO( "version" , "2.0" );
43  Q_CLASSINFO( "DownloadFile_Method", "POST" )
44 
45  public:
46 
47  // Must call InitializeCustomTypes for each unique Custom Type used
48  // in public slots below.
49 
50  ContentServices( QObject *parent = nullptr ) : Service( parent )
51  {
54  }
55 
56  public slots:
57 
58  virtual QFileInfo GetFile ( const QString &StorageGroup,
59  const QString &FileName ) = 0;
60 
61  virtual QFileInfo GetImageFile ( const QString &StorageGroup,
62  const QString &FileName,
63  int Width, int Height ) = 0;
64 
65  virtual QStringList GetFileList ( const QString &StorageGroup ) = 0;
66 
67  virtual QStringList GetDirList ( const QString &StorageGroup ) = 0;
68 
69  virtual QFileInfo GetRecordingArtwork ( const QString &Type,
70  const QString &Inetref,
71  int Season, int Width,
72  int Height ) = 0;
73 
74  virtual DTC::ArtworkInfoList*
75  GetRecordingArtworkList( int RecordedId,
76  int ChanId,
77  const QDateTime &StartTime ) = 0;
78 
79  virtual DTC::ArtworkInfoList*
80  GetProgramArtworkList( const QString &Inetref,
81  int Season ) = 0;
82 
83 
84  virtual QFileInfo GetVideoArtwork ( const QString &Type,
85  int Id, int Width,
86  int Height ) = 0;
87 
88  virtual QFileInfo GetAlbumArt ( int Id, int Width, int Height ) = 0;
89 
90  virtual QFileInfo GetPreviewImage ( int RecordedId,
91  int ChanId,
92  const QDateTime &StartTime,
93  int Width,
94  int Height,
95  int SecsIn,
96  const QString &Format) = 0;
97 
98  virtual QFileInfo GetRecording ( int RecordedId,
99  int ChanId,
100  const QDateTime &StartTime ) = 0;
101 
102  virtual QFileInfo GetMusic ( int Id ) = 0;
103  virtual QFileInfo GetVideo ( int Id ) = 0;
104 
105  virtual QString GetHash ( const QString &StorageGroup,
106  const QString &FileName ) = 0;
107 
108  virtual bool DownloadFile ( const QString &URL,
109  const QString &StorageGroup ) = 0;
110 
111  virtual DTC::LiveStreamInfo *AddLiveStream ( const QString &StorageGroup,
112  const QString &FileName,
113  const QString &HostName,
114  int MaxSegments,
115  int Width,
116  int Height,
117  int Bitrate,
118  int AudioBitrate,
119  int SampleRate ) = 0;
120 
121  virtual DTC::LiveStreamInfo *AddRecordingLiveStream ( int RecordedId,
122  int ChanId,
123  const QDateTime &StartTime,
124  int MaxSegments,
125  int Width,
126  int Height,
127  int Bitrate,
128  int AudioBitrate,
129  int SampleRate ) = 0;
130 
131  virtual DTC::LiveStreamInfo *AddVideoLiveStream ( int Id,
132  int MaxSegments,
133  int Width,
134  int Height,
135  int Bitrate,
136  int AudioBitrate,
137  int SampleRate ) = 0;
138 
139  virtual DTC::LiveStreamInfo *GetLiveStream ( int Id ) = 0;
140  virtual DTC::LiveStreamInfoList *GetLiveStreamList ( const QString &FileName ) = 0;
141 
142  virtual DTC::LiveStreamInfo *StopLiveStream ( int Id ) = 0;
143  virtual bool RemoveLiveStream ( int Id ) = 0;
144 };
145 
146 #endif
static int DownloadFile(const MythUtilCommandLineParser &cmdline)
Definition: fileutils.cpp:111
unsigned int slots[4]
Definition: element.c:38
static const char URL[]
Definition: cddb.cpp:29
static void InitializeCustomTypes()
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
ContentServices(QObject *parent=nullptr)
static void InitializeCustomTypes()
enum MythDate::Formats Format