]> git.vomp.tv Git - vompserver.git/blob - vdrcommand.h
15 years that line of code has been waiting to crash
[vompserver.git] / vdrcommand.h
1 /*
2     Copyright 2004-2005 Chris Tallon, Andreas Vogel
3
4     This file is part of VOMP.
5
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.
10
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.
15
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.
19 */
20
21 #ifndef VDRCOMMAND_H
22 #define VDRCOMMAND_H
23
24 #include "defines.h"
25 #include "serialize.h"
26 #include "media.h"
27
28 /**
29   * data holder for VDR commands
30   * it's only important to add serializable objects
31   * in the same order on both sides
32   */
33
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 ULONG VDR_RESPONSE_FLAG =0x1000000;
38
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
41
42 const static ULONG VDR_LOGIN               = 1;
43 const static ULONG VDR_GETRECORDINGLIST    = 2;
44 const static ULONG VDR_DELETERECORDING     = 3;
45 const static ULONG VDR_DELETERECRESUME     = 4;
46 const static ULONG VDR_GETCHANNELLIST      = 5;
47 const static ULONG VDR_STREAMCHANNEL       = 6;
48 const static ULONG VDR_GETBLOCK            = 7;
49 const static ULONG VDR_STOPSTREAMING       = 8;
50 const static ULONG VDR_STREAMRECORDING     = 9;
51 const static ULONG VDR_GETCHANNELSCHEDULE  = 10;
52 const static ULONG VDR_CONFIGSAVE          = 11;
53 const static ULONG VDR_CONFIGLOAD          = 12;
54 const static ULONG VDR_RESCANRECORDING     = 13;  // FIXME obselete
55 const static ULONG VDR_GETTIMERS           = 14;
56 const static ULONG VDR_SETTIMER            = 15;
57 const static ULONG VDR_POSFROMFRAME        = 16;
58 const static ULONG VDR_FRAMEFROMPOS        = 17;
59 const static ULONG VDR_MOVERECORDING       = 18;
60 const static ULONG VDR_GETNEXTIFRAME       = 19;
61 const static ULONG VDR_GETRECINFO          = 20;
62 const static ULONG VDR_GETRECINFO2         = 24;
63 const static ULONG VDR_GETMARKS            = 21;
64 const static ULONG VDR_GETCHANNELPIDS      = 22;
65 const static ULONG VDR_DELETETIMER         = 23;
66 const static ULONG VDR_GETLANGUAGELIST     = 33;
67 const static ULONG VDR_GETLANGUAGECONTENT  = 34;
68 const static ULONG VDR_SETCHARSET          = 37;
69 const static ULONG VDR_GETMEDIALIST        = 30;
70 const static ULONG VDR_OPENMEDIA           = 31;
71 const static ULONG VDR_GETMEDIABLOCK       = 32;
72 const static ULONG VDR_GETMEDIAINFO        = 35;
73 const static ULONG VDR_CLOSECHANNEL        = 36;
74 const static ULONG VDR_GETRECSCRAPEREVENTTYPE = 38;
75 const static ULONG VDR_GETSCRAPERMOVIEINFO = 39;
76 const static ULONG VDR_GETSCRAPERSERIESINFO = 40;
77 const static ULONG VDR_LOADTVMEDIA          =41;
78 const static ULONG VDR_LOADTVMEDIARECTHUMB  =42;
79 const static ULONG VDR_GETEVENTSCRAPEREVENTTYPE = 43;
80 const static ULONG VDR_LOADTVMEDIAEVENTTHUMB  =44;
81 const static ULONG VDR_LOADCHANNELLOGO = 45;
82
83 const static ULONG VDR_SHUTDOWN            = 666;
84
85 class VDR_Command : public SerializableList {
86   public:
87     VDR_Command(const ULONG cmd) {
88       command=cmd;
89       addParam(&command);
90     }
91     virtual ~VDR_Command(){}
92     ULONG command;
93 };
94
95 class VDR_GetMediaListRequest : public VDR_Command {
96   public:
97     VDR_GetMediaListRequest(MediaURI *root) :VDR_Command(VDR_GETMEDIALIST) {
98       addParam(root);
99     }
100 };
101
102 class VDR_GetMediaListResponse : public VDR_Command {
103   public:
104     VDR_GetMediaListResponse(ULONG *flags,MediaList *m) : VDR_Command(VDR_GETMEDIALIST|VDR_RESPONSE_FLAG){
105       addParam(flags);
106       addParam(m);
107     }
108 };
109
110 class VDR_OpenMediumRequest : public VDR_Command {
111   public:
112     VDR_OpenMediumRequest(ULONG *channel,MediaURI *u,ULONG *xsize, ULONG *ysize) :
113       VDR_Command(VDR_OPENMEDIA) {
114         addParam(channel);
115         addParam(u);
116         addParam(xsize);
117         addParam(ysize);
118       }
119 };
120 class VDR_OpenMediumResponse : public VDR_Command {
121   public:
122     VDR_OpenMediumResponse(ULONG *flags,ULLONG *size) :
123       VDR_Command(VDR_OPENMEDIA|VDR_RESPONSE_FLAG) {
124         addParam(flags);
125         addParam(size);
126       }
127 };
128 class VDR_GetMediaBlockRequest : public VDR_Command {
129   public:
130     VDR_GetMediaBlockRequest(ULONG * channel, ULLONG *pos, ULONG *max):
131       VDR_Command(VDR_GETMEDIABLOCK) {
132         addParam(channel);
133         addParam(pos);
134         addParam(max);
135       }
136 };
137
138 //no response class for GetMediaBlock
139
140
141 class VDR_CloseMediaChannelRequest : public VDR_Command {
142   public:
143     VDR_CloseMediaChannelRequest(ULONG * channel):
144       VDR_Command(VDR_CLOSECHANNEL) {
145         addParam(channel);
146       }
147 };
148
149 class VDR_CloseMediaChannelResponse : public VDR_Command {
150   public:
151     VDR_CloseMediaChannelResponse(ULONG * flags):
152       VDR_Command(VDR_CLOSECHANNEL|VDR_RESPONSE_FLAG) {
153         addParam(flags);
154       }
155 };
156
157 class VDR_GetMediaInfoRequest : public VDR_Command {
158   public:
159     VDR_GetMediaInfoRequest(ULONG * channel):
160       VDR_Command(VDR_GETMEDIAINFO) {
161         addParam(channel);
162       }
163 };
164 class VDR_GetMediaInfoResponse : public VDR_Command {
165   public:
166     VDR_GetMediaInfoResponse(ULONG * flags,MediaInfo *info):
167       VDR_Command(VDR_GETMEDIAINFO|VDR_RESPONSE_FLAG) {
168         addParam(flags);
169         addParam(info);
170       }
171 };
172
173
174
175
176 #endif