2 * Copyright (C) 2009 Maarten Lankhorst
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 cpp_quote
("#ifndef E_NOTFOUND")
23 cpp_quote
("#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)")
25 cpp_quote
("#ifndef E_UNSUPPORTED_TYPE")
26 cpp_quote
("#define E_UNSUPPORTED_TYPE HRESULT_FROM_WIN32(ERROR_UNSUPPORTED_TYPE)")
29 cpp_quote
("DEFINE_GUID(DEVINTERFACE_AUDIO_RENDER, 0xe6327cad,0xdcec,0x4949,0xae,0x8a,0x99,0x1e,0x97,0x6a,0x79,0xd2);")
30 cpp_quote
("DEFINE_GUID(DEVINTERFACE_AUDIO_CAPTURE, 0x2eef81be,0x33fa,0x4800,0x96,0x70,0x1c,0xd4,0x74,0x97,0x2c,0x3f);")
32 cpp_quote
("#define DEVICE_STATE_ACTIVE 0x1")
33 cpp_quote
("#define DEVICE_STATE_DISABLED 0x2")
34 cpp_quote
("#define DEVICE_STATE_NOTPRESENT 0x4")
35 cpp_quote
("#define DEVICE_STATE_UNPLUGGED 0x8")
36 cpp_quote
("#define DEVICE_STATEMASK_ALL 0xf")
38 /* Generic PKEY_AudioEndPoint ID for grepping: {1da5d803-d492-4edd-8c23-e0c0ffee7f0e} */
39 cpp_quote
("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_FormFactor,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,0);")
40 cpp_quote
("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_ControlPanelPageProvider,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,1);")
41 cpp_quote
("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Association,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,2);")
42 cpp_quote
("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_PhysicalSpeakers,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,3);")
43 cpp_quote
("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_GUID,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,4);")
44 cpp_quote
("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Disable_SysFx,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,5);")
46 cpp_quote
("#define ENDPOINT_SYSFX_ENABLED 0")
47 cpp_quote
("#define ENDPOINT_SYSFX_DISABLED 1")
49 cpp_quote
("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_FullRangeSpeakers,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,6);")
50 cpp_quote
("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Supports_EventDriven_Mode,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,7);")
51 cpp_quote
("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_JackSubType,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,8);")
53 cpp_quote
("DEFINE_PROPERTYKEY(PKEY_AudioEngine_DeviceFormat,0xf19f064d,0x082c,0x4e27,0xbc,0x73,0x68,0x82,0xa1,0xbb,0x8e,0x4c,0);")
54 cpp_quote
("DEFINE_PROPERTYKEY(PKEY_AudioEngine_OEMFormat,0xe4870e26,0x3cc5,0x4cd2,0xba,0x46,0xca,0x0a,0x9a,0x70,0xed,0x04,3);")
56 typedef struct tagDIRECTX_AUDIO_ACTIVATION_PARAMS
58 DWORD cbDirectXAudioActivationParams
;
59 GUID guidAudioSession
;
60 DWORD dwAudioStreamFlags
;
61 } DIRECTX_AUDIO_ACTIVATION_PARAMS
, *PDIRECTX_AUDIO_ACTIVATION_PARAMS
;
63 typedef enum _EDataFlow
79 typedef enum _EndpointFormFactor
88 UnknownDigitalPassthrough
,
90 DigitalAudioDisplayDevice
,
92 EndpointFormFactor_enum_count
95 cpp_quote
("#define HDMI DigitalAudioDisplayDevice")
100 uuid(7991eec9
-7e89
-4d85
-8390-6c703cec60c0
),
102 pointer_default(unique)
104 interface IMMNotificationClient
: IUnknown
106 [id(1)] HRESULT OnDeviceStateChanged
(
107 [in] LPCWSTR pwstrDeviceId
,
108 [in] DWORD dwNewState
110 [id(2)] HRESULT OnDeviceAdded
(
111 [in] LPCWSTR pwstrDeviceId
113 [id(3)] HRESULT OnDeviceRemoved
(
114 [in] LPCWSTR pwstrDeviceId
116 [id(4)] HRESULT OnDefaultDeviceChanged
(
119 [in] LPCWSTR pwstrDeviceId
121 [id(5)] HRESULT OnPropertyValueChanged
(
122 [in] LPCWSTR pwstrDeviceId
,
123 [in] const PROPERTYKEY key
130 uuid(d666063f
-1587-4e43
-81f1
-b948e807363f
),
132 pointer_default(unique)
134 interface IMMDevice
: IUnknown
136 [id(1)] HRESULT Activate
(
139 [in,unique] PROPVARIANT
*pActivationParams
,
140 [out,iid_is(iid
)] void **ppv
142 [id(2)] HRESULT OpenPropertyStore
(
143 [in] DWORD stgmAccess
,
144 [out] IPropertyStore
**ppProperties
146 [id(3)] HRESULT GetId
(
147 [out] LPWSTR
*ppstrId
149 [id(4)] HRESULT GetState
(
150 [out] DWORD
*pdwState
157 uuid(0bd7a1be
-7a1a
-44db
-8397-cc5392387b5e
),
159 pointer_default(unique)
161 interface IMMDeviceCollection
: IUnknown
163 [id(1)] HRESULT GetCount
(
164 [out] UINT
*pcDevices
166 [id(2)] HRESULT Item
(
168 [out] IMMDevice
**ppdevice
175 uuid(1be09788
-6894-4089-8586-9a2a6c265ac5
),
177 pointer_default(unique)
179 interface IMMEndpoint
: IUnknown
181 [id(1)] HRESULT GetDataFlow
(
182 [out] EDataFlow
*pDataFlow
189 uuid(a95664d2
-9614-4f35
-a746
-de8db63617e6
),
191 pointer_default(unique)
193 interface IMMDeviceEnumerator
: IUnknown
195 [id(1)] HRESULT EnumAudioEndpoints
(
196 [in] EDataFlow dataFlow
,
197 [in] DWORD dwStateMask
,
198 [out] IMMDeviceCollection
**ppDevices
200 [id(2)] HRESULT GetDefaultAudioEndpoint
(
201 [in] EDataFlow dataFlow
,
203 [out] IMMDevice
**ppEndpoint
205 [id(3)] HRESULT GetDevice
(
206 [in] LPCWSTR pwstrId
,
207 [out] IMMDevice
**ppDevice
209 [id(4)] HRESULT RegisterEndpointNotificationCallback
(
210 [in] IMMNotificationClient
*pClient
212 [id(5)] HRESULT UnregisterEndpointNotificationCallback
(
213 [in] IMMNotificationClient
*pClient
220 uuid(3b0d0ea4
-d0a9
-4b0e
-935b
-09516746fac0
),
222 pointer_default(unique)
224 interface IMMDeviceActivator
: IUnknown
226 [id(1)] HRESULT Activate
(
228 [in] IMMDevice
*pDevice
,
229 [in] PROPVARIANT
*pActivationParams
,
230 [out,iid_is(iid
)] void **ppv
234 typedef struct _AudioExtensionParams
237 IMMDevice
*pEndPoint
;
238 IMMDevice
*pPnpInterface
;
239 IMMDevice
*pPnpDevnode
;
240 } AudioExtensionParams
;
245 uuid(72a22d78
-cde4
-431d
-b8cc
-843a71199b6d
),
247 pointer_default(unique)
249 interface IActivateAudioInterfaceAsyncOperation
: IUnknown
251 HRESULT GetActivateResult
(
252 [out] HRESULT *result
,
253 [out] IUnknown
**iface
260 uuid(41d949ab
-9862-444a
-80f6
-c261334da5eb
),
262 pointer_default(unique)
264 interface IActivateAudioInterfaceCompletionHandler
: IUnknown
266 HRESULT ActivateCompleted
(
267 [in] IActivateAudioInterfaceAsyncOperation
*op
271 cpp_quote
("HRESULT WINAPI ActivateAudioInterfaceAsync(")
272 cpp_quote
(" const WCHAR *path, REFIID riid, PROPVARIANT *params,")
273 cpp_quote
(" IActivateAudioInterfaceCompletionHandler *done_handler,")
274 cpp_quote
(" IActivateAudioInterfaceAsyncOperation **op);")
277 uuid(2fdaafa3
-7523-4f66
-9957-9d5e7fe698f6
),
280 library MMDeviceAPILib
282 [ uuid(bcde0395
-e52f
-467c
-8e3d
-c4579291692e
) ] coclass MMDeviceEnumerator
284 [default] interface IMMDeviceEnumerator
;