SoundSource3D.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // SoundSource3D.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho.Audio
  18. {
  19. /// <summary>
  20. /// %Sound source component with three-dimensional position.
  21. /// </summary>
  22. public unsafe partial class SoundSource3D : SoundSource
  23. {
  24. unsafe partial void OnSoundSource3DCreated ();
  25. [Preserve]
  26. public SoundSource3D (IntPtr handle) : base (handle)
  27. {
  28. OnSoundSource3DCreated ();
  29. }
  30. [Preserve]
  31. protected SoundSource3D (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnSoundSource3DCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int SoundSource3D_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (SoundSource3D_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr SoundSource3D_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (SoundSource3D_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int SoundSource3D_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(SoundSource3D));
  54. return new StringHash (SoundSource3D_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr SoundSource3D_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(SoundSource3D));
  61. return Marshal.PtrToStringAnsi (SoundSource3D_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public SoundSource3D () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr SoundSource3D_SoundSource3D (IntPtr context);
  69. [Preserve]
  70. public SoundSource3D (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(SoundSource3D));
  73. handle = SoundSource3D_SoundSource3D ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnSoundSource3DCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void SoundSource3D_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory.
  81. /// </summary>
  82. public new static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(SoundSource3D));
  85. SoundSource3D_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void SoundSource3D_DrawDebugGeometry (IntPtr handle, IntPtr debug, bool depthTest);
  89. /// <summary>
  90. /// Visualize the component as debug geometry.
  91. /// </summary>
  92. public override void DrawDebugGeometry (DebugRenderer debug, bool depthTest)
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. SoundSource3D_DrawDebugGeometry (handle, (object)debug == null ? IntPtr.Zero : debug.Handle, depthTest);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern void SoundSource3D_Update (IntPtr handle, float timeStep);
  99. /// <summary>
  100. /// Update sound source.
  101. /// </summary>
  102. public override void Update (float timeStep)
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. SoundSource3D_Update (handle, timeStep);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern void SoundSource3D_SetDistanceAttenuation (IntPtr handle, float nearDistance, float farDistance, float rolloffFactor);
  109. /// <summary>
  110. /// Set attenuation parameters.
  111. /// </summary>
  112. public void SetDistanceAttenuation (float nearDistance, float farDistance, float rolloffFactor)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. SoundSource3D_SetDistanceAttenuation (handle, nearDistance, farDistance, rolloffFactor);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern void SoundSource3D_SetAngleAttenuation (IntPtr handle, float innerAngle, float outerAngle);
  119. /// <summary>
  120. /// Set angle attenuation parameters.
  121. /// </summary>
  122. public void SetAngleAttenuation (float innerAngle, float outerAngle)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. SoundSource3D_SetAngleAttenuation (handle, innerAngle, outerAngle);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern void SoundSource3D_SetNearDistance (IntPtr handle, float distance);
  129. /// <summary>
  130. /// Set near distance. Inside this range sound will not be attenuated.
  131. /// </summary>
  132. private void SetNearDistance (float distance)
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. SoundSource3D_SetNearDistance (handle, distance);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern void SoundSource3D_SetFarDistance (IntPtr handle, float distance);
  139. /// <summary>
  140. /// Set far distance. Outside this range sound will be completely attenuated.
  141. /// </summary>
  142. private void SetFarDistance (float distance)
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. SoundSource3D_SetFarDistance (handle, distance);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern void SoundSource3D_SetInnerAngle (IntPtr handle, float angle);
  149. /// <summary>
  150. /// Set inner angle in degrees. Inside this angle sound will not be attenuated.By default 360, meaning direction never has an effect.
  151. /// </summary>
  152. private void SetInnerAngle (float angle)
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. SoundSource3D_SetInnerAngle (handle, angle);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern void SoundSource3D_SetOuterAngle (IntPtr handle, float angle);
  159. /// <summary>
  160. /// Set outer angle in degrees. Outside this angle sound will be completely attenuated. By default 360, meaning direction never has an effect.
  161. /// </summary>
  162. private void SetOuterAngle (float angle)
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. SoundSource3D_SetOuterAngle (handle, angle);
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern void SoundSource3D_SetRolloffFactor (IntPtr handle, float factor);
  169. /// <summary>
  170. /// Set rolloff power factor, defines attenuation function shape.
  171. /// </summary>
  172. public void SetRolloffFactor (float factor)
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. SoundSource3D_SetRolloffFactor (handle, factor);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern void SoundSource3D_CalculateAttenuation (IntPtr handle);
  179. /// <summary>
  180. /// Calculate attenuation and panning based on current position and listener position.
  181. /// </summary>
  182. public void CalculateAttenuation ()
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. SoundSource3D_CalculateAttenuation (handle);
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern float SoundSource3D_GetNearDistance (IntPtr handle);
  189. /// <summary>
  190. /// Return near distance.
  191. /// </summary>
  192. private float GetNearDistance ()
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. return SoundSource3D_GetNearDistance (handle);
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern float SoundSource3D_GetFarDistance (IntPtr handle);
  199. /// <summary>
  200. /// Return far distance.
  201. /// </summary>
  202. private float GetFarDistance ()
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. return SoundSource3D_GetFarDistance (handle);
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern float SoundSource3D_GetInnerAngle (IntPtr handle);
  209. /// <summary>
  210. /// Return inner angle in degrees.
  211. /// </summary>
  212. private float GetInnerAngle ()
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. return SoundSource3D_GetInnerAngle (handle);
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern float SoundSource3D_GetOuterAngle (IntPtr handle);
  219. /// <summary>
  220. /// Return outer angle in degrees.
  221. /// </summary>
  222. private float GetOuterAngle ()
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. return SoundSource3D_GetOuterAngle (handle);
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern float SoundSource3D_RollAngleoffFactor (IntPtr handle);
  229. /// <summary>
  230. /// Return rolloff power factor.
  231. /// </summary>
  232. public float RollAngleoffFactor ()
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. return SoundSource3D_RollAngleoffFactor (handle);
  236. }
  237. public override StringHash Type {
  238. get {
  239. return UrhoGetType ();
  240. }
  241. }
  242. public override string TypeName {
  243. get {
  244. return GetTypeName ();
  245. }
  246. }
  247. [Preserve]
  248. public new static StringHash TypeStatic {
  249. get {
  250. return GetTypeStatic ();
  251. }
  252. }
  253. public new static string TypeNameStatic {
  254. get {
  255. return GetTypeNameStatic ();
  256. }
  257. }
  258. /// <summary>
  259. /// Return near distance.
  260. /// Or
  261. /// Set near distance. Inside this range sound will not be attenuated.
  262. /// </summary>
  263. public float NearDistance {
  264. get {
  265. return GetNearDistance ();
  266. }
  267. set {
  268. SetNearDistance (value);
  269. }
  270. }
  271. /// <summary>
  272. /// Return far distance.
  273. /// Or
  274. /// Set far distance. Outside this range sound will be completely attenuated.
  275. /// </summary>
  276. public float FarDistance {
  277. get {
  278. return GetFarDistance ();
  279. }
  280. set {
  281. SetFarDistance (value);
  282. }
  283. }
  284. /// <summary>
  285. /// Return inner angle in degrees.
  286. /// Or
  287. /// Set inner angle in degrees. Inside this angle sound will not be attenuated.By default 360, meaning direction never has an effect.
  288. /// </summary>
  289. public float InnerAngle {
  290. get {
  291. return GetInnerAngle ();
  292. }
  293. set {
  294. SetInnerAngle (value);
  295. }
  296. }
  297. /// <summary>
  298. /// Return outer angle in degrees.
  299. /// Or
  300. /// Set outer angle in degrees. Outside this angle sound will be completely attenuated. By default 360, meaning direction never has an effect.
  301. /// </summary>
  302. public float OuterAngle {
  303. get {
  304. return GetOuterAngle ();
  305. }
  306. set {
  307. SetOuterAngle (value);
  308. }
  309. }
  310. }
  311. }