]> git.sesse.net Git - vlc/blob - modules/video_filter/atmo/AtmoDynData.h
enhanced & corrected AtmoLight filter module
[vlc] / modules / video_filter / atmo / AtmoDynData.h
1 /*
2  * AtmoDynData.h: class for holding all variable data - which may be passed
3  * between function calls, into threads instead of the use of global variables
4  *
5  * See the README.txt file for copyright information and how to reach the author(s).
6  *
7  * $Id$
8  */
9 #ifndef _AtmoDynData_h_
10 #define _AtmoDynData_h_
11
12 #include <stdio.h>
13
14 #include "AtmoDefs.h"
15
16 #include "AtmoThread.h"
17 #include "AtmoConfig.h"
18 #include "AtmoConnection.h"
19 #include "AtmoPacketQueue.h"
20 #include "AtmoInput.h"
21
22 #if !defined(_ATMO_VLC_PLUGIN_)
23 #    include "AtmoDisplays.h"
24 #else
25 #   include <vlc_common.h>
26 #   include <vlc_threads.h>
27 #endif
28
29 class CAtmoInput;
30
31 /*
32   the idea behind this class is to avoid a mix of persistent value and
33   volatile values in CAtmoConfig class because some parameters and variables
34   exists only for the current process and won't be stored to the registry
35
36   (Simple thought its a container... )
37
38   you ask? why I didn't used a struct for it? ..mmh I like classes?
39
40   Allways stop the current effect Thread before changing AtmoConnection or
41   AtmoConfig!
42 */
43 class CAtmoDynData
44 {
45 private:
46     /*
47       thread creating the current output (depends on active effect)
48     */
49     CThread *m_pCurrentEffectThread;
50
51     /*
52       in Modus Live View the packetQueue is the connection
53       between the output processing and the pixelsource
54     */
55     CAtmoPacketQueue *m_pLivePacketQueue;
56
57     /*
58       thread for getting and preparing the pixeldata in color
59       packets for each zone
60     */
61     CAtmoInput *m_pLiveInput;
62     LivePictureSource m_LivePictureSource;
63
64     /*
65     connection to the current configure hardware device
66     */
67     CAtmoConnection *m_pAtmoConnection;
68
69     /*
70      all global persistent parameters
71     */
72     CAtmoConfig *m_pAtmoConfig;
73
74 #if !defined(_ATMO_VLC_PLUGIN_)
75     CAtmoDisplays *m_pAtmoDisplays;
76     HINSTANCE m_hInst;
77     CRITICAL_SECTION m_RemoteCallCriticalSection;
78     char m_WorkDir[MAX_PATH];
79 #else
80     vlc_object_t *p_atmo_filter;
81     vlc_mutex_t  m_lock;
82 #endif
83
84
85 public:
86 #if !defined(_ATMO_VLC_PLUGIN_)
87      CAtmoDynData(HINSTANCE hInst,
88                   CAtmoConfig *pAtmoConfig,
89                   CAtmoDisplays *pAtmoDisplays);
90 #else
91      CAtmoDynData(vlc_object_t *p_atmo_filter,
92                   CAtmoConfig *pAtmoConfig);
93 #endif
94     ~CAtmoDynData(void);
95
96     CThread *getEffectThread()           { return m_pCurrentEffectThread; }
97     void setEffectThread(CThread *value) { m_pCurrentEffectThread = value; }
98
99
100     CAtmoPacketQueue *getLivePacketQueue() { return m_pLivePacketQueue; }
101     void setLivePacketQueue(CAtmoPacketQueue *pQueue) { m_pLivePacketQueue = pQueue; }
102
103     CAtmoInput *getLiveInput() { return m_pLiveInput; }
104     void setLiveInput(CAtmoInput *value) {  m_pLiveInput = value; }
105
106     LivePictureSource getLivePictureSource() { return m_LivePictureSource; }
107     void setLivePictureSource(LivePictureSource lps) { m_LivePictureSource = lps; }
108
109     CAtmoConnection *getAtmoConnection() { return m_pAtmoConnection; }
110     void setAtmoConnection(CAtmoConnection *value) { m_pAtmoConnection = value; }
111
112     CAtmoConfig *getAtmoConfig() { return m_pAtmoConfig; }
113
114     void ReloadZoneDefinitionBitmaps();
115     void CalculateDefaultZones();
116
117 #if !defined(_ATMO_VLC_PLUGIN_)
118     CAtmoDisplays *getAtmoDisplays() { return m_pAtmoDisplays; }
119     HINSTANCE getHinstance() { return m_hInst; }
120     void setWorkDir(const char *dir);
121     char *getWorkDir();
122 #else
123     vlc_object_t *getAtmoFilter() { return p_atmo_filter; }
124 #endif
125
126     void LockCriticalSection();
127     void UnLockCriticalSection();
128 };
129
130 #endif