-
Notifications
You must be signed in to change notification settings - Fork 0
/
Structs.cs
193 lines (174 loc) · 4.79 KB
/
Structs.cs
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential)]
public struct Version
{
public UInt32 Major;
public UInt32 Minor;
}
[StructLayout(LayoutKind.Sequential)]
public struct AttributePair
{
public Int32 Attribute;
public Int32 Value;
};
[StructLayout(LayoutKind.Sequential)]
public struct Vector3
{
public float x;
public float y;
public float z;
};
[StructLayout(LayoutKind.Sequential)]
public struct Orientation
{
public Vector3 At;
public Vector3 Up;
};
[StructLayout(LayoutKind.Sequential)]
public struct LoopPoints
{
public UInt32 Start;
public UInt32 End;
};
[StructLayout(LayoutKind.Sequential)]
public struct GainRange
{
public float Min;
public float Max;
};
[StructLayout(LayoutKind.Sequential)]
public struct DistanceRange
{
public float Ref;
public float Max;
};
[StructLayout(LayoutKind.Sequential)]
public struct ConeAngles
{
public float Inner;
public float Outer;
};
[StructLayout(LayoutKind.Sequential)]
public struct OuterConeGains
{
public float Gain;
public float GainHF;
public OuterConeGains(float gain, float gainhf = 1.0f)
{
Gain = gain;
GainHF = gainhf;
}
};
[StructLayout(LayoutKind.Sequential)]
public struct RolloffFactors
{
public float Source;
public float Room;
public RolloffFactors(float source, float room = 0.0f)
{
Source = source;
Room = room;
}
};
[StructLayout(LayoutKind.Sequential)]
public struct StereoAngles
{
public float Left;
public float Right;
};
// Low-pass filter -> set GainHF
// High-pass filter -> set GainLF
// Band-pass filter -> set GainHF and GainLF
[StructLayout(LayoutKind.Sequential)]
public struct FilterParams
{
public float Gain;
public float GainHF;
public float GainLF;
public FilterParams(float gain, float gainhf = 1.0f, float gainlf = 1.0f)
{
Gain = gain;
GainHF = gainhf;
GainLF = gainlf;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct EFXEAXReverbProperties
{
public float Density;
public float Diffusion;
public float Gain;
public float GainHF;
public float GainLF;
public float DecayTime;
public float DecayHFRatio;
public float DecayLFRatio;
public float ReflectionsGain;
public float ReflectionsDelay;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public float[] ReflectionsPan;
public float LateReverbGain;
public float LateReverbDelay;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public float[] LateReverbPan;
public float EchoTime;
public float EchoDepth;
public float ModulationTime;
public float ModulationDepth;
public float AirAbsorptionGainHF;
public float HFReference;
public float LFReference;
public float RoomRolloffFactor;
public int DecayHFLimit;
public EFXEAXReverbProperties(float density, float diffusion, float gain, float gainhf, float gainlf,
float decayTime, float decayHFRatio, float decayLFRatio, float reflectionsGain, float reflectionsDelay,
float[] reflectionsPan, float lateReverbGain, float lateReverbDelay, float[] lateReverbPan, float echoTime,
float echoDepth, float modulationTime, float modulationDepth, float airAbsorptionGainHF, float hfReference,
float lfReference, float roomRolloffFactor, int decayHFLimit)
{
if (reflectionsPan == null || lateReverbPan == null) throw new ArgumentNullException();
if (reflectionsPan.Length != 3 || lateReverbPan.Length != 3) throw new InvalidOperationException("Array must have a size of three");
Density = density;
Diffusion = diffusion;
Gain = gain;
GainHF = gainhf;
GainLF = gainlf;
DecayTime = decayTime;
DecayHFRatio = decayHFRatio;
DecayLFRatio = decayLFRatio;
ReflectionsGain = reflectionsGain;
ReflectionsDelay = reflectionsDelay;
ReflectionsPan = reflectionsPan;
LateReverbGain = lateReverbGain;
LateReverbDelay = lateReverbDelay;
LateReverbPan = lateReverbPan;
EchoTime = echoTime;
EchoDepth = echoDepth;
ModulationTime = modulationTime;
ModulationDepth = modulationDepth;
AirAbsorptionGainHF = airAbsorptionGainHF;
HFReference = hfReference;
LFReference = lfReference;
RoomRolloffFactor = roomRolloffFactor;
DecayHFLimit = decayHFLimit;
}
};
[StructLayout(LayoutKind.Sequential)]
public struct EFXChorusProperties
{
public int Waveform;
public int Phase;
public float Rate;
public float Depth;
public float Feedback;
public float Delay;
};
[StructLayout(LayoutKind.Sequential)]
public struct GainsAuto
{
public bool DirectGainHF;
public bool SendGain;
public bool SendGainHF;
};