forked from rofafor/vdr-plugin-iptv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsource.h
84 lines (73 loc) · 2.38 KB
/
source.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* source.h: IPTV plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
*/
#pragma once
#include <vdr/menuitems.h>
#include <vdr/sourceparams.h>
#include "common.h"
class cIptvTransponderParameters {
friend class cIptvSourceParam;
private:
int sidScanM;
int pidScanM;
int protocolM;
char addressM[NAME_MAX + 1];
int parameterM;
int useYtdlp;
char handlerType;
std::string xmltvId;
public:
enum {
eProtocolUDP,
eProtocolCURL,
eProtocolHTTP,
eProtocolFILE,
eProtocolEXT,
eProtocolEXTT,
eProtocolM3U,
eProtocolM3US,
eProtocolRadio,
eProtocolStream,
eProtocolYT,
eProtocolCount
};
explicit cIptvTransponderParameters(const char *parametersP = nullptr);
int SidScan() const { return sidScanM; };
int PidScan() const { return pidScanM; };
int Protocol() const { return protocolM; };
const char *Address() const { return addressM; };
int Parameter() const { return parameterM; };
int UseYtdlp() const { return useYtdlp; };
char HandlerType() const { return handlerType; };
std::string XmlTVId() const { return xmltvId; };
void SetSidScan(int sidScanP) { sidScanM = sidScanP; };
void SetPidScan(int pidScanP) { pidScanM = pidScanP; };
void SetProtocol(int protocolP) { protocolM = protocolP; };
void SetAddress(const char *addressP) { strncpy(addressM, addressP, sizeof(addressM)); };
void SetParameter(int parameterP) { parameterM = parameterP; };
void SetYtdlp(int value) { useYtdlp = value; };
void SetXmlTvId(std::string id) { xmltvId = id; };
void SetHandlerType(char type) { handlerType = type; };
std::string ToString(char typeP) const;
bool Parse(const char *strP);
static int StrToProtocol(const char *prot);
static std::string ProtocolToStr(int prot);
};
class cIptvSourceParam : public cSourceParam {
private:
int paramM;
int ridM;
cChannel dataM;
cIptvTransponderParameters itpM;
const char *protocolsM[cIptvTransponderParameters::eProtocolCount];
private:
static const char *allowedProtocolCharsS;
public:
cIptvSourceParam(char sourceP, const char *descriptionP);
void SetData(cChannel *channelP) override;
void GetData(cChannel *channelP) override;
cOsdItem *GetOsdItem() override;
};