]> git.vomp.tv Git - vompserver.git/blob - vompclientrrproc.h
15 years that line of code has been waiting to crash
[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 getProtocolVersionMin();
56     static ULONG getProtocolVersionMax();
57     
58     bool init();
59     bool recvRequest(RequestPacket*);
60
61   private:
62     bool processPacket();
63     void sendPacket(SerializeBuffer *b);
64   
65 #ifndef VOMPSTANDALONE
66     int processGetRecordingsList();
67     int processDeleteRecording();
68     int processDeleteRecResume();
69     int processMoveRecording();
70     int processGetChannelsList();
71     int processStartStreamingChannel();
72     int processGetBlock();
73     int processStopStreaming();
74     int processStartStreamingRecording();
75     int processGetChannelSchedule();
76     int processGetTimers();
77     int processSetTimer();
78     int processPositionFromFrameNumber();
79     int processFrameNumberFromPosition();
80     int processGetIFrame();
81     int processGetRecInfo();
82     int processGetRecInfo2();
83     int processGetMarks();
84     int processGetChannelPids();
85     int processDeleteTimer();
86     int processReScanRecording();           // FIXME obselete
87     int processVDRShutdown();
88     int processGetRecScraperEventType();
89     int processGetScraperMovieInfo();
90     int processGetScraperSeriesInfo();
91     int processLoadTvMedia();
92     int processLoadTvMediaRecThumb();
93     int processGetEventScraperEventType();
94     int processLoadTvMediaEventThumb();
95     int processLoadChannelLogo();
96
97 #endif
98     int processLogin();
99     int processConfigSave();
100     int processConfigLoad();
101     int processGetMediaList();
102     int processOpenMedia();
103     int processGetMediaBlock();
104     int processGetMediaInfo();
105     int processCloseMediaChannel();
106     int processGetLanguageList();
107     int processGetLanguageContent();
108     int processSetCharset();
109     
110     void threadMethod();
111
112     VompClient& x;
113     RequestPacket* req;
114     RequestPacketQueue req_queue;
115     ResponsePacket* resp;
116     static ULONG VOMP_PROTOCOL_VERSION_MIN;
117     static ULONG VOMP_PROTOCOL_VERSION_MAX;
118     
119     Log* log;
120 };
121
122 #endif
123