]> git.sesse.net Git - vlc/blob - modules/video_filter/atmo/AtmoMultiConnection.h
Use var_InheritString for --decklink-video-connection.
[vlc] / modules / video_filter / atmo / AtmoMultiConnection.h
1 /*
2  * AtmoMultiConnection.h: Class for communication with up to 4 - 4 channel classic atmolight controllers
3  * so you can built a cheap solution for having up to 16 channels, but you need four comports or
4  * USB Adapters
5  *
6  * See the README.txt file for copyright information and how to reach the author(s).
7  *
8  * $Id$
9  */
10
11 #ifndef _AtmoMultiConnection_h_
12 #define _AtmoMultiConnection_h_
13
14 #include "AtmoDefs.h"
15 #include "AtmoConnection.h"
16 #include "AtmoConfig.h"
17
18 #if defined(WIN32)
19 #   include <windows.h>
20 #endif
21
22
23 class CAtmoMultiConnection :  public CAtmoConnection
24 {
25     private:
26         HANDLE m_hComports[4];
27         unsigned char m_output[4 * 4 * 3];
28
29 #if defined(WIN32)
30         DWORD  m_dwLastWin32Error;
31     public:
32         DWORD getLastError() { return m_dwLastWin32Error; }
33 #endif
34
35         /*
36           on windows devName is COM1 COM2 etc.
37           on linux devname my be /dev/ttyS0 or /dev/ttyUSB0
38         */
39        HANDLE OpenDevice(char *devName);
40        ATMO_BOOL internal_HardwareWhiteAdjust(HANDLE hComport,int global_gamma,
41                                                      int global_contrast,
42                                                      int contrast_red,
43                                                      int contrast_green,
44                                                      int contrast_blue,
45                                                      int gamma_red,
46                                                      int gamma_green,
47                                                      int gamma_blue,
48                                                      ATMO_BOOL storeToEeprom);
49
50        ATMO_BOOL internal_SendData(HANDLE hComport, unsigned char *colorData);
51
52     public:
53        CAtmoMultiConnection(CAtmoConfig *cfg);
54        virtual ~CAtmoMultiConnection(void);
55
56            virtual ATMO_BOOL OpenConnection();
57
58        virtual void CloseConnection();
59
60        virtual ATMO_BOOL isOpen(void);
61
62        virtual ATMO_BOOL SendData(pColorPacket data);
63
64        virtual ATMO_BOOL setChannelColor(int channel, tRGBColor color);
65        virtual ATMO_BOOL setChannelValues(int numValues,unsigned char *channel_values);
66
67        virtual ATMO_BOOL HardwareWhiteAdjust(int global_gamma,
68                                              int global_contrast,
69                                              int contrast_red,
70                                              int contrast_green,
71                                              int contrast_blue,
72                                              int gamma_red,
73                                              int gamma_green,
74                                              int gamma_blue,
75                                              ATMO_BOOL storeToEeprom);
76
77        virtual int getNumChannels();
78        virtual const char *getDevicePath() { return "multiatmo"; }
79
80 #if !defined(_ATMO_VLC_PLUGIN_)
81        virtual char *getChannelName(int ch);
82        virtual ATMO_BOOL ShowConfigDialog(HINSTANCE hInst, HWND parent, CAtmoConfig *cfg);
83 #endif
84
85        virtual ATMO_BOOL CreateDefaultMapping(CAtmoChannelAssignment *ca);
86 };
87
88 #endif