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