AtmoMultiConnection.h

Go to the documentation of this file.
00001 /*
00002  * AtmoMultiConnection.h: Class for communication with up to 4 - 4 channel classic atmolight controllers
00003  * so you can built a cheap solution for having up to 16 channels, but you need four comports or
00004  * USB Adapters
00005  *
00006  * See the README.txt file for copyright information and how to reach the author(s).
00007  *
00008  * $Id: 0ffd754fa933f88638899212b458323d30bf1a11 $
00009  */
00010 
00011 #ifndef _AtmoMultiConnection_h_
00012 #define _AtmoMultiConnection_h_
00013 
00014 #include "AtmoDefs.h"
00015 #include "AtmoConnection.h"
00016 #include "AtmoConfig.h"
00017 
00018 #if defined(WIN32)
00019 #   include <windows.h>
00020 #endif
00021 
00022 
00023 class CAtmoMultiConnection :  public CAtmoConnection
00024 {
00025     private:
00026         HANDLE m_hComports[4];
00027         unsigned char m_output[4 * 4 * 3];
00028 
00029 #if defined(WIN32)
00030         DWORD  m_dwLastWin32Error;
00031     public:
00032         DWORD getLastError() { return m_dwLastWin32Error; }
00033 #endif
00034 
00035         /*
00036           on windows devName is COM1 COM2 etc.
00037           on linux devname my be /dev/ttyS0 or /dev/ttyUSB0
00038         */
00039        HANDLE OpenDevice(char *devName);
00040        ATMO_BOOL internal_HardwareWhiteAdjust(HANDLE hComport,int global_gamma,
00041                                                      int global_contrast,
00042                                                      int contrast_red,
00043                                                      int contrast_green,
00044                                                      int contrast_blue,
00045                                                      int gamma_red,
00046                                                      int gamma_green,
00047                                                      int gamma_blue,
00048                                                      ATMO_BOOL storeToEeprom);
00049 
00050        ATMO_BOOL internal_SendData(HANDLE hComport, unsigned char *colorData);
00051 
00052     public:
00053        CAtmoMultiConnection(CAtmoConfig *cfg);
00054        virtual ~CAtmoMultiConnection(void);
00055 
00056        virtual ATMO_BOOL OpenConnection();
00057 
00058        virtual void CloseConnection();
00059 
00060        virtual ATMO_BOOL isOpen(void);
00061 
00062        virtual ATMO_BOOL SendData(pColorPacket data);
00063 
00064        virtual ATMO_BOOL setChannelColor(int channel, tRGBColor color);
00065        virtual ATMO_BOOL setChannelValues(int numValues,unsigned char *channel_values);
00066 
00067        virtual ATMO_BOOL HardwareWhiteAdjust(int global_gamma,
00068                                              int global_contrast,
00069                                              int contrast_red,
00070                                              int contrast_green,
00071                                              int contrast_blue,
00072                                              int gamma_red,
00073                                              int gamma_green,
00074                                              int gamma_blue,
00075                                              ATMO_BOOL storeToEeprom);
00076 
00077        virtual int getNumChannels();
00078        virtual const char *getDevicePath() { return "multiatmo"; }
00079 
00080 #if !defined(_ATMO_VLC_PLUGIN_)
00081        virtual char *getChannelName(int ch);
00082        virtual ATMO_BOOL ShowConfigDialog(HINSTANCE hInst, HWND parent, CAtmoConfig *cfg);
00083 #endif
00084 
00085        virtual ATMO_BOOL CreateDefaultMapping(CAtmoChannelAssignment *ca);
00086 };
00087 
00088 #endif

Generated on Tue May 25 08:04:59 2010 for VLC by  doxygen 1.5.6