forked from ambilight-4-mediaportal/AtmoWin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAtmoConnection.h
More file actions
92 lines (72 loc) · 2.47 KB
/
Copy pathAtmoConnection.h
File metadata and controls
92 lines (72 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
* AtmoConnection.h: generic/abstract class defining all methods for the
* communication with the hardware
*
* See the README.txt file for copyright information and how to reach the author(s).
*
* $Id: 6bca50519a6ecd5aaca77005ddd99e6c563b0576 $
*/
#ifndef _AtmoConnection_h_
#define _AtmoConnection_h_
#include <stdlib.h>
#include "AtmoDefs.h"
#include "AtmoConfig.h"
#include "AtmoChannelAssignment.h"
#if defined(_ATMO_VLC_PLUGIN_)
# include <vlc_common.h>
# include <vlc_threads.h>
#else
# include <windows.h>
#endif
class CAtmoConnection
{
protected:
CAtmoConfig *m_pAtmoConfig;
#if defined(_ATMO_VLC_PLUGIN_)
vlc_mutex_t m_AccessConnection;
#else
CRITICAL_SECTION m_AccessConnection;
#endif
int *m_ChannelAssignment;
int m_NumAssignedChannels;
protected:
void Lock();
void Unlock();
#if defined(WIN32)
protected:
DWORD m_dwLastWin32Error;
public:
DWORD getLastError() { return m_dwLastWin32Error; }
#endif
public:
CAtmoConnection(CAtmoConfig *cfg);
virtual ~CAtmoConnection(void);
virtual ATMO_BOOL OpenConnection() = 0;
virtual void CloseConnection() {};
virtual ATMO_BOOL isOpen(void) { return false; }
virtual ATMO_BOOL SendData(pColorPacket data) = 0;
virtual ATMO_BOOL setChannelColor(int /*channel*/, tRGBColor /*color*/)
{ return false; }
virtual ATMO_BOOL setChannelValues(int /*num*/,unsigned char * /*values*/)
{ return false; }
virtual ATMO_BOOL HardwareWhiteAdjust(int /*global_gamma*/,
int /*global_contrast*/,
int /*contrast_red*/,
int /*contrast_green*/,
int /*contrast_blue*/,
int /*gamma_red*/,
int /*gamma_green*/,
int /*gamma_blue*/,
ATMO_BOOL /*storeToEeprom*/)
{ return false; }
#if !defined(_ATMO_VLC_PLUGIN_)
virtual ATMO_BOOL ShowConfigDialog(HINSTANCE hInst, HWND parent, CAtmoConfig *cfg);
#endif
virtual void SetChannelAssignment(CAtmoChannelAssignment *ca);
virtual int getNumChannels() { return 0; }
virtual char *getChannelName(int /*ch*/) { return NULL; }
virtual const char *getDevicePath() { return "none"; }
virtual ATMO_BOOL CreateDefaultMapping(CAtmoChannelAssignment * /*ca*/)
{ return false; }
};
#endif