Added the command-line parameter "-loop".


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@287 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/rfbplayer/rfbplayer.cxx b/rfbplayer/rfbplayer.cxx
index 552da3d..87f4886 100644
--- a/rfbplayer/rfbplayer.cxx
+++ b/rfbplayer/rfbplayer.cxx
@@ -64,7 +64,8 @@
  "                \t  is double speed, 0.5 is half speed. Default: 1.0.\r\n"
  "  -pos <ms>     \t- Sets initial time position in the session file,\r\n"
  "                \t  in milliseconds. Default: 0.\r\n"
- "  -autoplay     \t- Runs the player in the playback mode.\r\n";
+ "  -autoplay     \t- Runs the player in the playback mode.\r\n"
+ "  -loop         \t- Replays the rfb session.";
 
 // -=- RfbPlayer's defines
 
@@ -276,6 +277,7 @@
     disableTBandMenuItems();
     setTitle("None");
   }
+  init();
 }
 
 RfbPlayer::~RfbPlayer() {
@@ -1071,6 +1073,11 @@
   return 0;
 }
 
+void RfbPlayer::init() {
+  if (options.loopPlayback) CheckMenuItem(hMenu, ID_LOOP, MF_CHECKED);
+  else CheckMenuItem(hMenu, ID_LOOP, MF_UNCHECKED);
+}
+
 void RfbPlayer::closeSessionFile() {
   char speedStr[10];
   DWORD dwStyle;
@@ -1367,6 +1374,12 @@
       continue;
     }
 
+    if ((strcasecmp(argv[i], "-loop") == 0) ||
+        (strcasecmp(argv[i], "/loop") == 0) && (i < argc-1)) {
+      playerOptions.loopPlayback = true;
+      continue;
+    }
+
     if (i != argc - 1)
       return false;
   }