]> git.sesse.net Git - vlc/blob - modules/video_filter/atmo/AtmoConfig.h
enhanced & corrected AtmoLight filter module
[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 <stdlib.h>
13
14 #include "AtmoDefs.h"
15 #include "AtmoZoneDefinition.h"
16 #include "AtmoChannelAssignment.h"
17
18 #if defined(_ATMO_VLC_PLUGIN_)
19 #   include <string.h>
20 #endif
21
22
23 class CAtmoConfig {
24
25     protected:
26            int m_IsShowConfigDialog;    
27 #if defined(_ATMO_VLC_PLUGIN_)
28        char *m_devicename;
29        char *m_devicenames[3]; // additional Devices ?
30 #else
31            int m_Comport;
32        int m_Comports[3]; // additional Comports
33 #endif
34        enum AtmoConnectionType m_eAtmoConnectionType;
35        enum EffectMode m_eEffectMode;
36
37        ATMO_BOOL m_IgnoreConnectionErrorOnStartup;
38
39     protected:
40        ATMO_BOOL m_UseSoftwareWhiteAdj;
41        int m_WhiteAdjustment_Red;
42        int m_WhiteAdjustment_Green;
43        int m_WhiteAdjustment_Blue;
44
45     protected:
46        int m_IsSetShutdownColor;
47            int m_ShutdownColor_Red;
48            int m_ShutdownColor_Green;
49            int m_ShutdownColor_Blue;
50
51     protected:
52        /* Config Values for Color Changer */
53        int m_ColorChanger_iSteps;
54        int m_ColorChanger_iDelay;
55
56     protected:
57         /* Config  values for the primitive Left Right Color Changer */
58        int m_LrColorChanger_iSteps;
59        int m_LrColorChanger_iDelay;
60
61     protected:
62        /* the static background color */
63        int m_StaticColor_Red;
64        int m_StaticColor_Green;
65        int m_StaticColor_Blue;
66
67     protected:
68         /*
69            one for System + 9 for userdefined channel
70            assignments (will it be enough?)
71         */
72         CAtmoChannelAssignment *m_ChannelAssignments[10];
73         int m_CurrentChannelAssignment;
74
75     protected:
76         CAtmoZoneDefinition **m_ZoneDefinitions;
77         int m_AtmoZoneDefCount;
78
79
80         /*
81           zone layout description for generating the default Zone weightning
82         */
83         // count of zone on the top of the screen
84         int m_ZonesTopCount;
85         // count of zone on the bottom of the screen
86         int m_ZonesBottomCount;
87         // count of zones on left and right (the same count)
88         int m_ZonesLRCount;
89
90         // does a summary Zone exists (Fullscreen)
91         int m_computed_zones_count;
92         ATMO_BOOL m_ZoneSummary;
93
94     public:
95         int getZoneCount();
96
97
98     protected:
99         /* Live View Parameters (most interesting) */
100         AtmoFilterMode m_LiveViewFilterMode;
101         int m_LiveViewFilter_PercentNew;
102         int m_LiveViewFilter_MeanLength;
103         int m_LiveViewFilter_MeanThreshold;
104
105         ATMO_BOOL m_show_statistics;
106
107         // weighting of distance to edge
108         int m_LiveView_EdgeWeighting; //  = 8;
109         // brightness correction
110         int m_LiveView_BrightCorrect; //  = 100;
111         // darkness limit (pixels below this value will be ignored)
112         int m_LiveView_DarknessLimit; //  = 5;
113         // Windowing size for hue histogram building
114         int m_LiveView_HueWinSize;    //  = 3;
115         // Windowing size for sat histogram building
116         int m_LiveView_SatWinSize;    //  = 3;
117         /*
118           special (hack) for ignorning black borders durring
119           playback of letterboxed material on a 16:9 output device
120         */
121         int m_LiveView_WidescreenMode; // = 0
122
123         // border from source image which should be ignored
124         // the values are only used by the Win32 GDI Screen capture
125         int m_LiveView_HOverscanBorder;
126         int m_LiveView_VOverscanBorder;
127         int m_LiveView_DisplayNr;
128
129         /*
130            a special delay to get the light in sync with the video
131            was required because the frames will pass my VLC filter some [ms]
132            before they become visible on screen with this delay - screenoutput
133            and light timing could be "synchronized"
134         */
135         int m_LiveView_FrameDelay;
136
137         int m_LiveView_GDI_FrameRate;
138
139     protected:
140          /* values of the last hardware white adjustment (only for hardware with new firmware) */
141          int m_Hardware_global_gamma;
142          int m_Hardware_global_contrast;
143          int m_Hardware_contrast_red;
144          int m_Hardware_contrast_green;
145          int m_Hardware_contrast_blue;
146          int m_Hardware_gamma_red;
147          int m_Hardware_gamma_green;
148          int m_Hardware_gamma_blue;
149
150     protected:
151          char *m_DMX_BaseChannels;
152          int m_DMX_RGB_Channels;
153
154     protected:
155          int m_MoMo_Channels;
156
157     protected:
158          AtmoGammaCorrect m_Software_gamma_mode;
159
160          int m_Software_gamma_red;
161          int m_Software_gamma_green;
162          int m_Software_gamma_blue;
163
164          int m_Software_gamma_global;
165     public:
166         volatile int m_UpdateEdgeWeightningFlag;
167
168
169     public:
170        CAtmoConfig();
171        virtual ~CAtmoConfig();
172        virtual void SaveSettings() {}
173        virtual void LoadSettings() {};
174        void LoadDefaults();
175
176        /*
177          function to copy  the values of one configuration object to another
178          will be used in windows settings dialog as backup if the user
179          presses cancel
180        */
181        void Assign(CAtmoConfig *pAtmoConfigSrc);
182
183        void UpdateZoneDefinitionCount();
184
185     public:
186         int isShowConfigDialog()            { return m_IsShowConfigDialog; }
187         void setShowConfigDialog(int value) { m_IsShowConfigDialog = value; }
188
189 #if defined(_ATMO_VLC_PLUGIN_)
190         char *getSerialDevice()               { return m_devicename; }
191         void setSerialDevice(const char *newdevice) { free(m_devicename); if(newdevice) m_devicename = strdup(newdevice); else m_devicename = NULL; }
192         char *getSerialDevice(int i);
193         void setSerialDevice(int i,const char *pszNewDevice);
194 #else
195         int getComport()                    { return m_Comport; }
196         void setComport(int value)          { m_Comport = value; }
197         int getComport(int i);
198         void setComport(int i, int nr);
199 #endif
200
201         ATMO_BOOL getIgnoreConnectionErrorOnStartup() { return m_IgnoreConnectionErrorOnStartup; }
202         void setIgnoreConnectionErrorOnStartup(ATMO_BOOL ignore) { m_IgnoreConnectionErrorOnStartup = ignore; }
203
204         int getWhiteAdjustment_Red() { return m_WhiteAdjustment_Red;  }
205         void setWhiteAdjustment_Red(int value) { m_WhiteAdjustment_Red = value; }
206         int getWhiteAdjustment_Green() { return m_WhiteAdjustment_Green;  }
207         void setWhiteAdjustment_Green(int value) { m_WhiteAdjustment_Green = value; }
208         int getWhiteAdjustment_Blue() { return m_WhiteAdjustment_Blue;  }
209         void setWhiteAdjustment_Blue(int value) { m_WhiteAdjustment_Blue = value; }
210         ATMO_BOOL isUseSoftwareWhiteAdj() { return m_UseSoftwareWhiteAdj; }
211         void setUseSoftwareWhiteAdj(ATMO_BOOL value) { m_UseSoftwareWhiteAdj = value; }
212
213         int isSetShutdownColor()     { return m_IsSetShutdownColor; }
214         void SetSetShutdownColor(int value) { m_IsSetShutdownColor = value; }
215         int getShutdownColor_Red()   { return m_ShutdownColor_Red; }
216         void setShutdownColor_Red(int value) { m_ShutdownColor_Red = value; }
217         int getShutdownColor_Green() { return m_ShutdownColor_Green; }
218         void setShutdownColor_Green(int value) { m_ShutdownColor_Green = value; }
219         int getShutdownColor_Blue()  { return m_ShutdownColor_Blue; }
220         void setShutdownColor_Blue(int value) { m_ShutdownColor_Blue=value; }
221
222         int getColorChanger_iSteps() { return m_ColorChanger_iSteps; }
223         void setColorChanger_iSteps(int value) { m_ColorChanger_iSteps = value; }
224         int getColorChanger_iDelay() { return m_ColorChanger_iDelay; }
225         void setColorChanger_iDelay(int value) { m_ColorChanger_iDelay = value; }
226
227         int getLrColorChanger_iSteps() { return m_LrColorChanger_iSteps; }
228         void setLrColorChanger_iSteps(int value) { m_LrColorChanger_iSteps = value; }
229         int getLrColorChanger_iDelay() { return m_LrColorChanger_iDelay; }
230         void setLrColorChanger_iDelay(int value) { m_LrColorChanger_iDelay = value; }
231
232         int getStaticColor_Red()   { return m_StaticColor_Red;   }
233         void setStaticColor_Red(int value)  { m_StaticColor_Red=value; }
234         int getStaticColor_Green() { return m_StaticColor_Green; }
235         void setStaticColor_Green(int value) { m_StaticColor_Green=value; }
236         int getStaticColor_Blue()  { return m_StaticColor_Blue;  }
237         void  setStaticColor_Blue(int value) { m_StaticColor_Blue=value; }
238
239
240         AtmoConnectionType getConnectionType() { return m_eAtmoConnectionType; }
241         void setConnectionType(AtmoConnectionType value) { m_eAtmoConnectionType = value; }
242
243         EffectMode getEffectMode() { return m_eEffectMode; }
244         void setEffectMode(EffectMode value) { m_eEffectMode = value; }
245
246         ATMO_BOOL getShow_statistics() { return m_show_statistics; }
247
248         AtmoFilterMode getLiveViewFilterMode() { return m_LiveViewFilterMode; }
249         void setLiveViewFilterMode(AtmoFilterMode value) { m_LiveViewFilterMode = value; }
250
251         int getLiveViewFilter_PercentNew() { return m_LiveViewFilter_PercentNew; }
252         void setLiveViewFilter_PercentNew(int value) { m_LiveViewFilter_PercentNew=value; }
253         int getLiveViewFilter_MeanLength() { return m_LiveViewFilter_MeanLength; }
254         void setLiveViewFilter_MeanLength(int value) { m_LiveViewFilter_MeanLength = value; }
255         int getLiveViewFilter_MeanThreshold() { return m_LiveViewFilter_MeanThreshold; }
256         void setLiveViewFilter_MeanThreshold(int value) { m_LiveViewFilter_MeanThreshold = value; }
257
258         int getLiveView_EdgeWeighting() { return m_LiveView_EdgeWeighting; }
259         void setLiveView_EdgeWeighting(int value) { m_LiveView_EdgeWeighting=value; }
260
261         int getLiveView_BrightCorrect() { return m_LiveView_BrightCorrect; }
262         void setLiveView_BrightCorrect(int value) { m_LiveView_BrightCorrect=value; }
263
264         int getLiveView_DarknessLimit() { return m_LiveView_DarknessLimit; }
265         void setLiveView_DarknessLimit(int value) { m_LiveView_DarknessLimit=value; }
266
267         int getLiveView_HueWinSize() { return m_LiveView_HueWinSize; }
268         void setLiveView_HueWinSize(int value) { m_LiveView_HueWinSize=value; }
269
270         int getLiveView_SatWinSize() { return m_LiveView_SatWinSize; }
271         void setLiveView_SatWinSize(int value) { m_LiveView_SatWinSize=value; }
272
273         int getLiveView_WidescreenMode() { return m_LiveView_WidescreenMode; }
274         void setLiveView_WidescreenMode(int value) { m_LiveView_WidescreenMode=value; }
275
276         int getLiveView_HOverscanBorder() { return m_LiveView_HOverscanBorder; }
277         void setLiveView_HOverscanBorder(int value) { m_LiveView_HOverscanBorder = value; }
278
279         int getLiveView_VOverscanBorder() { return m_LiveView_VOverscanBorder; }
280         void setLiveView_VOverscanBorder(int value) { m_LiveView_VOverscanBorder = value; }
281
282         int getLiveView_DisplayNr() { return m_LiveView_DisplayNr; }
283         void setLiveView_DisplayNr(int value) { m_LiveView_DisplayNr = value; }
284
285         int getLiveView_FrameDelay() { return m_LiveView_FrameDelay; }
286         void setLiveView_FrameDelay(int delay) { m_LiveView_FrameDelay = delay; }
287
288         int getLiveView_GDI_FrameRate() { return m_LiveView_GDI_FrameRate; }
289         void setLiveView_GDI_FrameRate(int value) { m_LiveView_GDI_FrameRate=value; }
290
291         int getHardware_global_gamma() { return m_Hardware_global_gamma ; }
292         void setHardware_global_gamma(int value) { m_Hardware_global_gamma=value; }
293
294         int getHardware_global_contrast() { return m_Hardware_global_contrast; }
295         void setHardware_global_contrast(int value) { m_Hardware_global_contrast=value; }
296
297         int getHardware_contrast_red() { return m_Hardware_contrast_red; }
298         void setHardware_contrast_red(int value) { m_Hardware_contrast_red=value; }
299
300         int getHardware_contrast_green() { return m_Hardware_contrast_green; }
301         void setHardware_contrast_green(int value) { m_Hardware_contrast_green=value; }
302
303         int getHardware_contrast_blue() { return m_Hardware_contrast_blue; }
304         void setHardware_contrast_blue(int value) { m_Hardware_contrast_blue=value; }
305
306         int getHardware_gamma_red() { return m_Hardware_gamma_red; }
307         void setHardware_gamma_red(int value) { m_Hardware_gamma_red=value; }
308
309         int getHardware_gamma_green() { return m_Hardware_gamma_green; }
310         void setHardware_gamma_green(int value) { m_Hardware_gamma_green=value; }
311
312         int getHardware_gamma_blue() { return m_Hardware_gamma_blue; }
313         void setHardware_gamma_blue(int value) { m_Hardware_gamma_blue=value; }
314
315
316         AtmoGammaCorrect getSoftware_gamma_mode() { return m_Software_gamma_mode; }
317         int getSoftware_gamma_red() { return m_Software_gamma_red; }
318         int getSoftware_gamma_green() { return m_Software_gamma_green; }
319         int getSoftware_gamma_blue() { return m_Software_gamma_blue; }
320         int getSoftware_gamma_global() { return m_Software_gamma_global; }
321
322         void setSoftware_gamma_mode(AtmoGammaCorrect value) { m_Software_gamma_mode = value; }
323         void setSoftware_gamma_red(int value)    { m_Software_gamma_red = value; }
324         void setSoftware_gamma_green(int value)  { m_Software_gamma_green = value; }
325         void setSoftware_gamma_blue(int value)   { m_Software_gamma_blue = value; }
326         void setSoftware_gamma_global(int value) { m_Software_gamma_global = value; }
327
328         CAtmoChannelAssignment *getChannelAssignment(int nummer) {
329             return this->m_ChannelAssignments[nummer];
330         }
331         int getCurrentChannelAssignment() { return m_CurrentChannelAssignment; }
332         void setCurrentChannelAssignment(int index) { m_CurrentChannelAssignment = index; }
333
334         int getNumChannelAssignments();
335         void clearChannelMappings();
336         void clearAllChannelMappings();
337         void AddChannelAssignment(CAtmoChannelAssignment *ta);
338         void SetChannelAssignment(int index, CAtmoChannelAssignment *ta);
339
340         CAtmoZoneDefinition *getZoneDefinition(int zoneIndex);
341
342         void UpdateZoneCount();
343
344         void setZonesTopCount(int zones) { m_ZonesTopCount = zones; UpdateZoneCount(); };
345         int getZonesTopCount() { return m_ZonesTopCount; }
346         void setZonesBottomCount(int zones) { m_ZonesBottomCount = zones; UpdateZoneCount(); };
347         int getZonesBottomCount() { return m_ZonesBottomCount; }
348         void setZonesLRCount(int zones) { m_ZonesLRCount = zones; UpdateZoneCount(); };
349         int getZonesLRCount() { return m_ZonesLRCount; }
350         ATMO_BOOL getZoneSummary() { return m_ZoneSummary; }
351         void setZoneSummary(ATMO_BOOL summary) { m_ZoneSummary = summary; UpdateZoneCount(); }
352
353         char *getDMX_BaseChannels() { return m_DMX_BaseChannels; }
354         void setDMX_BaseChannels(char *channels);
355
356         int getDMX_RGB_Channels() { return m_DMX_RGB_Channels; }
357         void setDMX_RGB_Channels(int ch) { m_DMX_RGB_Channels = ch; }
358
359         int getMoMo_Channels() { return m_MoMo_Channels; }
360         void setMoMo_Channels(int chCount) { m_MoMo_Channels = chCount; }
361
362 };
363
364 #endif