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