blob: 1bca34384cdbf47917a8c2dd6c4f03a6bab5ba97 [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
30// Supported pixel formats
31#define PF_AUTO 0
32#define PF_D8_RGB332 1
33#define PF_D16_RGB655 2
34#define PF_D24_RGB888 3
35#define PF_MODES 3
36
george827b1ebae2005-03-16 16:07:47 +000037// The R, G and B values order in the pixel
38#define RGB_ORDER 0
39#define RBG_ORDER 1
40#define GRB_ORDER 2
41#define GBR_ORDER 3
42#define BGR_ORDER 4
43#define BRG_ORDER 5
44
george825e7af742005-03-10 14:26:00 +000045// Default options values
46#define DEFAULT_PF PF_AUTO
47#define DEFAULT_INIT_TIME -1
48#define DEFAULT_SPEED 1.0
49#define DEFAULT_FRAME_SCALE 100
50#define DEFAULT_ACCEPT_BELL FALSE
51#define DEFAULT_ACCEPT_CUT_TEXT FALSE
52#define DEFAULT_LOOP_PLAYBACK FALSE
53#define DEFAULT_ASK_PF FALSE
54#define DEFAULT_AUTOPLAY FALSE
55#define DEFAULT_FULL_SCREEN FALSE
56#define DEFAULT_STORE_SETTINGS FALSE
57
george827b1ebae2005-03-16 16:07:47 +000058using namespace rfb;
59
george825e7af742005-03-10 14:26:00 +000060class PlayerOptions {
61public:
62 PlayerOptions();
63 void readFromRegistry();
64 void writeToRegistry();
65 void writeDefaults();
george827b1ebae2005-03-16 16:07:47 +000066 void setPF(PixelFormat *pf);
67 bool setPF(int rgb_order, int rm, int gm, int bm, bool big_endian=false);
george825e7af742005-03-10 14:26:00 +000068 long initTime;
69 double playbackSpeed;
70 bool autoPlay;
71 bool fullScreen;
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};