mmdeviceapi.idl 8.1 KB

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