blob: a072b7f3af89f64f76d08c28cb2063b3481fdf00 [file] [log] [blame]
Constantin Kaplinskyfbfbb922004-11-14 18:28:51 +00001/* Copyright (C) 2004 TightVNC Team. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 */
18
19// -=- FbsInputStream.h
20
21#include <rdr/InStream.h>
22
23using namespace rdr;
24
25class FbsInputStream : public InStream {
26 public:
27 FbsInputStream(char *FileName);
28 ~FbsInputStream();
29
30 // Methods are used to contol the Rfb Stream
31 long getTimeOffset();
32 void setTimeOffset(long pos);
33 double getSpeed();
34 void setSpeed(double newSpeed);
35 bool isSeeking();
36 long getSeekOffset();
37 bool isPaused();
38 void pausePlayback();
39 void resumePlayback();
40 void close();
41 int pos();
42
43 private:
44 U8 *start;
45 int bufferSize;
46 long startTime;
47 long timeOffset;
48 long seekOffset;
49 double playbackSpeed;
50 bool seekBackwards;
51 bool paused;
52
53 FILE *fbsFile;
54
55 // overrun() - overrides InStream::overrun().
56 // It is implemented to fill the data buffer from the session file.
57 // It ensures there are at least itemSize bytes of buffer data. Returns
58 // the number of items in the buffer (up to a maximum of nItems). itemSize
59 // is supposed to be "small" (a few bytes).
60
61 int overrun(int itemSize, int nItems, bool wait);
62
63 int readUnsigned32();
64 bool readNByte(U8 *b, int n);
65 void waitWhilePaused();
66};