]> git.vomp.tv Git - vompclient.git/blob - vdrcommand.h
Deactivate set power state, it seems to cause trouble
[vompclient.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_GETCHANNELLIST      = 5;
46 const static ULONG VDR_STREAMCHANNEL       = 6;
47 const static ULONG VDR_GETBLOCK            = 7;
48 const static ULONG VDR_STOPSTREAMING       = 8;
49 const static ULONG VDR_STREAMRECORDING     = 9;
50 const static ULONG VDR_GETCHANNELSCHEDULE  = 10;
51 const static ULONG VDR_CONFIGSAVE          = 11;
52 const static ULONG VDR_CONFIGLOAD          = 12;
53 const static ULONG VDR_RESCANRECORDING     = 13;  // FIXME obselete
54 const static ULONG VDR_GETTIMERS           = 14;
55 const static ULONG VDR_SETTIMER            = 15;
56 const static ULONG VDR_POSFROMFRAME        = 16;
57 const static ULONG VDR_FRAMEFROMPOS        = 17;
58 const static ULONG VDR_MOVERECORDING       = 18;
59 const static ULONG VDR_GETNEXTIFRAME       = 19;
60 const static ULONG VDR_GETRECINFO          = 20;
61 const static ULONG VDR_GETMARKS            = 21;
62 const static ULONG VDR_GETCHANNELPIDS      = 22;
63 const static ULONG VDR_DELETETIMER         = 23;
64 const static ULONG VDR_GETLANGUAGELIST     = 33;
65 const static ULONG VDR_GETLANGUAGECONTENT  = 34;
66 const static ULONG VDR_SETCHARSET          = 37;
67 const static ULONG VDR_GETMEDIALIST        = 30;
68 const static ULONG VDR_OPENMEDIA           = 31;
69 const static ULONG VDR_GETMEDIABLOCK       = 32;
70 const static ULONG VDR_GETMEDIAINFO        = 35;
71 const static ULONG VDR_CLOSECHANNEL        = 36;
72 const static ULONG VDR_SHUTDOWN            = 666;
73
74 class VDR_Command : public SerializableList {
75   public:
76     VDR_Command(const ULONG cmd) {
77       command=cmd;
78       addParam(&command);
79     }
80     virtual ~VDR_Command(){}
81     ULONG command;
82 };
83
84 class VDR_GetMediaListRequest : public VDR_Command {
85   public:
86     VDR_GetMediaListRequest(MediaURI *root) :VDR_Command(VDR_GETMEDIALIST) {
87       addParam(root);
88     }
89 };
90
91 class VDR_GetMediaListResponse : public VDR_Command {
92   public:
93     VDR_GetMediaListResponse(ULONG *flags,MediaList *m) : VDR_Command(VDR_GETMEDIALIST|VDR_RESPONSE_FLAG){
94       addParam(flags);
95       addParam(m);
96     }
97 };
98
99 class VDR_OpenMediumRequest : public VDR_Command {
100   public:
101     VDR_OpenMediumRequest(ULONG *channel,MediaURI *u,ULONG *xsize, ULONG *ysize) :
102       VDR_Command(VDR_OPENMEDIA) {
103         addParam(channel);
104         addParam(u);
105         addParam(xsize);
106         addParam(ysize);
107       }
108 };
109 class VDR_OpenMediumResponse : public VDR_Command {
110   public:
111     VDR_OpenMediumResponse(ULONG *flags,ULLONG *size) :
112       VDR_Command(VDR_OPENMEDIA|VDR_RESPONSE_FLAG) {
113         addParam(flags);
114         addParam(size);
115       }
116 };
117 class VDR_GetMediaBlockRequest : public VDR_Command {
118   public:
119     VDR_GetMediaBlockRequest(ULONG * channel, ULLONG *pos, ULONG *max):
120       VDR_Command(VDR_GETMEDIABLOCK) {
121         addParam(channel);
122         addParam(pos);
123         addParam(max);
124       }
125 };
126
127 //no response class for GetMediaBlock
128
129
130 class VDR_CloseMediaChannelRequest : public VDR_Command {
131   public:
132     VDR_CloseMediaChannelRequest(ULONG * channel):
133       VDR_Command(VDR_CLOSECHANNEL) {
134         addParam(channel);
135       }
136 };
137
138 class VDR_CloseMediaChannelResponse : public VDR_Command {
139   public:
140     VDR_CloseMediaChannelResponse(ULONG * flags):
141       VDR_Command(VDR_CLOSECHANNEL|VDR_RESPONSE_FLAG) {
142         addParam(flags);
143       }
144 };
145
146 class VDR_GetMediaInfoRequest : public VDR_Command {
147   public:
148     VDR_GetMediaInfoRequest(ULONG * channel):
149       VDR_Command(VDR_GETMEDIAINFO) {
150         addParam(channel);
151       }
152 };
153 class VDR_GetMediaInfoResponse : public VDR_Command {
154   public:
155     VDR_GetMediaInfoResponse(ULONG * flags,MediaInfo *info):
156       VDR_Command(VDR_GETMEDIAINFO|VDR_RESPONSE_FLAG) {
157         addParam(flags);
158         addParam(info);
159       }
160 };
161
162
163
164
165 #endif