Implemented update the time position in the toolbar.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@118 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/rfbplayer/rfbplayer.cxx b/rfbplayer/rfbplayer.cxx
index 53c78ee..94513d1 100644
--- a/rfbplayer/rfbplayer.cxx
+++ b/rfbplayer/rfbplayer.cxx
@@ -210,6 +210,9 @@
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 @@
}
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() {