spatialaudioclient.idl 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /*
  2. * Copyright 2020 Nikolay Sivov for CodeWeavers
  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 "audioclient.idl";
  20. import "propsys.idl";
  21. typedef [v1_enum] enum AudioObjectType
  22. {
  23. AudioObjectType_None = 0,
  24. AudioObjectType_Dynamic = 0x00000001,
  25. AudioObjectType_FrontLeft = 0x00000002,
  26. AudioObjectType_FrontRight = 0x00000004,
  27. AudioObjectType_FrontCenter = 0x00000008,
  28. AudioObjectType_LowFrequency = 0x00000010,
  29. AudioObjectType_SideLeft = 0x00000020,
  30. AudioObjectType_SideRight = 0x00000040,
  31. AudioObjectType_BackLeft = 0x00000080,
  32. AudioObjectType_BackRight = 0x00000100,
  33. AudioObjectType_TopFrontLeft = 0x00000200,
  34. AudioObjectType_TopFrontRight = 0x00000400,
  35. AudioObjectType_TopBackLeft = 0x00000800,
  36. AudioObjectType_TopBackRight = 0x00001000,
  37. AudioObjectType_BottomFrontLeft = 0x00002000,
  38. AudioObjectType_BottomFrontRight = 0x00004000,
  39. AudioObjectType_BottomBackLeft = 0x00008000,
  40. AudioObjectType_BottomBackRight = 0x00010000,
  41. AudioObjectType_BackCenter = 0x00020000,
  42. } AudioObjectType;
  43. cpp_quote("#define SPTLAUDCLNT_E_DESTROYED AUDCLNT_ERR(0x100)")
  44. cpp_quote("#define SPTLAUDCLNT_E_OUT_OF_ORDER AUDCLNT_ERR(0x101)")
  45. cpp_quote("#define SPTLAUDCLNT_E_RESOURCES_INVALIDATED AUDCLNT_ERR(0x102)")
  46. cpp_quote("#define SPTLAUDCLNT_E_NO_MORE_OBJECTS AUDCLNT_ERR(0x103)")
  47. cpp_quote("#define SPTLAUDCLNT_E_PROPERTY_NOT_SUPPORTED AUDCLNT_ERR(0x104)")
  48. cpp_quote("#define SPTLAUDCLNT_E_ERRORS_IN_OBJECT_CALLS AUDCLNT_ERR(0x105)")
  49. cpp_quote("#define SPTLAUDCLNT_E_METADATA_FORMAT_NOT_SUPPORTED AUDCLNT_ERR(0x106)")
  50. cpp_quote("#define SPTLAUDCLNT_E_STREAM_NOT_AVAILABLE AUDCLNT_ERR(0x107)")
  51. cpp_quote("#define SPTLAUDCLNT_E_INVALID_LICENSE AUDCLNT_ERR(0x108)")
  52. cpp_quote("#define SPTLAUDCLNT_E_STREAM_NOT_STOPPED AUDCLNT_ERR(0x10a)")
  53. cpp_quote("#define SPTLAUDCLNT_E_STATIC_OBJECT_NOT_AVAILABLE AUDCLNT_ERR(0x10b)")
  54. cpp_quote("#define SPTLAUDCLNT_E_OBJECT_ALREADY_ACTIVE AUDCLNT_ERR(0x10c)")
  55. cpp_quote("#define SPTLAUDCLNT_E_INTERNAL AUDCLNT_ERR(0x10d)")
  56. interface ISpatialAudioObjectRenderStreamBase;
  57. [
  58. object,
  59. uuid(dddf83e6-68d7-4c70-883f-a1836afb4a50),
  60. pointer_default(unique),
  61. local
  62. ]
  63. interface ISpatialAudioObjectRenderStreamNotify : IUnknown
  64. {
  65. HRESULT OnAvailableDynamicObjectCountChange(
  66. [in] ISpatialAudioObjectRenderStreamBase *stream,
  67. [in] LONGLONG deadline,
  68. [in] UINT32 object_count);
  69. }
  70. typedef struct tagSpatialAudioObjectRenderStreamActivationParams
  71. {
  72. const WAVEFORMATEX *ObjectFormat;
  73. AudioObjectType StaticObjectTypeMask;
  74. UINT32 MinDynamicObjectCount;
  75. UINT32 MaxDynamicObjectCount;
  76. AUDIO_STREAM_CATEGORY Category;
  77. HANDLE EventHandle;
  78. ISpatialAudioObjectRenderStreamNotify *NotifyObject;
  79. } SpatialAudioObjectRenderStreamActivationParams;
  80. [
  81. object,
  82. uuid(dcdaa858-895a-4a22-a5eb-67bda506096d),
  83. pointer_default(unique),
  84. local
  85. ]
  86. interface IAudioFormatEnumerator : IUnknown
  87. {
  88. HRESULT GetCount(
  89. [out] UINT32 *count);
  90. HRESULT GetFormat(
  91. [in] UINT32 index,
  92. [out] WAVEFORMATEX **format);
  93. }
  94. [
  95. object,
  96. uuid(bbf8e066-aaaa-49be-9a4d-fd2a858ea27f),
  97. pointer_default(unique),
  98. local
  99. ]
  100. interface ISpatialAudioClient : IUnknown
  101. {
  102. HRESULT GetStaticObjectPosition(
  103. [in] AudioObjectType type,
  104. [out] float *x,
  105. [out] float *y,
  106. [out] float *z);
  107. HRESULT GetNativeStaticObjectTypeMask(
  108. [out] AudioObjectType *mask);
  109. HRESULT GetMaxDynamicObjectCount(
  110. [out] UINT32 *value);
  111. HRESULT GetSupportedAudioObjectFormatEnumerator(
  112. [out] IAudioFormatEnumerator **enumerator);
  113. HRESULT GetMaxFrameCount(
  114. [in] WAVEFORMATEX const *format,
  115. [out] UINT32 *count);
  116. HRESULT IsAudioObjectFormatSupported(
  117. [in] WAVEFORMATEX const *format);
  118. HRESULT IsSpatialAudioStreamAvailable(
  119. [in] REFIID stream_uuid,
  120. [in] PROPVARIANT const *info);
  121. HRESULT ActivateSpatialAudioStream(
  122. [in] PROPVARIANT const *params,
  123. [in] REFIID riid,
  124. [out, iid_is(riid)] void **stream);
  125. }
  126. [
  127. object,
  128. uuid(cce0b8f2-8d4d-4efb-a8cf-3d6ecf1c30e0),
  129. pointer_default(unique),
  130. local
  131. ]
  132. interface ISpatialAudioObjectBase : IUnknown
  133. {
  134. HRESULT GetBuffer(
  135. [out] BYTE **buffer,
  136. [out] UINT32 *bytes);
  137. HRESULT SetEndOfStream(
  138. [in] UINT32 frames);
  139. HRESULT IsActive(
  140. [out] BOOL *active);
  141. HRESULT GetAudioObjectType(
  142. [out] AudioObjectType *type);
  143. }
  144. [
  145. object,
  146. uuid(dde28967-521b-46e5-8f00-bd6f2bc8ab1d),
  147. pointer_default(unique),
  148. local
  149. ]
  150. interface ISpatialAudioObject : ISpatialAudioObjectBase
  151. {
  152. HRESULT SetPosition(
  153. [in] float x,
  154. [in] float y,
  155. [in] float z);
  156. HRESULT SetVolume(
  157. [in] float vol);
  158. }
  159. [
  160. object,
  161. uuid(feaaf403-c1d8-450d-aa05-e0ccee7502a8),
  162. pointer_default(unique),
  163. local
  164. ]
  165. interface ISpatialAudioObjectRenderStreamBase : IUnknown
  166. {
  167. HRESULT GetAvailableDynamicObjectCount(
  168. [out] UINT32 *count);
  169. HRESULT GetService(
  170. [in] REFIID riid,
  171. [out] void **service);
  172. HRESULT Start();
  173. HRESULT Stop();
  174. HRESULT Reset();
  175. HRESULT BeginUpdatingAudioObjects(
  176. [out] UINT32 *count,
  177. [out] UINT32 *frames);
  178. HRESULT EndUpdatingAudioObjects();
  179. }
  180. [
  181. object,
  182. uuid(bab5f473-b423-477b-85f5-b5a332a04153),
  183. pointer_default(unique),
  184. local
  185. ]
  186. interface ISpatialAudioObjectRenderStream : ISpatialAudioObjectRenderStreamBase
  187. {
  188. HRESULT ActivateSpatialAudioObject(
  189. [in] AudioObjectType type,
  190. [out] ISpatialAudioObject **object);
  191. }