2 Copyright 2004-2019 Chris Tallon, Andreas Vogel
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 #include "serialize.h"
29 * data holder for VDR commands
30 * it's only important to add serializable objects
31 * in the same order on both sides
34 //until we really have response - commands we simply take
35 //the request+this flag for responses
36 //not really necessary but for checks it's better to have a command ID at least in some responses
37 const static u4 VDR_RESPONSE_FLAG =0x1000000;
39 //as this header is only included by vdr.cc the constants are this way private
40 //but can easily be used on the server side as well
42 const static u4 VDR_LOGIN = 1;
43 const static u4 VDR_GETRECORDINGLIST = 2;
44 const static u4 VDR_DELETERECORDING = 3;
45 const static u4 VDR_DELETERECRESUME = 4;
46 const static u4 VDR_GETCHANNELLIST = 5;
47 const static u4 VDR_STREAMCHANNEL = 6;
48 const static u4 VDR_GETBLOCK = 7;
49 const static u4 VDR_STOPSTREAMING = 8;
50 const static u4 VDR_STREAMRECORDING = 9;
51 const static u4 VDR_GETCHANNELSCHEDULE = 10;
52 const static u4 VDR_CONFIGSAVE = 11;
53 const static u4 VDR_CONFIGLOAD = 12;
54 const static u4 VDR_RESCANRECORDING = 13; // FIXME obselete
55 const static u4 VDR_GETTIMERS = 14;
56 const static u4 VDR_SETTIMER = 15;
57 const static u4 VDR_POSFROMFRAME = 16;
58 const static u4 VDR_FRAMEFROMPOS = 17;
59 const static u4 VDR_MOVERECORDING = 18;
60 const static u4 VDR_GETNEXTIFRAME = 19;
61 // const static u4 VDR_GETRECINFO = 20;
62 const static u4 VDR_GETRECINFO2 = 24;
63 const static u4 VDR_GETMARKS = 21;
64 const static u4 VDR_GETCHANNELPIDS = 22;
65 const static u4 VDR_DELETETIMER = 23;
66 const static u4 VDR_GETLANGUAGELIST = 33;
67 const static u4 VDR_GETLANGUAGECONTENT = 34;
68 const static u4 VDR_SETCHARSET = 37;
69 const static u4 VDR_GETMEDIALIST = 30;
70 const static u4 VDR_OPENMEDIA = 31;
71 const static u4 VDR_GETMEDIABLOCK = 32;
72 const static u4 VDR_GETMEDIAINFO = 35;
73 const static u4 VDR_CLOSECHANNEL = 36;
74 const static u4 VDR_GETRECSCRAPEREVENTTYPE = 38;
75 const static u4 VDR_GETSCRAPERMOVIEINFO = 39;
76 const static u4 VDR_GETSCRAPERSERIESINFO = 40;
77 const static u4 VDR_LOADTVMEDIA = 41;
78 const static u4 VDR_LOADTVMEDIARECTHUMB = 42;
79 const static u4 VDR_GETEVENTSCRAPEREVENTTYPE = 43;
80 const static u4 VDR_LOADTVMEDIAEVENTTHUMB = 44;
81 const static u4 VDR_LOADCHANNELLOGO = 45;
82 const static u4 VDR_SHUTDOWN = 666;
83 #ifdef VOMP_MEDIAPLAYER
84 class VDR_Command : public SerializableList {
86 VDR_Command(const u4 cmd) {
90 virtual ~VDR_Command(){}
94 class VDR_GetMediaListRequest : public VDR_Command {
96 VDR_GetMediaListRequest(MediaURI *root) :VDR_Command(VDR_GETMEDIALIST) {
101 class VDR_GetMediaListResponse : public VDR_Command {
103 VDR_GetMediaListResponse(u4 *flags,MediaList *m) : VDR_Command(VDR_GETMEDIALIST|VDR_RESPONSE_FLAG){
109 class VDR_OpenMediumRequest : public VDR_Command {
111 VDR_OpenMediumRequest(u4 *channel,MediaURI *u,u4 *xsize, u4 *ysize) :
112 VDR_Command(VDR_OPENMEDIA) {
119 class VDR_OpenMediumResponse : public VDR_Command {
121 VDR_OpenMediumResponse(u4 *flags,u8 *size) :
122 VDR_Command(VDR_OPENMEDIA|VDR_RESPONSE_FLAG) {
127 class VDR_GetMediaBlockRequest : public VDR_Command {
129 VDR_GetMediaBlockRequest(u4 * channel, u8 *pos, u4 *max):
130 VDR_Command(VDR_GETMEDIABLOCK) {
137 //no response class for GetMediaBlock
140 class VDR_CloseMediaChannelRequest : public VDR_Command {
142 VDR_CloseMediaChannelRequest(u4 * channel):
143 VDR_Command(VDR_CLOSECHANNEL) {
148 class VDR_CloseMediaChannelResponse : public VDR_Command {
150 VDR_CloseMediaChannelResponse(u4 * flags):
151 VDR_Command(VDR_CLOSECHANNEL|VDR_RESPONSE_FLAG) {
156 class VDR_GetMediaInfoRequest : public VDR_Command {
158 VDR_GetMediaInfoRequest(u4 * channel):
159 VDR_Command(VDR_GETMEDIAINFO) {
163 class VDR_GetMediaInfoResponse : public VDR_Command {
165 VDR_GetMediaInfoResponse(u4 * flags,MediaInfo *info):
166 VDR_Command(VDR_GETMEDIAINFO|VDR_RESPONSE_FLAG) {