]> git.sesse.net Git - vlc/blob - modules/video_filter/atmo/FnordlichtConnection.h
atmo: add support for Fnordlicht devices
[vlc] / modules / video_filter / atmo / FnordlichtConnection.h
1 /*
2  * FnordlichtConnection.h: class to access a FnordlichtLight Hardware
3  * - the description could be found
4  * here: http://github.com/fd0/fnordlicht/raw/master/doc/PROTOCOL
5  *
6  * (C) Kai Lauterbach (klaute at gmail.com)
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  * $Id$
23  */
24 #ifndef _FnordlichtConnection_h_
25 #define _FnordlichtConnection_h_
26
27 #include "AtmoDefs.h"
28 #include "AtmoConnection.h"
29 #include "AtmoConfig.h"
30
31 #if defined(WIN32)
32 #   include <windows.h>
33 #endif
34
35
36 class CFnordlichtConnection : public CAtmoConnection
37 {
38     private:
39         HANDLE m_hComport;
40
41         ATMO_BOOL sync(void);
42         ATMO_BOOL stop(unsigned char addr);
43         ATMO_BOOL reset(unsigned char addr);
44         ATMO_BOOL start_bootloader(unsigned char addr);
45         ATMO_BOOL boot_enter_application(unsigned char addr);
46
47 #if defined(WIN32)
48         DWORD  m_dwLastWin32Error;
49     public:
50         DWORD getLastError() { return m_dwLastWin32Error; }
51 #endif
52
53     public:
54         CFnordlichtConnection (CAtmoConfig *cfg);
55         virtual ~CFnordlichtConnection (void);
56
57         virtual ATMO_BOOL OpenConnection();
58
59         virtual void CloseConnection();
60
61         virtual ATMO_BOOL isOpen(void);
62
63         virtual ATMO_BOOL SendData(pColorPacket data);
64
65         virtual ATMO_BOOL HardwareWhiteAdjust(int global_gamma,
66                                             int global_contrast,
67                                             int contrast_red,
68                                             int contrast_green,
69                                             int contrast_blue,
70                                             int gamma_red,
71                                             int gamma_green,
72                                             int gamma_blue,
73                                             ATMO_BOOL storeToEeprom);
74
75         virtual int getAmountFnordlichter();
76
77         virtual const char *getDevicePath() { return "fnordlicht"; }
78
79 #if !defined(_ATMO_VLC_PLUGIN_)
80         virtual char *getChannelName(int ch);
81         virtual ATMO_BOOL ShowConfigDialog(HINSTANCE hInst, HWND parent,
82                                             CAtmoConfig *cfg);
83 #endif
84
85         virtual ATMO_BOOL CreateDefaultMapping(CAtmoChannelAssignment *ca);
86 };
87
88 #endif