home *** CD-ROM | disk | FTP | other *** search
- /* START_LICENSE_HEADER
-
- Copyright (C) 2000 Martin Piper, original design and program code
- Copyright (C) 2001-2005 Replica Software
-
- This program file is copyright (C) Replica Software and can only be used under license.
- For more information visit: http://www.replicanet.com/
- Or email: info@replicanet.com
-
- END_LICENSE_HEADER */
- /*
- See MyReplicaNet.cpp
- */
- #ifndef _MYREPLICANET_H_
- #define _MYREPLICANET_H_
- #include <stdio.h>
- #include "RNReplicaNet/Inc/ReplicaNet.h"
-
- // Create our own ReplicaNet derived class to implement compressed recordings.
- class MyReplicaNet : public RNReplicaNet::ReplicaNet
- {
- public:
- MyReplicaNet();
- virtual ~MyReplicaNet();
-
- /// Sets the file pointer used for the recording.
- void SetRecordingFilePointer(FILE *fp);
-
- /// Forces any data in the buffer to be compressed and saved to the file.
- void ForceCompress(void);
-
- /// The recording callbacks from ReplicaNet
- virtual bool CallbackSessionRecord(const void *data,const int length);
- virtual bool CallbackSessionPlayback(void *data,const int length);
-
-
- enum
- {
- kBufferSize = 64 * 1024 // 64K of buffer
- };
-
- private:
- FILE *mFP;
- char mBuffer[kBufferSize];
- size_t mOutBytesUsed; // The number of output bytes used in the buffer.
- size_t mInBytesUsed; // The number of output bytes used in the buffer.
- char *mInBufferPosition; // The input buffer position pointer.
- };
-
- #endif
-