]> git.vomp.tv Git - vompserver.git/blob - vompclientrrproc.h
Add forgotten vdrcommand.h changes
[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 processMoveRecording();
69     int processGetChannelsList();
70     int processStartStreamingChannel();
71     int processGetBlock();
72     int processStopStreaming();
73     int processStartStreamingRecording();
74     int processGetChannelSchedule();
75     int processGetTimers();
76     int processSetTimer();
77     int processPositionFromFrameNumber();
78     int processFrameNumberFromPosition();
79     int processGetIFrame();
80     int processGetRecInfo();
81     int processGetMarks();
82     int processGetChannelPids();
83     int processDeleteTimer();
84     int processReScanRecording();           // FIXME obselete
85     int processVDRShutdown();
86     int processGetRecScraperEventType();
87     int processGetScraperMovieInfo();
88     int processGetScraperSeriesInfo();
89     int processLoadTvMedia();
90 #endif
91     int processLogin();
92     int processConfigSave();
93     int processConfigLoad();
94     int processGetMediaList();
95     int processOpenMedia();
96     int processGetMediaBlock();
97     int processGetMediaInfo();
98     int processCloseMediaChannel();
99     int processGetLanguageList();
100     int processGetLanguageContent();
101     int processSetCharset();
102     
103     void threadMethod();
104
105     VompClient& x;
106     RequestPacket* req;
107     RequestPacketQueue req_queue;
108     ResponsePacket* resp;
109     static ULONG VOMP_PROTOCOL_VERSION_MIN;
110     static ULONG VOMP_PROTOCOL_VERSION_MAX;
111     
112     Log* log;
113 };
114
115 #endif
116