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 
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
DTC::LiveStreamInfoList::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: liveStreamInfoList.h:57
ContentServices::GetRecording
virtual QFileInfo GetRecording(int RecordedId, int ChanId, const QDateTime &StartTime)=0
ContentServices::GetVideo
virtual QFileInfo GetVideo(int Id)=0
DTC::ArtworkInfoList::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: artworkInfoList.h:68
ContentServices
Definition: contentServices.h:40
DTC::LiveStreamInfo
Definition: liveStreamInfo.h:16
service.h
ContentServices::AddVideoLiveStream
virtual DTC::LiveStreamInfo * AddVideoLiveStream(int Id, int MaxSegments, int Width, int Height, int Bitrate, int AudioBitrate, int SampleRate)=0
DTC::LiveStreamInfoList
Definition: liveStreamInfoList.h:15
MythDate::Format
Format
Definition: mythdate.h:13
ContentServices::GetFileList
virtual QStringList GetFileList(const QString &StorageGroup)=0
SampleRate
Definition: recordingprofile.cpp:110
ContentServices::GetHash
virtual QString GetHash(const QString &StorageGroup, const QString &FileName)=0
ContentServices::AddRecordingLiveStream
virtual DTC::LiveStreamInfo * AddRecordingLiveStream(int RecordedId, int ChanId, const QDateTime &StartTime, int MaxSegments, int Width, int Height, int Bitrate, int AudioBitrate, int SampleRate)=0
ContentServices::GetFile
virtual QFileInfo GetFile(const QString &StorageGroup, const QString &FileName)=0
ContentServices::GetRecordingArtworkList
virtual DTC::ArtworkInfoList * GetRecordingArtworkList(int RecordedId, int ChanId, const QDateTime &StartTime)=0
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
ContentServices::GetVideoArtwork
virtual QFileInfo GetVideoArtwork(const QString &Type, int Id, int Width, int Height)=0
Service
Definition: service.h:43
liveStreamInfoList.h
ContentServices::GetPreviewImage
virtual QFileInfo GetPreviewImage(int RecordedId, int ChanId, const QDateTime &StartTime, int Width, int Height, int SecsIn, const QString &Format)=0
ContentServices::GetImageFile
virtual QFileInfo GetImageFile(const QString &StorageGroup, const QString &FileName, int Width, int Height)=0
ContentServices::StopLiveStream
virtual DTC::LiveStreamInfo * StopLiveStream(int Id)=0
ContentServices::AddLiveStream
virtual DTC::LiveStreamInfo * AddLiveStream(const QString &StorageGroup, const QString &FileName, const QString &HostName, int MaxSegments, int Width, int Height, int Bitrate, int AudioBitrate, int SampleRate)=0
ContentServices::RemoveLiveStream
virtual bool RemoveLiveStream(int Id)=0
ContentServices::GetRecordingArtwork
virtual QFileInfo GetRecordingArtwork(const QString &Type, const QString &Inetref, int Season, int Width, int Height)=0
StorageGroup
Definition: storagegroup.h:12
ContentServices::GetLiveStream
virtual DTC::LiveStreamInfo * GetLiveStream(int Id)=0
ContentServices::GetDirList
virtual QStringList GetDirList(const QString &StorageGroup)=0
ContentServices::GetProgramArtworkList
virtual DTC::ArtworkInfoList * GetProgramArtworkList(const QString &Inetref, int Season)=0
artworkInfoList.h
ContentServices::GetMusic
virtual QFileInfo GetMusic(int Id)=0
ContentServices::DownloadFile
virtual bool DownloadFile(const QString &URL, const QString &StorageGroup)=0
ContentServices::GetAlbumArt
virtual QFileInfo GetAlbumArt(int Id, int Width, int Height)=0
ContentServices::GetLiveStreamList
virtual DTC::LiveStreamInfoList * GetLiveStreamList(const QString &FileName)=0
DTC::ArtworkInfoList
Definition: artworkInfoList.h:26
ContentServices::Q_CLASSINFO
Q_CLASSINFO("version", "2.0")