1 | /*
|
---|
2 | * Copyright (C) 2009 Maarten Lankhorst
|
---|
3 | *
|
---|
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.
|
---|
8 | *
|
---|
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.
|
---|
13 | *
|
---|
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
|
---|
17 | */
|
---|
18 |
|
---|
19 | /*
|
---|
20 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
21 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
22 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
23 | * a choice of LGPL license versions is made available with the language indicating
|
---|
24 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
25 | * of the LGPL is applied is otherwise unspecified.
|
---|
26 | */
|
---|
27 |
|
---|
28 | import "unknwn.idl";
|
---|
29 | import "propsys.idl";
|
---|
30 |
|
---|
31 | cpp_quote("#ifndef E_NOTFOUND")
|
---|
32 | cpp_quote("#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)")
|
---|
33 | cpp_quote("#endif")
|
---|
34 | cpp_quote("#ifndef E_UNSUPPORTED_TYPE")
|
---|
35 | cpp_quote("#define E_UNSUPPORTED_TYPE HRESULT_FROM_WIN32(ERROR_UNSUPPORTED_TYPE)")
|
---|
36 | cpp_quote("#endif")
|
---|
37 |
|
---|
38 |
|
---|
39 | cpp_quote("#define DEVICE_STATE_ACTIVE 0x1")
|
---|
40 | cpp_quote("#define DEVICE_STATE_DISABLED 0x2")
|
---|
41 | cpp_quote("#define DEVICE_STATE_NOTPRESENT 0x4")
|
---|
42 | cpp_quote("#define DEVICE_STATE_UNPLUGGED 0x8")
|
---|
43 | cpp_quote("#define DEVICE_STATEMASK_ALL 0xf")
|
---|
44 |
|
---|
45 | /* Generic PKEY_AudioEndPoint ID for grepping: {1da5d803-d492-4edd-8c23-e0c0ffee7f0e} */
|
---|
46 | cpp_quote("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_FormFactor,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,0);")
|
---|
47 | cpp_quote("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_ControlPanelPageProvider,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,1);")
|
---|
48 | cpp_quote("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Association,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,2);")
|
---|
49 | cpp_quote("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_PhysicalSpeakers,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,3);")
|
---|
50 | cpp_quote("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_GUID,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,4);")
|
---|
51 | cpp_quote("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Disable_SysFx,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,5);")
|
---|
52 |
|
---|
53 | cpp_quote("#define ENDPOINT_SYSFX_ENABLED 0")
|
---|
54 | cpp_quote("#define ENDPOINT_SYSFX_DISABLED 1")
|
---|
55 |
|
---|
56 | cpp_quote("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_FullRangeSpeakers,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,6);")
|
---|
57 | cpp_quote("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Supports_EventDriven_Mode,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,7);")
|
---|
58 | cpp_quote("DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_JackSubType,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,8);")
|
---|
59 |
|
---|
60 | cpp_quote("DEFINE_PROPERTYKEY(PKEY_AudioEngine_DeviceFormat,0xf19f064d,0x082c,0x4e27,0xbc,0x73,0x68,0x82,0xa1,0xbb,0x8e,0x4c,0);")
|
---|
61 | cpp_quote("DEFINE_PROPERTYKEY(PKEY_AudioEngine_OEMFormat,0xe4870e26,0x3cc5,0x4cd2,0xba,0x46,0xca,0x0a,0x9a,0x70,0xed,0x04,3);")
|
---|
62 |
|
---|
63 | typedef struct tagDIRECTX_AUDIO_ACTIVATION_PARAMS
|
---|
64 | {
|
---|
65 | DWORD cbDirectXAudioActivationParams;
|
---|
66 | GUID guidAudioSession;
|
---|
67 | DWORD dwAudioStreamFlags;
|
---|
68 | } DIRECTX_AUDIO_ACTIVATION_PARAMS, *PDIRECTX_AUDIO_ACTIVATION_PARAMS;
|
---|
69 |
|
---|
70 | typedef enum _EDataFlow
|
---|
71 | {
|
---|
72 | eRender,
|
---|
73 | eCapture,
|
---|
74 | eAll,
|
---|
75 | EDataFlow_enum_count
|
---|
76 | } EDataFlow;
|
---|
77 |
|
---|
78 | typedef enum _ERole
|
---|
79 | {
|
---|
80 | eConsole,
|
---|
81 | eMultimedia,
|
---|
82 | eCommunications,
|
---|
83 | ERole_enum_count
|
---|
84 | } ERole;
|
---|
85 |
|
---|
86 | typedef enum _EndpointFormFactor
|
---|
87 | {
|
---|
88 | RemoteNetworkDevice,
|
---|
89 | Speakers,
|
---|
90 | LineLevel,
|
---|
91 | Headphones,
|
---|
92 | Microphone,
|
---|
93 | Headset,
|
---|
94 | Handset,
|
---|
95 | UnknownDigitalPassthrough,
|
---|
96 | SPDIF,
|
---|
97 | DigitalAudioDisplayDevice,
|
---|
98 | UnknownFormFactor,
|
---|
99 | EndpointFormFactor_enum_count
|
---|
100 | } EndpointFormFactor;
|
---|
101 |
|
---|
102 | cpp_quote("#define HDMI DigitalAudioDisplayDevice")
|
---|
103 |
|
---|
104 | [
|
---|
105 | object,
|
---|
106 | local,
|
---|
107 | uuid(7991eec9-7e89-4d85-8390-6c703cec60c0),
|
---|
108 | nonextensible,
|
---|
109 | pointer_default(unique)
|
---|
110 | ]
|
---|
111 | interface IMMNotificationClient : IUnknown
|
---|
112 | {
|
---|
113 | [id(1)] HRESULT OnDeviceStateChanged(
|
---|
114 | [in] LPCWSTR pwstrDeviceId,
|
---|
115 | [in] DWORD dwNewState
|
---|
116 | );
|
---|
117 | [id(2)] HRESULT OnDeviceAdded(
|
---|
118 | [in] LPCWSTR pwstrDeviceId
|
---|
119 | );
|
---|
120 | [id(3)] HRESULT OnDeviceRemoved(
|
---|
121 | [in] LPCWSTR pwstrDeviceId
|
---|
122 | );
|
---|
123 | [id(4)] HRESULT OnDefaultDeviceChanged(
|
---|
124 | [in] EDataFlow flow,
|
---|
125 | [in] ERole role,
|
---|
126 | [in] LPCWSTR pwstrDeviceId
|
---|
127 | );
|
---|
128 | [id(5)] HRESULT OnPropertyValueChanged(
|
---|
129 | [in] LPCWSTR pwstrDeviceId,
|
---|
130 | [in] const PROPERTYKEY key
|
---|
131 | );
|
---|
132 | }
|
---|
133 |
|
---|
134 | [
|
---|
135 | object,
|
---|
136 | local,
|
---|
137 | uuid(d666063f-1587-4e43-81f1-b948e807363f),
|
---|
138 | nonextensible,
|
---|
139 | pointer_default(unique)
|
---|
140 | ]
|
---|
141 | interface IMMDevice : IUnknown
|
---|
142 | {
|
---|
143 | [id(1)] HRESULT Activate(
|
---|
144 | [in] REFIID iid,
|
---|
145 | [in] DWORD dwClsCtx,
|
---|
146 | [in,unique] PROPVARIANT *pActivationParams,
|
---|
147 | [out,iid_is(iid)] void **ppv
|
---|
148 | );
|
---|
149 | [id(2)] HRESULT OpenPropertyStore(
|
---|
150 | [in] DWORD stgmAccess,
|
---|
151 | [out] IPropertyStore **ppProperties
|
---|
152 | );
|
---|
153 | [id(3)] HRESULT GetId(
|
---|
154 | [out] LPWSTR *ppstrId
|
---|
155 | );
|
---|
156 | [id(4)] HRESULT GetState(
|
---|
157 | [out] DWORD *pdwState
|
---|
158 | );
|
---|
159 | }
|
---|
160 |
|
---|
161 | [
|
---|
162 | object,
|
---|
163 | local,
|
---|
164 | uuid(0bd7a1be-7a1a-44db-8397-cc5392387b5e),
|
---|
165 | nonextensible,
|
---|
166 | pointer_default(unique)
|
---|
167 | ]
|
---|
168 | interface IMMDeviceCollection : IUnknown
|
---|
169 | {
|
---|
170 | [id(1)] HRESULT GetCount(
|
---|
171 | [out] UINT *pcDevices
|
---|
172 | );
|
---|
173 | [id(2)] HRESULT Item(
|
---|
174 | [in] UINT nDevice,
|
---|
175 | [out] IMMDevice **ppdevice
|
---|
176 | );
|
---|
177 | }
|
---|
178 |
|
---|
179 | [
|
---|
180 | object,
|
---|
181 | local,
|
---|
182 | uuid(1be09788-6894-4089-8586-9a2a6c265ac5),
|
---|
183 | nonextensible,
|
---|
184 | pointer_default(unique)
|
---|
185 | ]
|
---|
186 | interface IMMEndpoint : IUnknown
|
---|
187 | {
|
---|
188 | [id(1)] HRESULT GetDataFlow(
|
---|
189 | [out] EDataFlow *pDataFlow
|
---|
190 | );
|
---|
191 | }
|
---|
192 |
|
---|
193 | [
|
---|
194 | object,
|
---|
195 | local,
|
---|
196 | uuid(a95664d2-9614-4f35-a746-de8db63617e6),
|
---|
197 | nonextensible,
|
---|
198 | pointer_default(unique)
|
---|
199 | ]
|
---|
200 | interface IMMDeviceEnumerator : IUnknown
|
---|
201 | {
|
---|
202 | [id(1)] HRESULT EnumAudioEndpoints(
|
---|
203 | [in] EDataFlow dataFlow,
|
---|
204 | [in] DWORD dwStateMask,
|
---|
205 | [out] IMMDeviceCollection **ppDevices
|
---|
206 | );
|
---|
207 | [id(2)] HRESULT GetDefaultAudioEndpoint(
|
---|
208 | [in] EDataFlow dataFlow,
|
---|
209 | [in] ERole role,
|
---|
210 | [out] IMMDevice **ppEndpoint
|
---|
211 | );
|
---|
212 | [id(3)] HRESULT GetDevice(
|
---|
213 | [in] LPCWSTR pwstrId,
|
---|
214 | [out] IMMDevice **ppDevice
|
---|
215 | );
|
---|
216 | [id(4)] HRESULT RegisterEndpointNotificationCallback(
|
---|
217 | [in] IMMNotificationClient *pClient
|
---|
218 | );
|
---|
219 | [id(5)] HRESULT UnregisterEndpointNotificationCallback(
|
---|
220 | [in] IMMNotificationClient *pClient
|
---|
221 | );
|
---|
222 | }
|
---|
223 |
|
---|
224 | [
|
---|
225 | object,
|
---|
226 | local,
|
---|
227 | uuid(3b0d0ea4-d0a9-4b0e-935b-09516746fac0),
|
---|
228 | nonextensible,
|
---|
229 | pointer_default(unique)
|
---|
230 | ]
|
---|
231 | interface IMMDeviceActivator : IUnknown
|
---|
232 | {
|
---|
233 | [id(1)] HRESULT Activate(
|
---|
234 | [in] REFIID iid,
|
---|
235 | [in] IMMDevice *pDevice,
|
---|
236 | [in] PROPVARIANT *pActivationParams,
|
---|
237 | [out,iid_is(iid)] void **ppv
|
---|
238 | );
|
---|
239 | }
|
---|
240 |
|
---|
241 | typedef struct _AudioExtensionParams
|
---|
242 | {
|
---|
243 | LPARAM AddPageParam;
|
---|
244 | IMMDevice *pEndPoint;
|
---|
245 | IMMDevice *pPnpInterface;
|
---|
246 | IMMDevice *pPnpDevnode;
|
---|
247 | } AudioExtensionParams;
|
---|
248 |
|
---|
249 | [
|
---|
250 | uuid(2fdaafa3-7523-4f66-9957-9d5e7fe698f6),
|
---|
251 | version(1.0)
|
---|
252 | ]
|
---|
253 | library MMDeviceAPILib
|
---|
254 | {
|
---|
255 | [ uuid(bcde0395-e52f-467c-8e3d-c4579291692e) ] coclass MMDeviceEnumerator
|
---|
256 | {
|
---|
257 | [default] interface IMMDeviceEnumerator;
|
---|
258 | }
|
---|
259 | }
|
---|