-
Notifications
You must be signed in to change notification settings - Fork 0
/
IEVRCPSettings.cs
304 lines (269 loc) · 10.1 KB
/
IEVRCPSettings.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using MediaFoundation;
using CoreAudioApi.Interfaces;
namespace babgvant.EVRPlay
{
[ComImport,
Guid("D54059EF-CA38-46A5-9123-0249770482EE"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IEVRCPSettings
{
[PreserveSig]
int SetNominalRange(MFNominalRange range);
[PreserveSig]
MFNominalRange GetNominalRange();
[PreserveSig]
int SetSubtitleAlpha(float fAlpha);
[PreserveSig]
float GetSubtitleAlpha();
}
public enum EVRCPSetting
{
NOMINAL_RANGE = 0,
SUBTITLE_ALPHA,
USE_MF_TIME_CALC,
FRAME_DROP_THRESHOLD,
EVRCP_SETTING_CORRECT_AR,
EVRCP_SETTING_REQUEST_OVERLAY
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("759B5834-8F83-4855-9484-DC183B381D84"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IEVRCPConfig
{
[PreserveSig]
int GetInt(EVRCPSetting setting, out int value);
[PreserveSig]
int SetInt(EVRCPSetting setting, int value);
[PreserveSig]
int GetFloat(EVRCPSetting setting, out float value);
[PreserveSig]
int SetFloat(EVRCPSetting setting, float value);
[PreserveSig]
int GetBool(EVRCPSetting setting, out bool value);
[PreserveSig]
int SetBool(EVRCPSetting setting, bool value);
[PreserveSig]
int GetString(EVRCPSetting setting, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder value);
[PreserveSig]
int SetString(EVRCPSetting setting, [In, MarshalAs(UnmanagedType.LPWStr)] string value);
}
public enum AUDCLNT_SHAREMODE
{
SHARED,
EXCLUSIVE
}
public enum SpeakerPosition
{
FRONT_LEFT = 0x1,
FRONT_RIGHT = 0x2,
FRONT_CENTER = 0x4,
LOW_FREQUENCY = 0x8,
BACK_LEFT = 0x10,
BACK_RIGHT = 0x20,
FRONT_LEFT_OF_CENTER = 0x40,
FRONT_RIGHT_OF_CENTER = 0x80,
BACK_CENTER = 0x100,
SIDE_LEFT = 0x200,
SIDE_RIGHT = 0x400,
TOP_CENTER = 0x800,
TOP_FRONT_LEFT = 0x1000,
TOP_FRONT_CENTER = 0x2000,
TOP_FRONT_RIGHT = 0x4000,
TOP_BACK_LEFT = 0x8000,
TOP_BACK_CENTER = 0x10000,
TOP_BACK_RIGHT = 0x20000,
// Bit mask locations reserved for future use
RESERVED = 0x7FFC0000,
// Used to specify that any possible permutation of speaker configurations
//ALL = 0x80000000
}
public enum SpeakerConfig
{
Mono = SpeakerPosition.FRONT_CENTER,
Stereo = SpeakerPosition.FRONT_LEFT | SpeakerPosition.FRONT_RIGHT,
Quad = SpeakerPosition.FRONT_LEFT | SpeakerPosition.FRONT_RIGHT | SpeakerPosition.BACK_LEFT | SpeakerPosition.BACK_RIGHT,
Surround = SpeakerPosition.FRONT_LEFT | SpeakerPosition.FRONT_RIGHT | SpeakerPosition.FRONT_CENTER | SpeakerPosition.BACK_CENTER,
//FiveDotOne = SpeakerPosition.FRONT_LEFT | SpeakerPosition.FRONT_RIGHT | SpeakerPosition.FRONT_CENTER | SpeakerPosition.LOW_FREQUENCY | SpeakerPosition.BACK_LEFT | SpeakerPosition.BACK_RIGHT, //obsolete
FiveDotOneSurround = SpeakerPosition.FRONT_LEFT | SpeakerPosition.FRONT_RIGHT | SpeakerPosition.FRONT_CENTER | SpeakerPosition.LOW_FREQUENCY | SpeakerPosition.SIDE_LEFT | SpeakerPosition.SIDE_RIGHT,
SevenDotOneSurround = SpeakerPosition.FRONT_LEFT | SpeakerPosition.FRONT_RIGHT | SpeakerPosition.FRONT_CENTER | SpeakerPosition.LOW_FREQUENCY | SpeakerPosition.BACK_LEFT | SpeakerPosition.BACK_RIGHT | SpeakerPosition.SIDE_LEFT | SpeakerPosition.SIDE_RIGHT
}
public enum MPARUseFilters
{
WASAPI = 0,
AC3ENCODER = 1,
BIT_DEPTH_IN = 2,
BIT_DEPTH_OUT = 4,
TIME_STRETCH = 8,
SAMPLE_RATE_CONVERTER = 16,
CHANNEL_MIXER = 32,
COMPAT = WASAPI | CHANNEL_MIXER | BIT_DEPTH_OUT | BIT_DEPTH_IN | SAMPLE_RATE_CONVERTER,
MID = WASAPI | BIT_DEPTH_IN | BIT_DEPTH_OUT | TIME_STRETCH | SAMPLE_RATE_CONVERTER | CHANNEL_MIXER,
ALL = WASAPI | AC3ENCODER | BIT_DEPTH_IN | BIT_DEPTH_OUT | TIME_STRETCH | SAMPLE_RATE_CONVERTER | CHANNEL_MIXER
}
public enum AC3Encoding
{
DISABLED = 0,
AUTO,
FORCED
}
public struct CLOCKDATA
{
double driftMultiplier;
double driftHWvsSystem;
double currentDrift;
double resamplingAdjustment;
};
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("91A198BA-1C78-4c31-A50F-0F5C7578F078"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAVSyncClock
{
[PreserveSig]
int AdjustClock(double adjustment);
[PreserveSig]
int SetBias(double bias);
[PreserveSig]
int GetBias(out double bias);
[PreserveSig]
int GetMaxBias(out double bias);
[PreserveSig]
int GetMinBias(out double bias);
[PreserveSig]
int GetClockData(out CLOCKDATA clockData);
[PreserveSig]
int SetEVRPresentationDelay(double EVRDelay);
}
[StructLayout(LayoutKind.Sequential)]
public struct AudioDeviceDefinition
{
[MarshalAs(UnmanagedType.LPWStr, SizeConst = 4)]
public string Id;
[MarshalAs(UnmanagedType.LPWStr, SizeConst = 4)]
public string FriendlyName;
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("CA0CDCD8-D26B-4F8F-B23C-D8D949B14297"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IMPAudioSettings
{
[PreserveSig]
int GetAC3EncodingMode(out AC3Encoding setting);
[PreserveSig]
int SetAC3EncodingMode(AC3Encoding setting);
[PreserveSig]
int GetLogSampleTimes(out bool setting);
[PreserveSig]
int SetLogSampleTimes(bool setting);
[PreserveSig]
int GetEnableSyncAdjustment(out bool setting);
[PreserveSig]
int SetEnableSyncAdjustment(bool setting);
[PreserveSig]
int GetWASAPIMode(out AUDCLNT_SHAREMODE setting);
[PreserveSig]
int SetWASAPIMode(AUDCLNT_SHAREMODE setting);
[PreserveSig]
int GetUseWASAPIEventMode(out bool setting);
[PreserveSig]
int SetUseWASAPIEventMode(bool setting);
[PreserveSig]
int GetUseTimeStretching(out bool setting);
[PreserveSig]
int SetUseTimeStretching(bool setting);
[PreserveSig]
int GetExpandMonoToStereo(out bool setting);
[PreserveSig]
int SetExpandMonoToStereo(bool setting);
[PreserveSig]
int GetAC3Bitrate(out int setting);
[PreserveSig]
int SetAC3Bitrate(int setting);
[PreserveSig]
int GetSpeakerConfig(out SpeakerConfig setting);
[PreserveSig]
int SetSpeakerConfig(SpeakerConfig setting);
[PreserveSig]
int GetForceChannelMixing(out bool setting);
[PreserveSig]
int SetForceChannelMixing(bool setting);
[PreserveSig]
int GetAudioDelay(out int setting);
[PreserveSig]
int SetAudioDelay(int setting);
[PreserveSig]
int GetOutputBuffer(out int setting);
[PreserveSig]
int SetOutputBuffer(int setting);
[PreserveSig]
int GetSampleRate(out int setting);
[PreserveSig]
int SetSampleRate(int setting);
[PreserveSig]
int GetBitDepth(out int setting);
[PreserveSig]
int SetBitDepth(int setting);
[PreserveSig]
int GetResamplingQuality(out int setting);
[PreserveSig]
int SetResamplingQuality(int setting);
[PreserveSig]
int SetAudioDevice(int setting);
[PreserveSig]
int SetAudioDeviceById([In, MarshalAs(UnmanagedType.LPWStr)] string setting);
[PreserveSig]
int GetSpeakerMatchOutput(out bool setting);
[PreserveSig]
int SetSpeakerMatchOutput(bool setting);
[PreserveSig]
int GetUseFilters(out int setting);
[PreserveSig]
int SetUseFilters(int setting);
[PreserveSig]
int GetAllowBitStreaming(out bool setting);
[PreserveSig]
int SetAllowBitStreaming(bool setting);
}
public enum MPARSetting
{
AC3_ENCODING = 0, // enum (MPARAC3EncodingMode)
LOG_SAMPLE_TIMES = 1, // bool
ENABLE_SYNC_ADJUSTMENT = 2, // bool
WASAPI_MODE = 3, // enum (MPARWASAPIMode)
WASAPI_EVENT_DRIVEN = 4, // bool
ENABLE_TIME_STRETCHING = 5, // bool
EXPAND_MONO_TO_STEREO = 6, // bool
AC3_BITRATE = 7, // enum (MPARAC3Bitrate)
SPEAKER_CONFIG = 8, // enum (MPARSpeakerConfig)
FORCE_CHANNEL_MIXING = 9, // bool
AUDIO_DELAY = 10, // int (audio delay in ms)
OUTPUT_BUFFER_LENGTH = 11, // int (output buffer in ms)
SAMPLE_RATE = 12, // enum (MPARSampleRate)
BIT_DEPTH = 13, // enum (MPARBitDepth)
LIB_RESAMPLE_QUALITY = 14, // enum (MPARLibResampleQuality)
USE_FILTERS = 15, // int (flags from MPARUseFilters enum)
SETTING_AUDIO_DEVICE = 16, // wchar
ALLOW_BITSTREAMING = 17 // bool
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("CA0CDCD8-D26B-4F8F-B23C-D8D949B14297"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IMPAudioRendererConfig
{
[PreserveSig]
int GetBool(MPARSetting setting, out bool value);
[PreserveSig]
int SetBool(MPARSetting setting, bool value);
[PreserveSig]
int GetInt(MPARSetting setting, out int value);
[PreserveSig]
int SetInt(MPARSetting setting, int value);
[PreserveSig]
int GetString(MPARSetting setting, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder value);
[PreserveSig]
int SetString(MPARSetting setting, [In, MarshalAs(UnmanagedType.LPWStr)] string value);
}
}