Constantin Kaplinsky | 729598c | 2006-05-25 05:12:25 +0000 | [diff] [blame^] | 1 | /* 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 | |
| 23 | using namespace rdr; |
| 24 | |
| 25 | class 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 interruptFrameDelay(); |
| 41 | void close(); |
| 42 | int pos(); |
| 43 | |
| 44 | private: |
| 45 | U8 *start; |
| 46 | int bufferSize; |
| 47 | long startTime; |
| 48 | long timeOffset; |
| 49 | long seekOffset; |
| 50 | double playbackSpeed; |
| 51 | bool seekBackwards; |
| 52 | bool paused; |
| 53 | bool interruptDelay; |
| 54 | |
| 55 | FILE *fbsFile; |
| 56 | |
| 57 | // overrun() - overrides InStream::overrun(). |
| 58 | // It is implemented to fill the data buffer from the session file. |
| 59 | // It ensures there are at least itemSize bytes of buffer data. Returns |
| 60 | // the number of items in the buffer (up to a maximum of nItems). itemSize |
| 61 | // is supposed to be "small" (a few bytes). |
| 62 | |
| 63 | int overrun(int itemSize, int nItems, bool wait); |
| 64 | |
| 65 | int readUnsigned32(); |
| 66 | bool readNByte(U8 *b, int n); |
| 67 | void waitWhilePaused(); |
| 68 | }; |