coastline 0.0.4
Loading...
Searching...
No Matches
earsound.h
Go to the documentation of this file.
1#pragma once
2
8
9#include <cstddef>
10
11#include <windows.h>
12
13#include "ear/eventparameters.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
20typedef int(WINAPI *EarProc0)(void);
22typedef int(WINAPI *EarProc1)(int nValue);
24typedef int(WINAPI *EarProc2)(int nValue, int nValue2);
26typedef int(WINAPI *EarProc4)(int nValue, int nValue2, int nValue3, int nValue4);
28typedef int(WINAPI *EarAssignHwndProc)(HWND hWnd);
29
32 unsigned short wSize;
33 unsigned short wType;
34 int nTrack;
36 unsigned short wChannel;
37 unsigned short matrixHandle;
38 unsigned short minimumGain;
39 unsigned short maximumGain;
40 unsigned maximumDistance;
41 unsigned minimumDistance;
42 unsigned dwPlayFlags;
43 unsigned unknown20;
44 unsigned reservedControl;
45 unsigned short direction;
46 unsigned short startDelay;
49 unsigned queueControl;
50 unsigned short environmentHandle;
51 unsigned short unknown3a;
52 unsigned short priority;
53 unsigned short frequencyScale;
54 unsigned short baseFrequencyScale;
55 unsigned short startPosition;
56 unsigned short limitDistance;
57 unsigned short unknown46;
58 unsigned unknown48;
59 unsigned short pitchVariation;
60 unsigned short backendParameter;
61 unsigned unknown50[4];
62 unsigned distanceUnit;
66 unsigned short distanceBands[7];
67 unsigned short wUnknown7e;
68};
69
70static_assert(sizeof(EarPlayParams) == 0x80);
71static_assert(offsetof(EarPlayParams, environmentHandle) ==
72 offsetof(EarEventParams, environmentHandle));
73static_assert(offsetof(EarPlayParams, distanceBands) == offsetof(EarEventParams, distanceBands));
74static_assert(offsetof(EarPlayParams, wUnknown7e) == offsetof(EarEventParams, unknown7e));
75
78
86
94
101extern int g_bEarSoundDllLoadedByUs;
102
109extern int g_bEarSoundDllUsingPds;
110
117extern int g_bEarSoundPdsRequested;
118
126extern int g_dwEarSoundDllMode;
127
134extern int g_dwEarSoundInitRefCount;
135
144bool LoadEarSoundDll(int bUsePds);
145
153
161
169
177
185
193
201
209
217
225
233
241
249
257
265
273
281
289
297
305
313
321
329
337
345
353
361
369
377
385
393
394#ifdef __cplusplus
395}
396#endif
EarProc1 g_pfnEarAaaValidate
_EAR_DLL_AAA_Validate of the EAR library.
EarProc1 g_pfnEarRegisterMatrix
_EAR_DLL_RegisterMatrix of the EAR library.
EarProc1 g_pfnEarShutDownChannel
_EAR_DLL_ShutDownChannel of the EAR library.
EarMixEventProc g_pfnEarMixEvent
_EAR_DLL_MixEvent of the EAR library.
EarProc0 g_pfnEarEarInactive
_EAR_DLL_EarInactive of the EAR library.
EarProc2 g_pfnEarSetAttenuationLevel
_EAR_DLL_SetAttenuationLevel of the EAR library.
EarProc4 g_pfnEarRegisterChannel
_EAR_DLL_RegisterChannel of the EAR library.
int g_bEarSoundDllLoadedByUs
Whether LoadEarSoundDll() loaded the library, rather than finding it already loaded.
int g_dwEarSoundInitRefCount
The number of calls to InitializeEarSound().
EarProc1 g_pfnEarInitializeEar
_EAR_DLL_InitializeEar of the EAR library.
EarProc1 g_pfnEarMoveEvent
_EAR_DLL_MoveEvent of the EAR library.
int(WINAPI * EarProc0)(void)
A routine of the EAR library with no parameters.
Definition earsound.h:20
EarProc0 g_pfnEarShutDownEar
_EAR_DLL_ShutDownEar of the EAR library.
int(WINAPI * EarAssignHwndProc)(HWND hWnd)
The routine of the EAR library that takes the window it posts its messages to.
Definition earsound.h:28
EarProc0 g_pfnEarShutDownTimer
_EAR_DLL_ShutDownTimer of the EAR library.
EarPlayParams g_EarPlayParams
The parameters of the current EAR playback request.
int(WINAPI * EarProc4)(int nValue, int nValue2, int nValue3, int nValue4)
A routine of the EAR library with four parameters.
Definition earsound.h:26
EarProc2 g_pfnEarRegisterPreset
_EAR_DLL_RegisterPreset of the EAR library.
EarProc1 g_pfnEarRegisterEnvironment
_EAR_DLL_RegisterEnvironment of the EAR library.
EarProc2 g_pfnEarGetEventStatus
_EAR_DLL_GetEventStatus of the EAR library.
EarProc0 g_pfnEarStartTimer
_EAR_DLL_StartTimer of the EAR library.
EarProc1 g_pfnEarShutDownEnvironment
_EAR_DLL_ShutDownEnvironment of the EAR library.
EarProc2 g_pfnEarRegisterBank
_EAR_DLL_RegisterBank of the EAR library.
EarProc2 g_pfnEarChangeChannelControl
_EAR_DLL_ChangeChannelControl of the EAR library.
bool LoadEarSoundDll(int bUsePds)
Load an EAR library and find its routines.
WPARAM(WINAPI * EarMixEventProc)(EarPlayParams *pParams)
Mix an EAR event and return its event identifier.
Definition earsound.h:77
EarProc0 g_pfnEarUpdateEar
_EAR_DLL_UpdateEar of the EAR library.
int g_dwEarSoundDllMode
The library InitializeEarSound() loads.
EarProc0 g_pfnEarGetLastError
_EAR_DLL_GetLastError of the EAR library.
EarProc1 g_pfnEarShutDownMatrix
_EAR_DLL_ShutDownMatrix of the EAR library.
int(WINAPI * EarProc2)(int nValue, int nValue2)
A routine of the EAR library with two parameters.
Definition earsound.h:24
EarProc2 g_pfnEarShutDownEvent
_EAR_DLL_ShutDownEvent of the EAR library.
int g_bEarSoundPdsRequested
Whether earpds.dll was requested.
EarProc0 g_pfnEarShowLastError
_EAR_DLL_ShowLastError of the EAR library.
EarProc0 g_pfnEarResetEar
_EAR_DLL_ResetEar of the EAR library.
HMODULE g_hEarSoundDll
The EAR library.
EarProc2 g_pfnEarClearChannel
_EAR_DLL_ClearChannel of the EAR library.
EarProc1 g_pfnEarShutDownPreset
_EAR_DLL_ShutDownPreset of the EAR library.
EarProc1 g_pfnEarShutDownBank
_EAR_DLL_ShutDownBank of the EAR library.
EarProc2 g_pfnEarSetUserDistanceUnit
_EAR_DLL_SetUserDistanceUnit of the EAR library.
EarProc0 g_pfnEarGetVersion
_EAR_DLL_GetVersion of the EAR library.
int(WINAPI * EarProc1)(int nValue)
A routine of the EAR library with one parameter.
Definition earsound.h:22
EarProc1 g_pfnEarStartEvent
_EAR_DLL_StartEvent of the EAR library.
EarAssignHwndProc g_pfnEarAssignHwnd
_EAR_DLL_AssignHwnd of the EAR library.
int g_bEarSoundDllUsingPds
Whether earpds.dll was loaded in place of earias.dll.
The parameters of an event, as the game passes them to MixEvent and MoveEvent.
Definition eventparameters.h:52
Parameters shared with the EAR event mixer.
Definition earsound.h:31
int positionY
Definition earsound.h:64
unsigned distanceUnit
Definition earsound.h:62
unsigned short wUnknown7e
Definition earsound.h:67
unsigned short direction
Definition earsound.h:45
unsigned short unknown3a
Definition earsound.h:51
unsigned short limitDistance
Definition earsound.h:56
unsigned short maximumGain
Definition earsound.h:39
unsigned short wChannel
Definition earsound.h:36
WPARAM hEvent
Definition earsound.h:35
unsigned short unknown46
Definition earsound.h:57
unsigned dwPlayFlags
Definition earsound.h:42
int positionZ
Definition earsound.h:65
int nTrack
Definition earsound.h:34
unsigned maximumDistance
Definition earsound.h:40
unsigned short environmentHandle
Definition earsound.h:50
int positionX
Definition earsound.h:63
unsigned unknown48
Definition earsound.h:58
unsigned short wType
Definition earsound.h:33
unsigned short startDelay
Definition earsound.h:46
unsigned short priority
Definition earsound.h:52
unsigned short wSize
Definition earsound.h:32
int activeTime
Definition earsound.h:48
unsigned short backendParameter
Definition earsound.h:60
int lifetime
Definition earsound.h:47
unsigned short distanceBands[7]
Definition earsound.h:66
unsigned reservedControl
Definition earsound.h:44
unsigned unknown50[4]
Definition earsound.h:61
unsigned short frequencyScale
Definition earsound.h:53
unsigned short baseFrequencyScale
Definition earsound.h:54
unsigned queueControl
Definition earsound.h:49
unsigned short pitchVariation
Definition earsound.h:59
unsigned short matrixHandle
Definition earsound.h:37
unsigned unknown20
Definition earsound.h:43
unsigned minimumDistance
Definition earsound.h:41
unsigned short startPosition
Definition earsound.h:55
unsigned short minimumGain
Definition earsound.h:38
typedef HMODULE
typedef HWND
typedef WINAPI
typedef WPARAM