MythTV master
v2content.h
Go to the documentation of this file.
1
2// 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
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 QFileInfo GetRecording ( int RecordedId,
97 int ChanId,
98 const QDateTime &StartTime,
99 const QString &Download );
100
101 static QFileInfo GetMusic ( int Id );
102 static QFileInfo GetVideo ( int Id );
103
104 static QString GetHash ( const QString &StorageGroup,
105 const QString &FileName );
106
107 static bool DownloadFile ( const QString &URL,
108 const QString &StorageGroup );
109
110 // // HTTP Live Streaming
111 // V2LiveStreamInfo *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 );
120
121 // V2LiveStreamInfo *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 );
130
131 // V2LiveStreamInfo *AddVideoLiveStream ( int Id,
132 // int MaxSegments,
133 // int Width,
134 // int Height,
135 // int Bitrate,
136 // int AudioBitrate,
137 // int SampleRate );
138
139 // V2LiveStreamInfo *GetLiveStream ( int Id );
140 // V2LiveStreamInfoList *GetLiveStreamList ( const QString &FileName );
141
142 // V2LiveStreamInfo *StopLiveStream ( int Id );
143 // bool RemoveLiveStream ( int Id );
144
145 private:
146 Q_DISABLE_COPY(V2Content)
147
148
149};
150
151
152#endif
QFileInfo GetRecording(int RecordedId, int ChanId, const QDateTime &StartTime, const QString &Download)
Definition: v2content.cpp:689
static V2ArtworkInfoList * GetProgramArtworkList(const QString &Inetref, int Season)
Definition: v2content.cpp:343
static V2ArtworkInfoList * GetRecordingArtworkList(int RecordedId, int ChanId, const QDateTime &StartTime)
Definition: v2content.cpp:325
static void RegisterCustomTypes()
static QString GetHash(const QString &StorageGroup, const QString &FileName)
Definition: v2content.cpp:832
static QFileInfo GetFile(const QString &StorageGroup, const QString &FileName)
Definition: v2content.cpp:82
static QFileInfo GetVideoArtwork(const QString &Type, int Id, int Width, int Height)
Definition: v2content.cpp:357
static bool DownloadFile(const QString &URL, const QString &StorageGroup)
Definition: v2content.cpp:865
static QFileInfo GetRecordingArtwork(const QString &Type, const QString &Inetref, int Season, int Width, int Height)
Definition: v2content.cpp:279
static QFileInfo GetAlbumArt(int Id, int Width, int Height)
Definition: v2content.cpp:416
~V2Content() override=default
static QFileInfo GetMusic(int Id)
Definition: v2content.cpp:751
static QFileInfo GetImageFile(const QString &StorageGroup, const QString &FileName, int Width, int Height)
Definition: v2content.cpp:137
static QStringList GetDirList(const QString &StorageGroup)
Definition: v2content.cpp:239
static QFileInfo GetVideo(int Id)
Definition: v2content.cpp:794
static QFileInfo GetPreviewImage(int RecordedId, int ChanId, const QDateTime &StartTime, int Width, int Height, int SecsIn, const QString &Format)
Definition: v2content.cpp:515
static QStringList GetFileList(const QString &StorageGroup)
Definition: v2content.cpp:259