]> git.vomp.tv Git - vompclient.git/blob - vdrcommand.h
Preparations for dynamic mode switching
[vompclient.git] / vdrcommand.h
1 /*\r
2     Copyright 2004-2005 Chris Tallon, Andreas Vogel\r
3 \r
4     This file is part of VOMP.\r
5 \r
6     VOMP is free software; you can redistribute it and/or modify\r
7     it under the terms of the GNU General Public License as published by\r
8     the Free Software Foundation; either version 2 of the License, or\r
9     (at your option) any later version.\r
10 \r
11     VOMP is distributed in the hope that it will be useful,\r
12     but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14     GNU General Public License for more details.\r
15 \r
16     You should have received a copy of the GNU General Public License\r
17     along with VOMP; if not, write to the Free Software\r
18     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
19 */\r
20 \r
21 #ifndef VDRCOMMAND_H\r
22 #define VDRCOMMAND_H\r
23 \r
24 #include "defines.h"\r
25 #include "serialize.h"\r
26 #include "media.h"\r
27 \r
28 /**\r
29   * data holder for VDR commands\r
30   * it's only important to add serializable objects\r
31   * in the same order on both sides\r
32   */\r
33 \r
34 //until we really have response - commands we simply take\r
35 //the request+this flag for responses\r
36 //not really necessary but for checks it's better to have a command ID at least in some responses\r
37 const static ULONG VDR_RESPONSE_FLAG =0x1000000;\r
38 \r
39 //as this header is only included by vdr.cc the constants are this way private\r
40 //but can easily be used on the server side as well\r
41 \r
42 const static ULONG VDR_LOGIN               = 1;\r
43 const static ULONG VDR_GETRECORDINGLIST    = 2;\r
44 const static ULONG VDR_DELETERECORDING     = 3;\r
45 const static ULONG VDR_GETCHANNELLIST      = 5;\r
46 const static ULONG VDR_STREAMCHANNEL       = 6;\r
47 const static ULONG VDR_GETBLOCK            = 7;\r
48 const static ULONG VDR_STOPSTREAMING       = 8;\r
49 const static ULONG VDR_STREAMRECORDING     = 9;\r
50 const static ULONG VDR_GETCHANNELSCHEDULE  = 10;\r
51 const static ULONG VDR_CONFIGSAVE          = 11;\r
52 const static ULONG VDR_CONFIGLOAD          = 12;\r
53 const static ULONG VDR_RESCANRECORDING     = 13;  // FIXME obselete\r
54 const static ULONG VDR_GETTIMERS           = 14;\r
55 const static ULONG VDR_SETTIMER            = 15;\r
56 const static ULONG VDR_POSFROMFRAME        = 16;\r
57 const static ULONG VDR_FRAMEFROMPOS        = 17;\r
58 const static ULONG VDR_MOVERECORDING       = 18;\r
59 const static ULONG VDR_GETNEXTIFRAME       = 19;\r
60 const static ULONG VDR_GETRECINFO          = 20;\r
61 const static ULONG VDR_GETMARKS            = 21;\r
62 const static ULONG VDR_GETCHANNELPIDS      = 22;\r
63 const static ULONG VDR_DELETETIMER         = 23;\r
64 const static ULONG VDR_GETLANGUAGELIST     = 33;\r
65 const static ULONG VDR_GETLANGUAGECONTENT  = 34;\r
66 const static ULONG VDR_SETCHARSET          = 37;\r
67 const static ULONG VDR_GETMEDIALIST        = 30;\r
68 const static ULONG VDR_OPENMEDIA           = 31;\r
69 const static ULONG VDR_GETMEDIABLOCK       = 32;\r
70 const static ULONG VDR_GETMEDIAINFO        = 35;\r
71 const static ULONG VDR_CLOSECHANNEL        = 36;\r
72 \r
73 class VDR_Command : public SerializableList {\r
74   public:\r
75     VDR_Command(const ULONG cmd) {\r
76       command=cmd;\r
77       addParam(&command);\r
78     }\r
79     virtual ~VDR_Command(){}\r
80     ULONG command;\r
81 };\r
82 \r
83 class VDR_GetMediaListRequest : public VDR_Command {\r
84   public:\r
85     VDR_GetMediaListRequest(MediaURI *root) :VDR_Command(VDR_GETMEDIALIST) {\r
86       addParam(root);\r
87     }\r
88 };\r
89 \r
90 class VDR_GetMediaListResponse : public VDR_Command {\r
91   public:\r
92     VDR_GetMediaListResponse(ULONG *flags,MediaList *m) : VDR_Command(VDR_GETMEDIALIST|VDR_RESPONSE_FLAG){\r
93       addParam(flags);\r
94       addParam(m);\r
95     }\r
96 };\r
97 \r
98 class VDR_OpenMediumRequest : public VDR_Command {\r
99   public:\r
100     VDR_OpenMediumRequest(ULONG *channel,MediaURI *u,ULONG *xsize, ULONG *ysize) :\r
101       VDR_Command(VDR_OPENMEDIA) {\r
102         addParam(channel);\r
103         addParam(u);\r
104         addParam(xsize);\r
105         addParam(ysize);\r
106       }\r
107 };\r
108 class VDR_OpenMediumResponse : public VDR_Command {\r
109   public:\r
110     VDR_OpenMediumResponse(ULONG *flags,ULLONG *size) :\r
111       VDR_Command(VDR_OPENMEDIA|VDR_RESPONSE_FLAG) {\r
112         addParam(flags);\r
113         addParam(size);\r
114       }\r
115 };\r
116 class VDR_GetMediaBlockRequest : public VDR_Command {\r
117   public:\r
118     VDR_GetMediaBlockRequest(ULONG * channel, ULLONG *pos, ULONG *max):\r
119       VDR_Command(VDR_GETMEDIABLOCK) {\r
120         addParam(channel);\r
121         addParam(pos);\r
122         addParam(max);\r
123       }\r
124 };\r
125 \r
126 //no response class for GetMediaBlock\r
127 \r
128 \r
129 class VDR_CloseMediaChannelRequest : public VDR_Command {\r
130   public:\r
131     VDR_CloseMediaChannelRequest(ULONG * channel):\r
132       VDR_Command(VDR_CLOSECHANNEL) {\r
133         addParam(channel);\r
134       }\r
135 };\r
136 \r
137 class VDR_CloseMediaChannelResponse : public VDR_Command {\r
138   public:\r
139     VDR_CloseMediaChannelResponse(ULONG * flags):\r
140       VDR_Command(VDR_CLOSECHANNEL|VDR_RESPONSE_FLAG) {\r
141         addParam(flags);\r
142       }\r
143 };\r
144 \r
145 class VDR_GetMediaInfoRequest : public VDR_Command {\r
146   public:\r
147     VDR_GetMediaInfoRequest(ULONG * channel):\r
148       VDR_Command(VDR_GETMEDIAINFO) {\r
149         addParam(channel);\r
150       }\r
151 };\r
152 class VDR_GetMediaInfoResponse : public VDR_Command {\r
153   public:\r
154     VDR_GetMediaInfoResponse(ULONG * flags,MediaInfo *info):\r
155       VDR_Command(VDR_GETMEDIAINFO|VDR_RESPONSE_FLAG) {\r
156         addParam(flags);\r
157         addParam(info);\r
158       }\r
159 };\r
160 \r
161 \r
162 \r
163 \r
164 #endif\r