AtmoSerialConnection.h
上传用户:kjfoods
上传日期:2020-07-06
资源大小:29949k
文件大小:2k
源码类别:

midi

开发平台:

Unix_Linux

  1. /*
  2.  * AtmoCom.h: Class for communication with the serial hardware of Atmo Light,
  3.  * opens and configures the serial port
  4.  *
  5.  * See the README.txt file for copyright information and how to reach the author(s).
  6.  *
  7.  * $Id: 22ddb72facc17b9c712e6fc6ea0a48a4c113eb2d $
  8.  */
  9. #ifndef _AtmoSerialConnection_h_
  10. #define _AtmoSerialConnection_h_
  11. #include "AtmoDefs.h"
  12. #include "AtmoConnection.h"
  13. #include "AtmoConfig.h"
  14. #if defined(WIN32)
  15. #   include <windows.h>
  16. #endif
  17. class CAtmoSerialConnection : public CAtmoConnection {
  18.     private:
  19.         HANDLE m_hComport;
  20. #if defined(WIN32)
  21.         DWORD  m_dwLastWin32Error;
  22.     public:
  23.         DWORD getLastError() { return m_dwLastWin32Error; }
  24. #endif
  25.     public:
  26.        CAtmoSerialConnection(CAtmoConfig *cfg);
  27.        virtual ~CAtmoSerialConnection(void);
  28.       virtual ATMO_BOOL OpenConnection();
  29.        virtual void CloseConnection();
  30.        virtual ATMO_BOOL isOpen(void);
  31.        virtual ATMO_BOOL SendData(unsigned char numChannels,
  32.                                   int red[],
  33.                                   int green[],
  34.                                   int blue[]);
  35.        virtual ATMO_BOOL SendData(tColorPacket data);
  36.        virtual ATMO_BOOL HardwareWhiteAdjust(int global_gamma,
  37.                                              int global_contrast,
  38.                                              int contrast_red,
  39.                                              int contrast_green,
  40.                                              int contrast_blue,
  41.                                              int gamma_red,
  42.                                              int gamma_green,
  43.                                              int gamma_blue,
  44.                                              ATMO_BOOL storeToEeprom);
  45. };
  46. #endif