]> source.dussan.org Git - tigervnc.git/commitdiff
Implemented update the time position in the toolbar.
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Mon, 24 Jan 2005 11:09:08 +0000 (11:09 +0000)
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Mon, 24 Jan 2005 11:09:08 +0000 (11:09 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@118 3789f03b-4d11-0410-bbf8-ca57d06f2519

rfbplayer/rfbplayer.cxx
rfbplayer/rfbplayer.h

index 53c78eea80f5d98d163dbbfe74b39fc029d38b23..94513d15b46a41a8fd1b6fea4834a47e115413fa 100644 (file)
@@ -210,6 +210,9 @@ RfbPlayer::RfbPlayer(char *_fileName, long _initTime = 0, double _playbackSpeed
   else
     CTRL_BAR_HEIGHT = 0;
 
+  // Reset the full session time
+  strcpy(fullSessionTime, "00m:00s");
+
   // Create the main window
   const TCHAR* name = _T("RfbPlayer");
   mainHwnd = CreateWindow((const TCHAR*)baseClass.classAtom, name, WS_OVERLAPPEDWINDOW,
@@ -752,7 +755,28 @@ long RfbPlayer::getTimeOffset() {
 }
 
 void RfbPlayer::updatePos() {
+  char timePos[30] = "\0";
   long newPos = is->getTimeOffset() / 1000;
+  time_pos_m = newPos / 60;
+  time_pos_s = newPos % 60;
+  if (time_pos_m < 10) {
+    strcat(timePos, "0");
+    _itoa(time_pos_m, timePos+1, 10);
+  } else {
+    _itoa(time_pos_m, timePos, 10);
+  }
+  strcat(timePos, "m:");
+  if (time_pos_s < 10) {
+    strcat(timePos, "0");
+    _itoa(time_pos_s, timePos+strlen(timePos), 10);
+  } else {
+    _itoa(time_pos_s, timePos+strlen(timePos), 10);
+  }
+  strcat(timePos, "s ");
+  strcat(timePos, "(");
+  strcat(timePos, fullSessionTime);
+  strcat(timePos, ")");
+  SetWindowText(timeStatic, timePos);
 }
 
 void RfbPlayer::skipHandshaking() {
index 3d34991c3b00fb2e2ca70329f4e24bf04ec1acff..447fcd8bbc95aec0486778f3123f673b4e22608c 100644 (file)
@@ -135,8 +135,11 @@ class RfbPlayer : public Thread, public RfbProto{
   private:
     bool seekMode;
     long lastPos;
+    char fullSessionTime[20];
+    int time_pos_m;
+    int time_pos_s;
     int CTRL_BAR_HEIGHT;
-
+    
   protected:
 
     // Returns true if part of the supplied rect is visible, false otherwise