]> git.sesse.net Git - vlc/blob - modules/video_filter/atmo/AtmoDynData.h
pda gui: Set prio to 0, so it is not eligible for automatic selection. This is bad...
[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 "AtmoDefs.h"
13
14 #include "AtmoThread.h"
15 #include "AtmoConfig.h"
16 #include "AtmoConnection.h"
17
18 #if !defined(_ATMO_VLC_PLUGIN_)
19 #    include "AtmoDisplays.h"
20 #else
21 #    include <vlc_common.h>
22 #    include <vlc_threads.h>
23 #endif
24
25 /*
26   the idea behind this class is to avoid a mix of persistent value and
27   volatile values in CAtmoConfig class because some parameters and variables
28   exists only for the current process and won't be stored to the registry
29
30   (Simple thought its a container... )
31
32   you ask? why I didn't used a struct for it? ..mmh I like classes?
33
34   Problem: MultiThreading! todo semaphore, mutex!
35
36   Allways stop the current effect Thread before changing AtmoConnection or
37   AtmoConfig!
38 */
39 class CAtmoDynData
40 {
41 private:
42     CThread *m_pCurrentEffectThread;
43     CAtmoConnection *m_pAtmoConnection;
44     CAtmoConfig *m_pAtmoConfig;
45
46 #if !defined(_ATMO_VLC_PLUGIN_)
47     CAtmoDisplays *m_pAtmoDisplays;
48     HINSTANCE m_hInst;
49     CRITICAL_SECTION m_RemoteCallCriticalSection;
50 #else
51     vlc_object_t *p_atmo_filter;
52     vlc_mutex_t  m_lock;
53 #endif
54
55
56 public:
57 #if !defined(_ATMO_VLC_PLUGIN_)
58      CAtmoDynData(HINSTANCE hInst,
59                   CAtmoConfig *pAtmoConfig,
60                   CAtmoDisplays *pAtmoDisplays);
61 #else
62      CAtmoDynData(vlc_object_t *p_atmo_filter,
63                   CAtmoConfig *pAtmoConfig);
64 #endif
65     ~CAtmoDynData(void);
66
67     CThread *getEffectThread()           { return m_pCurrentEffectThread; }
68     void setEffectThread(CThread *value) { m_pCurrentEffectThread = value; }
69
70     CAtmoConnection *getAtmoConnection() { return m_pAtmoConnection; }
71     void setAtmoConnection(CAtmoConnection *value) { m_pAtmoConnection = value; }
72
73     CAtmoConfig *getAtmoConfig() { return m_pAtmoConfig; }
74
75 #if !defined(_ATMO_VLC_PLUGIN_)
76     CAtmoDisplays *getAtmoDisplays() { return m_pAtmoDisplays; }
77     HINSTANCE getHinstance() { return m_hInst; }
78 #else
79     vlc_object_t *getAtmoFilter() { return p_atmo_filter; }
80 #endif
81
82     void LockCriticalSection();
83     void UnLockCriticalSection();
84 };
85
86 #endif