1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms
6 //! this ALWAYS GENERATED file contains the definitions for the interfaces
7 use ctypes::c_void;
8 use shared::guiddef::{GUID, REFIID};
9 use shared::minwindef::{DWORD, LPARAM, LPVOID, UINT};
10 // use shared::winerror::{ERROR_NOT_FOUND, ERROR_UNSUPPORTED_TYPE, HRESULT_FROM_WIN32};
11 use shared::wtypes::PROPERTYKEY;
12 use um::propidl::PROPVARIANT;
13 use um::propsys::IPropertyStore;
14 use um::unknwnbase::{IUnknown, IUnknownVtbl};
15 use um::winnt::{HRESULT, LPCWSTR, LPWSTR};
16 // pub const E_NOTFOUND: HRESULT = HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
17 // pub const E_UNSUPPORTED_TYPE: HRESULT = HRESULT_FROM_WIN32(ERROR_UNSUPPORTED_TYPE);
18 pub const DEVICE_STATE_ACTIVE: DWORD = 0x00000001;
19 pub const DEVICE_STATE_DISABLED: DWORD = 0x00000002;
20 pub const DEVICE_STATE_NOTPRESENT: DWORD = 0x00000004;
21 pub const DEVICE_STATE_UNPLUGGED: DWORD = 0x00000008;
22 pub const DEVICE_STATEMASK_ALL: DWORD = 0x0000000F;
23 DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_FormFactor,
24     0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 0}
25 DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_ControlPanelPageProvider,
26     0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 1}
27 DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_Association,
28     0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 2}
29 DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_PhysicalSpeakers,
30     0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 3}
31 DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_GUID,
32     0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 4}
33 DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_Disable_SysFx,
34     0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 5}
35 pub const ENDPOINT_SYSFX_ENABLED: DWORD = 0x00000000;
36 pub const ENDPOINT_SYSFX_DISABLED: DWORD = 0x00000001;
37 DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_FullRangeSpeakers,
38     0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 6}
39 DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_Supports_EventDriven_Mode,
40     0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 7}
41 DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_JackSubType,
42     0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 8}
43 DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_Default_VolumeInDb,
44     0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 9}
45 DEFINE_PROPERTYKEY!{PKEY_AudioEngine_DeviceFormat,
46     0xf19f064d, 0x82c, 0x4e27, 0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c, 0}
47 DEFINE_PROPERTYKEY!{PKEY_AudioEngine_OEMFormat,
48     0xe4870e26, 0x3cc5, 0x4cd2, 0xba, 0x46, 0xca, 0xa, 0x9a, 0x70, 0xed, 0x4, 3}
49 DEFINE_PROPERTYKEY!{PKEY_AudioEndpointLogo_IconEffects,
50     0xf1ab780d, 0x2010, 0x4ed3, 0xa3, 0xa6, 0x8b, 0x87, 0xf0, 0xf0, 0xc4, 0x76, 0}
51 DEFINE_PROPERTYKEY!{PKEY_AudioEndpointLogo_IconPath,
52     0xf1ab780d, 0x2010, 0x4ed3, 0xa3, 0xa6, 0x8b, 0x87, 0xf0, 0xf0, 0xc4, 0x76, 1}
53 DEFINE_PROPERTYKEY!{PKEY_AudioEndpointSettings_MenuText,
54     0x14242002, 0x0320, 0x4de4, 0x95, 0x55, 0xa7, 0xd8, 0x2b, 0x73, 0xc2, 0x86, 0}
55 DEFINE_PROPERTYKEY!{PKEY_AudioEndpointSettings_LaunchContract,
56     0x14242002, 0x0320, 0x4de4, 0x95, 0x55, 0xa7, 0xd8, 0x2b, 0x73, 0xc2, 0x86, 1}
57 STRUCT!{struct DIRECTX_AUDIO_ACTIVATION_PARAMS {
58     cbDirectXAudioActivationParams: DWORD,
59     guidAudioSession: GUID,
60     dwAudioStreamFlags: DWORD,
61 }}
62 pub type PDIRECTX_AUDIO_ACTIVATION_PARAMS = *mut DIRECTX_AUDIO_ACTIVATION_PARAMS;
63 ENUM!{enum EDataFlow {
64     eRender,
65     eCapture,
66     eAll,
67     EDataFlow_enum_count,
68 }}
69 ENUM!{enum ERole {
70     eConsole,
71     eMultimedia,
72     eCommunications,
73     ERole_enum_count,
74 }}
75 ENUM!{enum EndpointFormFactor {
76     RemoteNetworkDevice,
77     Speakers,
78     LineLevel,
79     Headphones,
80     Microphone,
81     Headset,
82     Handset,
83     UnknownDigitalPassthrough,
84     SPDIF,
85     DigitalAudioDisplayDevice,
86     UnknownFormFactor,
87     EndpointFormFactor_enum_count,
88 }}
89 pub const HDMI: EndpointFormFactor = DigitalAudioDisplayDevice;
90 DEFINE_GUID!{DEVINTERFACE_AUDIO_RENDER,
91     0xe6327cad, 0xdcec, 0x4949, 0xae, 0x8a, 0x99, 0x1e, 0x97, 0x6a, 0x79, 0xd2}
92 DEFINE_GUID!{DEVINTERFACE_AUDIO_CAPTURE,
93     0x2eef81be, 0x33fa, 0x4800, 0x96, 0x70, 0x1c, 0xd4, 0x74, 0x97, 0x2c, 0x3f}
94 DEFINE_GUID!{DEVINTERFACE_MIDI_OUTPUT,
95     0x6dc23320, 0xab33, 0x4ce4, 0x80, 0xd4, 0xbb, 0xb3, 0xeb, 0xbf, 0x28, 0x14}
96 DEFINE_GUID!{DEVINTERFACE_MIDI_INPUT,
97     0x504be32c, 0xccf6, 0x4d2c, 0xb7, 0x3f, 0x6f, 0x8b, 0x37, 0x47, 0xe2, 0x2b}
98 RIDL!{#[uuid(0x7991eec9, 0x7e89, 0x4d85, 0x83, 0x90, 0x6c, 0x70, 0x3c, 0xec, 0x60, 0xc0)]
99 interface IMMNotificationClient(IMMNotificationClientVtbl): IUnknown(IUnknownVtbl) {
100     fn OnDeviceStateChanged(
101         pwstrDeviceId: LPCWSTR,
102         dwNewState: DWORD,
103     ) -> HRESULT,
104     fn OnDeviceAdded(
105         pwstrDeviceId: LPCWSTR,
106     ) -> HRESULT,
107     fn OnDeviceRemoved(
108         pwstrDeviceId: LPCWSTR,
109     ) -> HRESULT,
110     fn OnDefaultDeviceChanged(
111         flow: EDataFlow,
112         role: ERole,
113         pwstrDefaultDeviceId: LPCWSTR,
114     ) -> HRESULT,
115     fn OnPropertyValueChanged(
116         pwstrDeviceId: LPCWSTR,
117         key: PROPERTYKEY,
118     ) -> HRESULT,
119 }}
120 RIDL!{#[uuid(0xd666063f, 0x1587, 0x4e43, 0x81, 0xf1, 0xb9, 0x48, 0xe8, 0x07, 0x36, 0x3f)]
121 interface IMMDevice(IMMDeviceVtbl): IUnknown(IUnknownVtbl) {
122     fn Activate(
123         iid: REFIID,
124         dwClsCtx: DWORD,
125         pActivationParams: *mut PROPVARIANT,
126         ppInterface: *mut LPVOID,
127     ) -> HRESULT,
128     fn OpenPropertyStore(
129         stgmAccess: DWORD,
130         ppProperties: *mut *mut IPropertyStore,
131     ) -> HRESULT,
132     fn GetId(
133         ppstrId: *mut LPWSTR,
134     ) -> HRESULT,
135     fn GetState(
136         pdwState: *mut DWORD,
137     ) -> HRESULT,
138 }}
139 RIDL!{#[uuid(0x0bd7a1be, 0x7a1a, 0x44db, 0x83, 0x97, 0xcc, 0x53, 0x92, 0x38, 0x7b, 0x5e)]
140 interface IMMDeviceCollection(IMMDeviceCollectionVtbl): IUnknown(IUnknownVtbl) {
141     fn GetCount(
142         pcDevices: *const UINT,
143     ) -> HRESULT,
144     fn Item(
145         nDevice: UINT,
146         ppDevice: *mut *mut IMMDevice,
147     ) -> HRESULT,
148 }}
149 RIDL!{#[uuid(0x1be09788, 0x6894, 0x4089, 0x85, 0x86, 0x9a, 0x2a, 0x6c, 0x26, 0x5a, 0xc5)]
150 interface IMMEndpoint(IMMEndpointVtbl): IUnknown(IUnknownVtbl) {
151     fn GetDataFlow(
152         pDataFlow: *mut EDataFlow,
153     ) -> HRESULT,
154 }}
155 RIDL!{#[uuid(0xa95664d2, 0x9614, 0x4f35, 0xa7, 0x46, 0xde, 0x8d, 0xb6, 0x36, 0x17, 0xe6)]
156 interface IMMDeviceEnumerator(IMMDeviceEnumeratorVtbl): IUnknown(IUnknownVtbl) {
157     fn EnumAudioEndpoints(
158         dataFlow: EDataFlow,
159         dwStateMask: DWORD,
160         ppDevices: *mut *mut IMMDeviceCollection,
161     ) -> HRESULT,
162     fn GetDefaultAudioEndpoint(
163         dataFlow: EDataFlow,
164         role: ERole,
165         ppEndpoint: *mut *mut IMMDevice,
166     ) -> HRESULT,
167     fn GetDevice(
168         pwstrId: LPCWSTR,
169         ppDevices: *mut *mut IMMDevice,
170     ) -> HRESULT,
171     fn RegisterEndpointNotificationCallback(
172         pClient: *mut IMMNotificationClient,
173     ) -> HRESULT,
174     fn UnregisterEndpointNotificationCallback(
175         pClient: *mut IMMNotificationClient,
176     ) -> HRESULT,
177 }}
178 RIDL!{#[uuid(0x3b0d0ea4, 0xd0a9, 0x4b0e, 0x93, 0x5b, 0x09, 0x51, 0x67, 0x46, 0xfa, 0xc0)]
179 interface IMMDeviceActivator(IMMDeviceActivatorVtbl): IUnknown(IUnknownVtbl) {
180     fn Activate(
181         iid: REFIID,
182         pDevice: *mut IMMDevice,
183         pActivationParams: *mut PROPVARIANT,
184         ppInterface: *mut *mut c_void,
185     ) -> HRESULT,
186 }}
187 RIDL!{#[uuid(0x41d949ab, 0x9862, 0x444a, 0x80, 0xf6, 0xc2, 0x61, 0x33, 0x4d, 0xa5, 0xeb)]
188 interface IActivateAudioInterfaceCompletionHandler(IActivateAudioInterfaceCompletionHandlerVtbl):
189     IUnknown(IUnknownVtbl) {
190     fn ActivateCompleted(
191         activateOperation: *mut IActivateAudioInterfaceAsyncOperation,
192     ) -> HRESULT,
193 }}
194 RIDL!{#[uuid(0x72a22d78, 0xcde4, 0x431d, 0xb8, 0xcc, 0x84, 0x3a, 0x71, 0x19, 0x9b, 0x6d)]
195 interface IActivateAudioInterfaceAsyncOperation(IActivateAudioInterfaceAsyncOperationVtbl):
196     IUnknown(IUnknownVtbl) {
197     fn GetActivateResult(
198         activateResult: *mut HRESULT,
199         activatedInterface: *mut *mut IUnknown,
200     ) -> HRESULT,
201 }}
202 extern "system" {
ActivateAudioInterfaceAsync( deviceInterfacePath: LPCWSTR, riid: REFIID, activationParams: *mut PROPVARIANT, completionHandler: *mut IActivateAudioInterfaceCompletionHandler, activationOperation: *mut *mut IActivateAudioInterfaceAsyncOperation, ) -> HRESULT203     pub fn ActivateAudioInterfaceAsync(
204         deviceInterfacePath: LPCWSTR,
205         riid: REFIID,
206         activationParams: *mut PROPVARIANT,
207         completionHandler: *mut IActivateAudioInterfaceCompletionHandler,
208         activationOperation: *mut *mut IActivateAudioInterfaceAsyncOperation,
209     ) -> HRESULT;
210 }
211 STRUCT!{struct AudioExtensionParams {
212     AddPageParam: LPARAM,
213     pEndpoint: *mut IMMDevice,
214     pPnpInterface: *mut IMMDevice,
215     pPnpDevnode: *mut IMMDevice,
216 }}
217 DEFINE_GUID!{CLSID_MMDeviceEnumerator,
218     0xBCDE0395, 0xE52F, 0x467C, 0x8E, 0x3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E}
219 RIDL!{#[uuid(0xBCDE0395, 0xE52F, 0x467C, 0x8E, 0x3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E)]
220 class MMDeviceEnumerator;}
221