]> git.vomp.tv Git - vompserver.git/blob - vompclientrrproc.h
VDR 1.7.7 compatibility
[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     
56     bool init();
57     bool recvRequest(RequestPacket*);
58
59   private:
60     bool processPacket();
61     void sendPacket(SerializeBuffer *b);
62   
63 #ifndef VOMPSTANDALONE
64     int processGetRecordingsList();
65     int processDeleteRecording();
66     int processMoveRecording();
67     int processGetChannelsList();
68     int processStartStreamingChannel();
69     int processGetBlock();
70     int processStopStreaming();
71     int processStartStreamingRecording();
72     int processGetChannelSchedule();
73     int processGetTimers();
74     int processSetTimer();
75     int processPositionFromFrameNumber();
76     int processFrameNumberFromPosition();
77     int processGetIFrame();
78     int processGetRecInfo();
79     int processGetMarks();
80     int processGetChannelPids();
81     int processDeleteTimer();
82     int processReScanRecording();           // FIXME obselete
83 #endif
84     int processLogin();
85     int processConfigSave();
86     int processConfigLoad();
87     int processGetMediaList();
88     int processOpenMedia();
89     int processGetMediaBlock();
90     int processGetMediaInfo();
91     int processCloseMediaChannel();
92     int processGetLanguageList();
93     int processGetLanguageContent();
94
95     void threadMethod();
96
97     VompClient& x;
98     RequestPacket* req;
99     RequestPacketQueue req_queue;
100     ResponsePacket* resp;
101     
102     Log* log;
103 };
104
105 #endif
106