blob: c4238d3206ffb50d5a51b8aea25c76977f3068b4 [file] [log] [blame]
george825e7af742005-03-10 14:26:00 +00001/* Copyright (C) 2004 TightVNC Team. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 */
18
19// -=- PlayerOptions.h
20
21// Definition of the PlayerOptions class, responsible for
22// storing & retrieving the RfbPlayer's options.
23
24#include <windows.h>
25
george827b1ebae2005-03-16 16:07:47 +000026#include <rfb/PixelFormat.h>
27
george825e7af742005-03-10 14:26:00 +000028#include <rfb_win32/registry.h>
29
george825e7af742005-03-10 14:26:00 +000030#define PF_MODES 3
31
george827b1ebae2005-03-16 16:07:47 +000032// The R, G and B values order in the pixel
33#define RGB_ORDER 0
34#define RBG_ORDER 1
35#define GRB_ORDER 2
36#define GBR_ORDER 3
37#define BGR_ORDER 4
38#define BRG_ORDER 5
39
george825e7af742005-03-10 14:26:00 +000040// Default options values
george8234be1fa2005-03-20 09:50:09 +000041//#define DEFAULT_PF 0
george82e827a0a2005-03-20 10:14:50 +000042#define DEFAULT_PF_INDEX -1
george8234be1fa2005-03-20 09:50:09 +000043#define DEFAULT_AUTOPF TRUE
george825e7af742005-03-10 14:26:00 +000044#define DEFAULT_INIT_TIME -1
45#define DEFAULT_SPEED 1.0
46#define DEFAULT_FRAME_SCALE 100
47#define DEFAULT_ACCEPT_BELL FALSE
48#define DEFAULT_ACCEPT_CUT_TEXT FALSE
george828c37e422005-03-20 11:38:12 +000049#define DEFAULT_BIG_ENDIAN FALSE
george825e7af742005-03-10 14:26:00 +000050#define DEFAULT_LOOP_PLAYBACK FALSE
51#define DEFAULT_ASK_PF FALSE
52#define DEFAULT_AUTOPLAY FALSE
53#define DEFAULT_FULL_SCREEN FALSE
54#define DEFAULT_STORE_SETTINGS FALSE
55
george827b1ebae2005-03-16 16:07:47 +000056using namespace rfb;
57
george825e7af742005-03-10 14:26:00 +000058class PlayerOptions {
59public:
60 PlayerOptions();
61 void readFromRegistry();
62 void writeToRegistry();
63 void writeDefaults();
george827b1ebae2005-03-16 16:07:47 +000064 void setPF(PixelFormat *pf);
65 bool setPF(int rgb_order, int rm, int gm, int bm, bool big_endian=false);
george825e7af742005-03-10 14:26:00 +000066 long initTime;
67 double playbackSpeed;
68 bool autoPlay;
69 bool fullScreen;
george8234be1fa2005-03-20 09:50:09 +000070 bool autoDetectPF;
george828c37e422005-03-20 11:38:12 +000071 bool bigEndianFlag;
george820981b342005-03-19 11:19:00 +000072 long pixelFormatIndex;
73 PixelFormat pixelFormat;
george825e7af742005-03-10 14:26:00 +000074 bool acceptBell;
75 bool acceptCutText;
76 bool loopPlayback;
77 bool askPixelFormat;
78 long frameScale;
79 bool autoStoreSettings;
80};