This repository has been archived by the owner on Sep 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vdrcommand.h
176 lines (152 loc) · 5.56 KB
/
vdrcommand.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/*
Copyright 2004-2005 Chris Tallon, Andreas Vogel
This file is part of VOMP.
VOMP is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
VOMP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with VOMP; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef VDRCOMMAND_H
#define VDRCOMMAND_H
#include "defines.h"
#include "serialize.h"
#include "media.h"
/**
* data holder for VDR commands
* it's only important to add serializable objects
* in the same order on both sides
*/
//until we really have response - commands we simply take
//the request+this flag for responses
//not really necessary but for checks it's better to have a command ID at least in some responses
const static ULONG VDR_RESPONSE_FLAG =0x1000000;
//as this header is only included by vdr.cc the constants are this way private
//but can easily be used on the server side as well
const static ULONG VDR_LOGIN = 1;
const static ULONG VDR_GETRECORDINGLIST = 2;
const static ULONG VDR_DELETERECORDING = 3;
const static ULONG VDR_DELETERECRESUME = 4;
const static ULONG VDR_GETCHANNELLIST = 5;
const static ULONG VDR_STREAMCHANNEL = 6;
const static ULONG VDR_GETBLOCK = 7;
const static ULONG VDR_STOPSTREAMING = 8;
const static ULONG VDR_STREAMRECORDING = 9;
const static ULONG VDR_GETCHANNELSCHEDULE = 10;
const static ULONG VDR_CONFIGSAVE = 11;
const static ULONG VDR_CONFIGLOAD = 12;
const static ULONG VDR_RESCANRECORDING = 13; // FIXME obselete
const static ULONG VDR_GETTIMERS = 14;
const static ULONG VDR_SETTIMER = 15;
const static ULONG VDR_POSFROMFRAME = 16;
const static ULONG VDR_FRAMEFROMPOS = 17;
const static ULONG VDR_MOVERECORDING = 18;
const static ULONG VDR_GETNEXTIFRAME = 19;
const static ULONG VDR_GETRECINFO = 20;
const static ULONG VDR_GETRECINFO2 = 24;
const static ULONG VDR_GETMARKS = 21;
const static ULONG VDR_GETCHANNELPIDS = 22;
const static ULONG VDR_DELETETIMER = 23;
const static ULONG VDR_GETLANGUAGELIST = 33;
const static ULONG VDR_GETLANGUAGECONTENT = 34;
const static ULONG VDR_SETCHARSET = 37;
const static ULONG VDR_GETMEDIALIST = 30;
const static ULONG VDR_OPENMEDIA = 31;
const static ULONG VDR_GETMEDIABLOCK = 32;
const static ULONG VDR_GETMEDIAINFO = 35;
const static ULONG VDR_CLOSECHANNEL = 36;
const static ULONG VDR_GETRECSCRAPEREVENTTYPE = 38;
const static ULONG VDR_GETSCRAPERMOVIEINFO = 39;
const static ULONG VDR_GETSCRAPERSERIESINFO = 40;
const static ULONG VDR_LOADTVMEDIA =41;
const static ULONG VDR_LOADTVMEDIARECTHUMB =42;
const static ULONG VDR_GETEVENTSCRAPEREVENTTYPE = 43;
const static ULONG VDR_LOADTVMEDIAEVENTTHUMB =44;
const static ULONG VDR_LOADCHANNELLOGO = 45;
const static ULONG VDR_SHUTDOWN = 666;
class VDR_Command : public SerializableList {
public:
VDR_Command(const ULONG cmd) {
command=cmd;
addParam(&command);
}
virtual ~VDR_Command(){}
ULONG command;
};
class VDR_GetMediaListRequest : public VDR_Command {
public:
VDR_GetMediaListRequest(MediaURI *root) :VDR_Command(VDR_GETMEDIALIST) {
addParam(root);
}
};
class VDR_GetMediaListResponse : public VDR_Command {
public:
VDR_GetMediaListResponse(ULONG *flags,MediaList *m) : VDR_Command(VDR_GETMEDIALIST|VDR_RESPONSE_FLAG){
addParam(flags);
addParam(m);
}
};
class VDR_OpenMediumRequest : public VDR_Command {
public:
VDR_OpenMediumRequest(ULONG *channel,MediaURI *u,ULONG *xsize, ULONG *ysize) :
VDR_Command(VDR_OPENMEDIA) {
addParam(channel);
addParam(u);
addParam(xsize);
addParam(ysize);
}
};
class VDR_OpenMediumResponse : public VDR_Command {
public:
VDR_OpenMediumResponse(ULONG *flags,ULLONG *size) :
VDR_Command(VDR_OPENMEDIA|VDR_RESPONSE_FLAG) {
addParam(flags);
addParam(size);
}
};
class VDR_GetMediaBlockRequest : public VDR_Command {
public:
VDR_GetMediaBlockRequest(ULONG * channel, ULLONG *pos, ULONG *max):
VDR_Command(VDR_GETMEDIABLOCK) {
addParam(channel);
addParam(pos);
addParam(max);
}
};
//no response class for GetMediaBlock
class VDR_CloseMediaChannelRequest : public VDR_Command {
public:
VDR_CloseMediaChannelRequest(ULONG * channel):
VDR_Command(VDR_CLOSECHANNEL) {
addParam(channel);
}
};
class VDR_CloseMediaChannelResponse : public VDR_Command {
public:
VDR_CloseMediaChannelResponse(ULONG * flags):
VDR_Command(VDR_CLOSECHANNEL|VDR_RESPONSE_FLAG) {
addParam(flags);
}
};
class VDR_GetMediaInfoRequest : public VDR_Command {
public:
VDR_GetMediaInfoRequest(ULONG * channel):
VDR_Command(VDR_GETMEDIAINFO) {
addParam(channel);
}
};
class VDR_GetMediaInfoResponse : public VDR_Command {
public:
VDR_GetMediaInfoResponse(ULONG * flags,MediaInfo *info):
VDR_Command(VDR_GETMEDIAINFO|VDR_RESPONSE_FLAG) {
addParam(flags);
addParam(info);
}
};
#endif