-
Notifications
You must be signed in to change notification settings - Fork 1
/
A3D_REF.H
95 lines (75 loc) · 2.72 KB
/
A3D_REF.H
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
93
94
95
//===========================================================================
//
// A3D_REF.H
//
// Purpose: Work with A3D 1st reflections (Wrapper to DirectSound3D).
//
// Copyright (C) 2004 Dmitry Nesterenko. All rights reserved.
//
//===========================================================================
#ifndef _A3D_REF_H_
#define _A3D_REF_H_
//===========================================================================
//
// Service thread function for play 1st reflections.
//
//===========================================================================
DWORD WINAPI ServiceThread(LPVOID);
//===========================================================================
//
// Forward class declarations for A3D 1st reflections.
//
//===========================================================================
class IA3dReflections;
typedef class IA3dReflections *LPA3DREFLECTIONS;
//===========================================================================
//
// Defined values for A3D 1st reflections.
//
//===========================================================================
// Maximal waiting time of end of service thread (msec).
#define A3DREF_MAX_WAIT_THREAD 10
// Precision of reflection delay (~msec).
#define A3DREF_DELAY_PRECISION 5
// Change of frequency for compensation delay (x/128).
#define A3DREF_CHANGE_FREQUENCY 4
//===========================================================================
//
// This class is the A3dReflections objects.
//
//===========================================================================
class IA3dReflections
{
protected:
// IA3dReflections friend functions.
friend DWORD WINAPI ServiceThread(LPVOID);
// IA3dReflections internal members.
STDMETHODIMP CreateReflection(DWORD);
STDMETHODIMP SchedulePlay(DWORD);
STDMETHODIMP PlayWithLag(DWORD, DWORD);
STDMETHODIMP_(VOID) Service();
STDMETHODIMP_(VOID) Reset(DWORD);
STDMETHODIMP_(VOID) Stop();
DWORD m_dwBufferSize;
DWORD m_dwBytesPerSample;
DWORD m_dwSourceFrequency;
LPDIRECTSOUND m_pDS;
LPDIRECTSOUNDBUFFER m_pDSB;
LPDIRECTSOUNDNOTIFY m_pDSN;
LPDIRECTSOUNDBUFFER m_pRefsDSB[A3D_MAX_SOURCE_REFLECTIONS];
LPDIRECTSOUND3DBUFFER m_pRefsDS3DB[A3D_MAX_SOURCE_REFLECTIONS];
DSBPOSITIONNOTIFY m_DSBPN[A3D_MAX_SOURCE_REFLECTIONS + 1];
DS3DBUFFER m_DS3DBuffer;
CRITICAL_SECTION m_CS;
HANDLE m_hThread;
public:
// Constructor and destructor.
IA3dReflections();
~IA3dReflections();
// IA3dReflections methods.
STDMETHODIMP Initialize(LPDIRECTSOUND, LPDIRECTSOUNDBUFFER);
STDMETHODIMP SetA3dSuperCtrl(LPA3DCTRL_SRC_SUPER, DWORD);
STDMETHODIMP TrackDelay();
STDMETHODIMP_(DWORD) ReadyForService();
};
#endif // _A3D_REF_H_