MythTV  master
v2content.h
Go to the documentation of this file.
1 // Program Name: content.h
3 // Created : Mar. 7, 2011
4 //
5 // Copyright (c) 2011 David Blain <dblain@mythtv.org>
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //
25 
26 #ifndef V2CONTENT_H
27 #define V2CONTENT_H
28 
29 #include <QFileInfo>
30 
32 #include "v2artworkInfoList.h"
33 
34 #define CONTENT_SERVICE QString("/Content/")
35 #define CONTENT_HANDLE QString("Content")
36 
37 class V2Content : public MythHTTPService
38 {
39  Q_OBJECT
40  Q_CLASSINFO("Version", "2.0")
41  Q_CLASSINFO("DownloadFile", "methods=POST;name=bool")
42  Q_CLASSINFO("AddLiveStream", "methods=GET,POST,HEAD")
43  Q_CLASSINFO("AddRecordingLiveStream", "methods=GET,POST,HEAD")
44  Q_CLASSINFO("AddVideoLiveStream", "methods=GET,POST,HEAD")
45  Q_CLASSINFO("GetLiveStream", "methods=GET,POST,HEAD")
46  Q_CLASSINFO("GetLiveStreamList", "methods=GET,POST,HEAD")
47  Q_CLASSINFO("StopLiveStream", "methods=GET,POST,HEAD")
48  Q_CLASSINFO("RemoveLiveStream", "methods=GET,POST,HEAD;name=bool")
49 
50  public:
51 
52  V2Content();
53  ~V2Content() override = default;
54  static void RegisterCustomTypes();
55 
56  public slots:
57 
58  static QFileInfo GetFile ( const QString &StorageGroup,
59  const QString &FileName );
60 
61  static QFileInfo GetImageFile ( const QString &StorageGroup,
62  const QString &FileName,
63  int Width, int Height );
64 
65  static QStringList GetFileList ( const QString &StorageGroup );
66 
67  static QStringList GetDirList ( const QString &StorageGroup );
68 
69  static QFileInfo GetRecordingArtwork ( const QString &Type,
70  const QString &Inetref,
71  int Season, int Width,
72  int Height);
73 
74  static V2ArtworkInfoList*
75  GetRecordingArtworkList( int RecordedId,
76  int ChanId,
77  const QDateTime &StartTime );
78 
79  static V2ArtworkInfoList*
80  GetProgramArtworkList( const QString &Inetref,
81  int Season );
82 
83  static QFileInfo GetVideoArtwork ( const QString &Type,
84  int Id, int Width, int Height );
85 
86  static QFileInfo GetAlbumArt ( int Id, int Width, int Height );
87 
88  static QFileInfo GetPreviewImage ( int RecordedId,
89  int ChanId,
90  const QDateTime &StartTime,
91  int Width,
92  int Height,
93  int SecsIn,
94  const QString &Format);
95 
96  static QFileInfo GetRecording ( int RecordedId,
97  int ChanId,
98  const QDateTime &StartTime );
99 
100  static QFileInfo GetMusic ( int Id );
101  static QFileInfo GetVideo ( int Id );
102 
103  static QString GetHash ( const QString &StorageGroup,
104  const QString &FileName );
105 
106  static bool DownloadFile ( const QString &URL,
107  const QString &StorageGroup );
108 
109  // // HTTP Live Streaming
110  // V2LiveStreamInfo *AddLiveStream ( const QString &StorageGroup,
111  // const QString &FileName,
112  // const QString &HostName,
113  // int MaxSegments,
114  // int Width,
115  // int Height,
116  // int Bitrate,
117  // int AudioBitrate,
118  // int SampleRate );
119 
120  // V2LiveStreamInfo *AddRecordingLiveStream ( int RecordedId,
121  // int ChanId,
122  // const QDateTime &StartTime,
123  // int MaxSegments,
124  // int Width,
125  // int Height,
126  // int Bitrate,
127  // int AudioBitrate,
128  // int SampleRate );
129 
130  // V2LiveStreamInfo *AddVideoLiveStream ( int Id,
131  // int MaxSegments,
132  // int Width,
133  // int Height,
134  // int Bitrate,
135  // int AudioBitrate,
136  // int SampleRate );
137 
138  // V2LiveStreamInfo *GetLiveStream ( int Id );
139  // V2LiveStreamInfoList *GetLiveStreamList ( const QString &FileName );
140 
141  // V2LiveStreamInfo *StopLiveStream ( int Id );
142  // bool RemoveLiveStream ( int Id );
143 
144  private:
145  Q_DISABLE_COPY(V2Content)
146 
147 
148 };
149 
150 
151 #endif
V2Content::GetHash
static QString GetHash(const QString &StorageGroup, const QString &FileName)
Definition: v2content.cpp:824
V2Content
Definition: v2content.h:37
V2ArtworkInfoList
Definition: v2artworkInfoList.h:22
V2Content::GetProgramArtworkList
static V2ArtworkInfoList * GetProgramArtworkList(const QString &Inetref, int Season)
Definition: v2content.cpp:341
V2Content::GetFile
static QFileInfo GetFile(const QString &StorageGroup, const QString &FileName)
Definition: v2content.cpp:80
MythDate::Format
Format
Definition: mythdate.h:15
V2Content::GetAlbumArt
static QFileInfo GetAlbumArt(int Id, int Width, int Height)
Definition: v2content.cpp:414
V2Content::GetImageFile
static QFileInfo GetImageFile(const QString &StorageGroup, const QString &FileName, int Width, int Height)
Definition: v2content.cpp:135
V2Content::GetMusic
static QFileInfo GetMusic(int Id)
Definition: v2content.cpp:743
V2Content::V2Content
V2Content()
Definition: v2content.cpp:74
V2Content::GetRecording
static QFileInfo GetRecording(int RecordedId, int ChanId, const QDateTime &StartTime)
Definition: v2content.cpp:685
V2Content::GetRecordingArtworkList
static V2ArtworkInfoList * GetRecordingArtworkList(int RecordedId, int ChanId, const QDateTime &StartTime)
Definition: v2content.cpp:323
V2Content::GetVideoArtwork
static QFileInfo GetVideoArtwork(const QString &Type, int Id, int Width, int Height)
Definition: v2content.cpp:355
V2Content::GetDirList
static QStringList GetDirList(const QString &StorageGroup)
Definition: v2content.cpp:237
MythHTTPService
Definition: mythhttpservice.h:19
V2Content::~V2Content
~V2Content() override=default
v2artworkInfoList.h
V2Content::DownloadFile
static bool DownloadFile(const QString &URL, const QString &StorageGroup)
Definition: v2content.cpp:857
mythhttpservice.h
V2Content::GetVideo
static QFileInfo GetVideo(int Id)
Definition: v2content.cpp:786
StorageGroup
Definition: storagegroup.h:11
V2Content::GetRecordingArtwork
static QFileInfo GetRecordingArtwork(const QString &Type, const QString &Inetref, int Season, int Width, int Height)
Definition: v2content.cpp:277
V2Content::GetFileList
static QStringList GetFileList(const QString &StorageGroup)
Definition: v2content.cpp:257
V2Content::GetPreviewImage
static QFileInfo GetPreviewImage(int RecordedId, int ChanId, const QDateTime &StartTime, int Width, int Height, int SecsIn, const QString &Format)
Definition: v2content.cpp:511
V2Content::RegisterCustomTypes
static void RegisterCustomTypes()