summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2005-02-05 08:48:22 +0000
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2005-02-05 08:48:22 +0000
commit57f1352be5e0ee9eb5d0dc9f56b698bd0334ca20 (patch)
tree098dc237490368fb30967935600284e39ff659b8
parente9fc68a0e25a31b36f89362d59be9b4cc85a08c5 (diff)
downloadtigervnc-57f1352be5e0ee9eb5d0dc9f56b698bd0334ca20.tar.gz
tigervnc-57f1352be5e0ee9eb5d0dc9f56b698bd0334ca20.zip
Added RfbPlayer::calculateSessionTime().
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@141 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--rfbplayer/rfbplayer.cxx18
-rw-r--r--rfbplayer/rfbplayer.h3
2 files changed, 21 insertions, 0 deletions
diff --git a/rfbplayer/rfbplayer.cxx b/rfbplayer/rfbplayer.cxx
index afadf3fb..4b2f14b2 100644
--- a/rfbplayer/rfbplayer.cxx
+++ b/rfbplayer/rfbplayer.cxx
@@ -787,6 +787,24 @@ bool RfbPlayer::invalidateBufferRect(const Rect& crect) {
return true;
}
+long RfbPlayer::calculateSessionTime(char *filename) {
+ FbsInputStream sessionFile(filename);
+ sessionFile.setSpeed(1000);
+ try {
+ while (TRUE) {
+ sessionFile.skip(1024);
+ }
+ } catch (rdr::Exception e) {
+ if (strcmp(e.str(), "[End Of File]") == 0) {
+ return sessionFile.getTimeOffset() / 1000;
+ } else {
+ MessageBox(getMainHandle(), e.str(), e.type(), MB_OK | MB_ICONERROR);
+ return 0;
+ }
+ }
+ return 0;
+}
+
void RfbPlayer::openSessionFile(char *_fileName) {
fileName = strDup(_fileName);
diff --git a/rfbplayer/rfbplayer.h b/rfbplayer/rfbplayer.h
index 5896f278..09f27367 100644
--- a/rfbplayer/rfbplayer.h
+++ b/rfbplayer/rfbplayer.h
@@ -110,6 +110,9 @@ class RfbPlayer : public RfbProto {
// -=- Player functions
+ // calculateSessionTime() calculates the full session time in sec
+ long calculateSessionTime(char *fileName);
+
// openSessionFile() opens the new session file and starts play it
void openSessionFile(char *fileName);