]> git.sesse.net Git - vlc/blob - modules/video_filter/atmo/AtmoConfig.h
Remove useless test before a free().
[vlc] / modules / video_filter / atmo / AtmoConfig.h
1 /*
2  * AtmoConfig.h: Class for holding all configuration values of AtmoWin
3  *
4  * See the README.txt file for copyright information and how to reach the author(s).
5  *
6  * $Id$
7  */
8
9 #ifndef _AtmoConfig_h_
10 #define _AtmoConfig_h_
11
12 #include "AtmoDefs.h"
13 #include "AtmoZoneDefinition.h"
14
15 #if defined(_ATMO_VLC_PLUGIN_)
16 #   include <stdlib.h>
17 #   include <string.h>
18 #endif
19
20
21 class CAtmoConfig {
22
23     protected:
24            int m_IsShowConfigDialog;    
25 #if defined(_ATMO_VLC_PLUGIN_)
26        char *m_devicename;
27 #else
28            int m_Comport;
29 #endif
30        enum AtmoConnectionType m_eAtmoConnectionType;
31        enum EffectMode m_eEffectMode;
32
33     protected:
34        ATMO_BOOL m_UseSoftwareWhiteAdj;
35        int m_WhiteAdjustment_Red;
36        int m_WhiteAdjustment_Green;
37        int m_WhiteAdjustment_Blue;
38
39     protected:
40        int m_IsSetShutdownColor;
41            int m_ShutdownColor_Red;
42            int m_ShutdownColor_Green;
43            int m_ShutdownColor_Blue;
44
45     protected:
46        /* Config Values for Color Changer */
47        int m_ColorChanger_iSteps;
48        int m_ColorChanger_iDelay;
49
50     protected:
51         /* Config  values for the primitive Left Right Color Changer */
52        int m_LrColorChanger_iSteps;
53        int m_LrColorChanger_iDelay;
54
55     protected:
56        /* the static background color */
57        int m_StaticColor_Red;
58        int m_StaticColor_Green;
59        int m_StaticColor_Blue;
60
61     protected:
62         /*
63            one for System + 9 for userdefined channel
64            assignments (will it be enough?)
65         */
66         tChannelAssignment *m_ChannelAssignments[10];
67         int m_CurrentChannelAssignment;
68
69     protected:
70         CAtmoZoneDefinition *m_ZoneDefinitions[ATMO_NUM_CHANNELS];
71
72
73     protected:
74         /* Live View Parameters (most interesting) */
75         AtmoFilterMode m_LiveViewFilterMode;
76         int m_LiveViewFilter_PercentNew;
77         int m_LiveViewFilter_MeanLength;
78         int m_LiveViewFilter_MeanThreshold;
79
80         // weighting of distance to edge
81         int m_LiveView_EdgeWeighting; //  = 8;
82         // brightness correction
83         int m_LiveView_BrightCorrect; //  = 100;
84         // darkness limit (pixels below this value will be ignored)
85         int m_LiveView_DarknessLimit; //  = 5;
86         // Windowing size for hue histogram building
87         int m_LiveView_HueWinSize;    //  = 3;
88         // Windowing size for sat histogram building
89         int m_LiveView_SatWinSize;    //  = 3;
90         /*
91           special (hack) for ignorning black borders durring
92           playback of letterboxed material on a 16:9 output device
93         */
94         int m_LiveView_WidescreenMode; // = 0
95
96         // border from source image which should be ignored
97         // the values are only used by the Win32 GDI Screen capture
98         int m_LiveView_HOverscanBorder;
99         int m_LiveView_VOverscanBorder;
100         int m_LiveView_DisplayNr;
101
102         /*
103            a special delay to get the light in sync with the video
104            was required because the frames will pass my VLC filter some [ms]
105            before they become visible on screen with this delay - screenoutput
106            and light timing could be "synchronized"
107         */
108         int m_LiveView_FrameDelay;
109
110     protected:
111          /* values of the last hardware white adjustment (only for hardware with new firmware) */
112          int m_Hardware_global_gamma;
113          int m_Hardware_global_contrast;
114          int m_Hardware_contrast_red;
115          int m_Hardware_contrast_green;
116          int m_Hardware_contrast_blue;
117          int m_Hardware_gamma_red;
118          int m_Hardware_gamma_green;
119          int m_Hardware_gamma_blue;
120
121     public:
122        CAtmoConfig();
123        virtual ~CAtmoConfig();
124        virtual void SaveSettings() {}
125        virtual void LoadSettings() {};
126        void LoadDefaults();
127
128        /*
129          function to copy  the values of one configuration object to another
130          will be used in windows settings dialog as backup if the user
131          presses cancel
132        */
133        void Assign(CAtmoConfig *pAtmoConfigSrc);
134
135     public:
136         int isShowConfigDialog()            { return m_IsShowConfigDialog; }
137         void setShowConfigDialog(int value) { m_IsShowConfigDialog = value; }
138
139 #if defined(_ATMO_VLC_PLUGIN_)
140         char *getSerialDevice()               { return m_devicename; }
141         void setSerialDevice(char *newdevice) { free( m_devicename ); if(newdevice) m_devicename = strdup(newdevice); else m_devicename = NULL; }
142 #else
143         int getComport()                    { return m_Comport; }
144         void setComport(int value)          { m_Comport = value; }
145 #endif
146
147         int getWhiteAdjustment_Red() { return m_WhiteAdjustment_Red;  }
148         void setWhiteAdjustment_Red(int value) { m_WhiteAdjustment_Red = value; }
149         int getWhiteAdjustment_Green() { return m_WhiteAdjustment_Green;  }
150         void setWhiteAdjustment_Green(int value) { m_WhiteAdjustment_Green = value; }
151         int getWhiteAdjustment_Blue() { return m_WhiteAdjustment_Blue;  }
152         void setWhiteAdjustment_Blue(int value) { m_WhiteAdjustment_Blue = value; }
153         ATMO_BOOL isUseSoftwareWhiteAdj() { return m_UseSoftwareWhiteAdj; }
154         void setUseSoftwareWhiteAdj(ATMO_BOOL value) { m_UseSoftwareWhiteAdj = value; }
155
156         int isSetShutdownColor()     { return m_IsSetShutdownColor; }
157         void SetSetShutdownColor(int value) { m_IsSetShutdownColor = value; }
158         int getShutdownColor_Red()   { return m_ShutdownColor_Red; }
159         void setShutdownColor_Red(int value) { m_ShutdownColor_Red = value; }
160         int getShutdownColor_Green() { return m_ShutdownColor_Green; }
161         void setShutdownColor_Green(int value) { m_ShutdownColor_Green = value; }
162         int getShutdownColor_Blue()  { return m_ShutdownColor_Blue; }
163         void setShutdownColor_Blue(int value) { m_ShutdownColor_Blue=value; }
164
165         int getColorChanger_iSteps() { return m_ColorChanger_iSteps; }
166         void setColorChanger_iSteps(int value) { m_ColorChanger_iSteps = value; }
167         int getColorChanger_iDelay() { return m_ColorChanger_iDelay; }
168         void setColorChanger_iDelay(int value) { m_ColorChanger_iDelay = value; }
169
170         int getLrColorChanger_iSteps() { return m_LrColorChanger_iSteps; }
171         void setLrColorChanger_iSteps(int value) { m_LrColorChanger_iSteps = value; }
172         int getLrColorChanger_iDelay() { return m_LrColorChanger_iDelay; }
173         void setLrColorChanger_iDelay(int value) { m_LrColorChanger_iDelay = value; }
174
175         int getStaticColor_Red()   { return m_StaticColor_Red;   }
176         void setStaticColor_Red(int value)  { m_StaticColor_Red=value; }
177         int getStaticColor_Green() { return m_StaticColor_Green; }
178         void setStaticColor_Green(int value) { m_StaticColor_Green=value; }
179         int getStaticColor_Blue()  { return m_StaticColor_Blue;  }
180         void  setStaticColor_Blue(int value) { m_StaticColor_Blue=value; }
181
182
183         AtmoConnectionType getConnectionType() { return m_eAtmoConnectionType; }
184         void setConnectionType(AtmoConnectionType value) { m_eAtmoConnectionType = value; }
185
186         EffectMode getEffectMode() { return m_eEffectMode; }
187         void setEffectMode(EffectMode value) { m_eEffectMode = value; }
188
189         AtmoFilterMode getLiveViewFilterMode() { return m_LiveViewFilterMode; }
190         void setLiveViewFilterMode(AtmoFilterMode value) { m_LiveViewFilterMode = value; }
191
192         int getLiveViewFilter_PercentNew() { return m_LiveViewFilter_PercentNew; }
193         void setLiveViewFilter_PercentNew(int value) { m_LiveViewFilter_PercentNew=value; }
194         int getLiveViewFilter_MeanLength() { return m_LiveViewFilter_MeanLength; }
195         void setLiveViewFilter_MeanLength(int value) { m_LiveViewFilter_MeanLength = value; }
196         int getLiveViewFilter_MeanThreshold() { return m_LiveViewFilter_MeanThreshold; }
197         void setLiveViewFilter_MeanThreshold(int value) { m_LiveViewFilter_MeanThreshold = value; }
198
199         int getLiveView_EdgeWeighting() { return m_LiveView_EdgeWeighting; }
200         void setLiveView_EdgeWeighting(int value) { m_LiveView_EdgeWeighting=value; }
201
202         int getLiveView_BrightCorrect() { return m_LiveView_BrightCorrect; }
203         void setLiveView_BrightCorrect(int value) { m_LiveView_BrightCorrect=value; }
204
205         int getLiveView_DarknessLimit() { return m_LiveView_DarknessLimit; }
206         void setLiveView_DarknessLimit(int value) { m_LiveView_DarknessLimit=value; }
207
208         int getLiveView_HueWinSize() { return m_LiveView_HueWinSize; }
209         void setLiveView_HueWinSize(int value) { m_LiveView_HueWinSize=value; }
210
211         int getLiveView_SatWinSize() { return m_LiveView_SatWinSize; }
212         void setLiveView_SatWinSize(int value) { m_LiveView_SatWinSize=value; }
213
214         int getLiveView_WidescreenMode() { return m_LiveView_WidescreenMode; }
215         void setLiveView_WidescreenMode(int value) { m_LiveView_WidescreenMode=value; }
216
217         int getLiveView_HOverscanBorder() { return m_LiveView_HOverscanBorder; }
218         void setLiveView_HOverscanBorder(int value) { m_LiveView_HOverscanBorder = value; }
219
220         int getLiveView_VOverscanBorder() { return m_LiveView_VOverscanBorder; }
221         void setLiveView_VOverscanBorder(int value) { m_LiveView_VOverscanBorder = value; }
222
223         int getLiveView_DisplayNr() { return m_LiveView_DisplayNr; }
224         void setLiveView_DisplayNr(int value) { m_LiveView_DisplayNr = value; }
225
226         int getLiveView_FrameDelay() { return m_LiveView_FrameDelay; }
227         void setLiveView_FrameDelay(int delay) { m_LiveView_FrameDelay = delay; }
228
229         int getHardware_global_gamma() { return m_Hardware_global_gamma ; }
230         void setHardware_global_gamma(int value) { m_Hardware_global_gamma=value; }
231
232         int getHardware_global_contrast() { return m_Hardware_global_contrast; }
233         void setHardware_global_contrast(int value) { m_Hardware_global_contrast=value; }
234
235         int getHardware_contrast_red() { return m_Hardware_contrast_red; }
236         void setHardware_contrast_red(int value) { m_Hardware_contrast_red=value; }
237
238         int getHardware_contrast_green() { return m_Hardware_contrast_green; }
239         void setHardware_contrast_green(int value) { m_Hardware_contrast_green=value; }
240
241         int getHardware_contrast_blue() { return m_Hardware_contrast_blue; }
242         void setHardware_contrast_blue(int value) { m_Hardware_contrast_blue=value; }
243
244         int getHardware_gamma_red() { return m_Hardware_gamma_red; }
245         void setHardware_gamma_red(int value) { m_Hardware_gamma_red=value; }
246
247         int getHardware_gamma_green() { return m_Hardware_gamma_green; }
248         void setHardware_gamma_green(int value) { m_Hardware_gamma_green=value; }
249
250         int getHardware_gamma_blue() { return m_Hardware_gamma_blue; }
251         void setHardware_gamma_blue(int value) { m_Hardware_gamma_blue=value; }
252
253         tChannelAssignment *getChannelAssignment(int nummer) {
254             return this->m_ChannelAssignments[nummer];
255         }
256         int getCurrentChannelAssignment() { return m_CurrentChannelAssignment; }
257         void setCurrentChannelAssignment(int index) { m_CurrentChannelAssignment = index; }
258
259         int getNumChannelAssignments();
260         void clearChannelMappings();
261         void clearAllChannelMappings();
262         void AddChannelAssignment(tChannelAssignment *ta);
263         void SetChannelAssignment(int index, tChannelAssignment *ta);
264
265         CAtmoZoneDefinition *getZoneDefinition(int zoneIndex);
266
267 };
268
269 #endif