]> git.vomp.tv Git - vompserver.git/blob - vompclientrrproc.h
Merge branch '0-4-1-dev' of git.vomp.tv:/vompserver
[vompserver.git] / vompclientrrproc.h
1 /*
2     Copyright 2008 Chris Tallon
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 VOMPCLIENTRRPROC_H
22 #define VOMPCLIENTRRPROC_H
23
24 #include "thread.h"
25 #include "responsepacket.h"
26 #include <queue>
27 #include "serialize.h"
28
29 extern bool ResumeIDLock;
30
31 using namespace std;
32
33 class VompClient;
34 class Log;
35
36 class RequestPacket
37 {
38   public:
39     RequestPacket(ULONG requestID, ULONG opcode, UCHAR* data, ULONG dataLength)
40      : requestID(requestID), opcode(opcode), data(data), dataLength(dataLength) {}
41     
42     ULONG requestID;
43     ULONG opcode;
44     UCHAR* data;
45     ULONG dataLength;
46 };
47
48 typedef queue<RequestPacket*> RequestPacketQueue;
49
50 class VompClientRRProc : public Thread
51 {
52   public:
53     VompClientRRProc(VompClient& x);
54     ~VompClientRRProc();
55     static ULONG getProtocolVersion();
56     
57     bool init();
58     bool recvRequest(RequestPacket*);
59
60   private:
61     bool processPacket();
62     void sendPacket(SerializeBuffer *b);
63   
64 #ifndef VOMPSTANDALONE
65     int processGetRecordingsList();
66     int processDeleteRecording();
67     int processMoveRecording();
68     int processGetChannelsList();
69     int processStartStreamingChannel();
70     int processGetBlock();
71     int processStopStreaming();
72     int processStartStreamingRecording();
73     int processGetChannelSchedule();
74     int processGetTimers();
75     int processSetTimer();
76     int processPositionFromFrameNumber();
77     int processFrameNumberFromPosition();
78     int processGetIFrame();
79     int processGetRecInfo();
80     int processGetMarks();
81     int processGetChannelPids();
82     int processDeleteTimer();
83     int processReScanRecording();           // FIXME obselete
84     int processVDRShutdown();
85 #endif
86     int processLogin();
87     int processConfigSave();
88     int processConfigLoad();
89     int processGetMediaList();
90     int processOpenMedia();
91     int processGetMediaBlock();
92     int processGetMediaInfo();
93     int processCloseMediaChannel();
94     int processGetLanguageList();
95     int processGetLanguageContent();
96     int processSetCharset();
97     
98     void threadMethod();
99
100     VompClient& x;
101     RequestPacket* req;
102     RequestPacketQueue req_queue;
103     ResponsePacket* resp;
104     static ULONG VOMP_PROTOCOL_VERSION;
105     
106     Log* log;
107 };
108
109 #endif
110