PlayerOptions::pixelFormat changed to pixelFormatIndex.
Added new property pixelFormat to PlayerOptions class.
Added supportedPF to RfbPlayer class.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@252 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/rfbplayer/rfbplayer.cxx b/rfbplayer/rfbplayer.cxx
index 6de2810..d2bd1d6 100644
--- a/rfbplayer/rfbplayer.cxx
+++ b/rfbplayer/rfbplayer.cxx
@@ -25,6 +25,7 @@
 #include <rfb_win32/Win32Util.h>
 #include <rfb_win32/WMShatter.h> 
 
+#include <rfbplayer/PixelFormatList.h>
 #include <rfbplayer/rfbplayer.h>
 
 using namespace rfb;
@@ -60,6 +61,7 @@
 // -=- RfbPlayer's defines
 
 #define strcasecmp _stricmp
+#define UPF_REGISTRY_PATH "Software\\TightVnc\\RfbPlayer\\UserDefinedPF"
 #define MAX_SPEED 10.00
 #define CALCULATION_ERROR MAX_SPEED / 1000
 #define MAX_POS_TRACKBAR_RANGE 50
@@ -226,6 +228,9 @@
   // Reset the full session time
   strcpy(fullSessionTime, "00m:00s");
 
+  // Load the user defined pixel formats from the registry
+  supportedPF.readUserDefinedPF(HKEY_CURRENT_USER, UPF_REGISTRY_PATH);
+
   // Create the main window
   const TCHAR* name = _T("RfbPlayer");
   int x = max(0, (GetSystemMetrics(SM_CXSCREEN) - DEFAULT_PLAYER_WIDTH) / 2);
@@ -894,7 +899,7 @@
       throw rdr::Exception("[TERMINATE]");
     }
   } else {
-    pixelFormat = options.pixelFormat;
+    pixelFormat = options.pixelFormatIndex;
   }
   switch (pixelFormat) {
   case PF_AUTO: 
@@ -1228,7 +1233,7 @@
       if ((pf < 0) || (pf > PF_MODES)) {
         return false;
       }
-      playerOptions.pixelFormat = pf;
+      playerOptions.pixelFormatIndex = pf;
       continue;
     }