]> git.sesse.net Git - vlc/blob - modules/video_filter/atmo/AtmoConnection.h
livehttp: don't remove segment-count to be less than number of segments requested
[vlc] / modules / video_filter / atmo / AtmoConnection.h
1 /*
2  * AtmoConnection.h: generic/abstract class defining all methods for the
3  * communication with the hardware
4  *
5  * See the README.txt file for copyright information and how to reach the author(s).
6  *
7  * $Id$
8  */
9 #ifndef _AtmoConnection_h_
10 #define _AtmoConnection_h_
11
12 #include <stdlib.h>
13
14 #include "AtmoDefs.h"
15 #include "AtmoConfig.h"
16 #include "AtmoChannelAssignment.h"
17
18 #if defined(_ATMO_VLC_PLUGIN_)
19 #   include <vlc_common.h>
20 #   include <vlc_threads.h>
21 #else
22 #   include <windows.h>
23 #endif
24
25 class CAtmoConnection
26 {
27 protected:
28         CAtmoConfig *m_pAtmoConfig;
29
30 #if defined(_ATMO_VLC_PLUGIN_)
31     vlc_mutex_t m_AccessConnection;
32 #else
33     CRITICAL_SECTION m_AccessConnection;
34 #endif
35
36     int *m_ChannelAssignment;
37     int m_NumAssignedChannels;
38
39 protected:
40     void Lock();
41     void Unlock();
42
43 public:
44         CAtmoConnection(CAtmoConfig *cfg);
45         virtual ~CAtmoConnection(void);
46         virtual ATMO_BOOL OpenConnection() = 0;
47         virtual void CloseConnection() {};
48         virtual ATMO_BOOL isOpen(void) { return false; }
49
50     virtual ATMO_BOOL SendData(pColorPacket data) = 0;
51
52     virtual ATMO_BOOL setChannelColor(int /*channel*/, tRGBColor /*color*/)
53     { return false; }
54     virtual ATMO_BOOL setChannelValues(int /*num*/,unsigned char * /*values*/)
55     { return false; }
56
57     virtual ATMO_BOOL HardwareWhiteAdjust(int /*global_gamma*/,
58                                           int /*global_contrast*/,
59                                           int /*contrast_red*/,
60                                           int /*contrast_green*/,
61                                           int /*contrast_blue*/,
62                                           int /*gamma_red*/,
63                                           int /*gamma_green*/,
64                                           int /*gamma_blue*/,
65                                           ATMO_BOOL /*storeToEeprom*/)
66     { return false; }
67
68 #if !defined(_ATMO_VLC_PLUGIN_)
69     virtual ATMO_BOOL ShowConfigDialog(HINSTANCE hInst, HWND parent, CAtmoConfig *cfg);
70 #endif
71
72     virtual void SetChannelAssignment(CAtmoChannelAssignment *ca);
73
74     virtual int getNumChannels() { return 0; }
75     virtual char *getChannelName(int /*ch*/) { return NULL; }
76
77     virtual const char *getDevicePath() { return "none"; }
78
79     virtual ATMO_BOOL CreateDefaultMapping(CAtmoChannelAssignment * /*ca*/)
80     { return false; }
81
82 };
83
84 #endif