george82 | 5e7af74 | 2005-03-10 14:26:00 +0000 | [diff] [blame] | 1 | /* 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 | |
george82 | 7b1ebae | 2005-03-16 16:07:47 +0000 | [diff] [blame] | 24 | #include <rfb/PixelFormat.h> |
| 25 | |
george82 | 5e7af74 | 2005-03-10 14:26:00 +0000 | [diff] [blame] | 26 | #include <rfb_win32/registry.h> |
| 27 | |
george82 | 5e7af74 | 2005-03-10 14:26:00 +0000 | [diff] [blame] | 28 | #define PF_MODES 3 |
| 29 | |
george82 | 7b1ebae | 2005-03-16 16:07:47 +0000 | [diff] [blame] | 30 | // The R, G and B values order in the pixel |
| 31 | #define RGB_ORDER 0 |
| 32 | #define RBG_ORDER 1 |
| 33 | #define GRB_ORDER 2 |
| 34 | #define GBR_ORDER 3 |
| 35 | #define BGR_ORDER 4 |
| 36 | #define BRG_ORDER 5 |
| 37 | |
george82 | 5e7af74 | 2005-03-10 14:26:00 +0000 | [diff] [blame] | 38 | // Default options values |
george82 | 34be1fa | 2005-03-20 09:50:09 +0000 | [diff] [blame] | 39 | //#define DEFAULT_PF 0 |
george82 | e827a0a | 2005-03-20 10:14:50 +0000 | [diff] [blame] | 40 | #define DEFAULT_PF_INDEX -1 |
george82 | 34be1fa | 2005-03-20 09:50:09 +0000 | [diff] [blame] | 41 | #define DEFAULT_AUTOPF TRUE |
george82 | 5e7af74 | 2005-03-10 14:26:00 +0000 | [diff] [blame] | 42 | #define DEFAULT_INIT_TIME -1 |
| 43 | #define DEFAULT_SPEED 1.0 |
| 44 | #define DEFAULT_FRAME_SCALE 100 |
| 45 | #define DEFAULT_ACCEPT_BELL FALSE |
| 46 | #define DEFAULT_ACCEPT_CUT_TEXT FALSE |
george82 | 8c37e42 | 2005-03-20 11:38:12 +0000 | [diff] [blame] | 47 | #define DEFAULT_BIG_ENDIAN FALSE |
george82 | 5e7af74 | 2005-03-10 14:26:00 +0000 | [diff] [blame] | 48 | #define DEFAULT_LOOP_PLAYBACK FALSE |
| 49 | #define DEFAULT_ASK_PF FALSE |
| 50 | #define DEFAULT_AUTOPLAY FALSE |
| 51 | #define DEFAULT_FULL_SCREEN FALSE |
george82 | 5e7af74 | 2005-03-10 14:26:00 +0000 | [diff] [blame] | 52 | |
george82 | 7b1ebae | 2005-03-16 16:07:47 +0000 | [diff] [blame] | 53 | using namespace rfb; |
| 54 | |
george82 | 5e7af74 | 2005-03-10 14:26:00 +0000 | [diff] [blame] | 55 | class PlayerOptions { |
| 56 | public: |
| 57 | PlayerOptions(); |
| 58 | void readFromRegistry(); |
| 59 | void writeToRegistry(); |
| 60 | void writeDefaults(); |
george82 | 7b1ebae | 2005-03-16 16:07:47 +0000 | [diff] [blame] | 61 | void setPF(PixelFormat *pf); |
| 62 | bool setPF(int rgb_order, int rm, int gm, int bm, bool big_endian=false); |
george82 | 5e7af74 | 2005-03-10 14:26:00 +0000 | [diff] [blame] | 63 | long initTime; |
| 64 | double playbackSpeed; |
| 65 | bool autoPlay; |
| 66 | bool fullScreen; |
george82 | 34be1fa | 2005-03-20 09:50:09 +0000 | [diff] [blame] | 67 | bool autoDetectPF; |
george82 | 8c37e42 | 2005-03-20 11:38:12 +0000 | [diff] [blame] | 68 | bool bigEndianFlag; |
george82 | 0981b34 | 2005-03-19 11:19:00 +0000 | [diff] [blame] | 69 | long pixelFormatIndex; |
| 70 | PixelFormat pixelFormat; |
george82 | 5e7af74 | 2005-03-10 14:26:00 +0000 | [diff] [blame] | 71 | bool acceptBell; |
| 72 | bool acceptCutText; |
| 73 | bool loopPlayback; |
| 74 | bool askPixelFormat; |
| 75 | long frameScale; |
george82 | dfb557b | 2005-03-21 18:26:50 +0000 | [diff] [blame] | 76 | bool commandLineParam; |
george82 | 5e7af74 | 2005-03-10 14:26:00 +0000 | [diff] [blame] | 77 | }; |