ISoundModule.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using OpenMetaverse;
  29. namespace OpenSim.Region.Framework.Interfaces
  30. {
  31. public interface ISoundModule
  32. {
  33. /// <summary>
  34. /// Maximum distance between a sound source and a recipient.
  35. /// </summary>
  36. float MaxDistance { get; }
  37. /// <summary>
  38. /// Play a sound from an object.
  39. /// </summary>
  40. /// <param name="soundID">Sound asset ID</param>
  41. /// <param name="ownerID">Sound source owner</param>
  42. /// <param name="objectID">Sound source ID</param>
  43. /// <param name="gain">Sound volume</param>
  44. /// <param name="position">Sound source position</param>
  45. /// <param name="flags">Sound flags</param>
  46. /// <param name="radius">
  47. /// Radius used to affect gain over distance.
  48. /// </param>
  49. void PlayAttachedSound(UUID soundID, UUID ownerID, UUID objectID,
  50. double gain, Vector3 position, byte flags, float radius);
  51. /// <summary>
  52. /// Trigger a sound in the scene.
  53. /// </summary>
  54. /// <param name="soundId">Sound asset ID</param>
  55. /// <param name="ownerID">Sound source owner</param>
  56. /// <param name="objectID">Sound source ID</param>
  57. /// <param name="parentID">Sound source parent.</param>
  58. /// <param name="gain">Sound volume</param>
  59. /// <param name="position">Sound source position</param>
  60. /// <param name="handle"></param>
  61. /// <param name="radius">
  62. /// Radius used to affect gain over distance.
  63. /// </param>
  64. void TriggerSound(
  65. UUID soundId, UUID ownerID, UUID objectID, UUID parentID,
  66. double gain, Vector3 position, UInt64 handle, float radius);
  67. /// <summary>
  68. /// Stop sounds eminating from an object.
  69. /// </summary>
  70. /// <param name="objectID">Sound source ID</param>
  71. void StopSound(UUID objectID);
  72. /// <summary>
  73. /// Preload sound to viewers within range.
  74. /// </summary>
  75. /// <param name="objectID">Sound source ID</param>
  76. /// <param name="soundID">Sound asset ID</param>
  77. /// <param name="radius">
  78. /// Radius used to determine which viewers should preload the sound.
  79. /// </param>
  80. void PreloadSound(UUID objectID, UUID soundID, float radius);
  81. /// <summary>
  82. /// Loop specified sound at specified volume with specified radius,
  83. /// optionally declaring object as new sync master.
  84. /// </summary>
  85. /// <param name="objectID">Sound source ID</param>
  86. /// <param name="soundID">Sound asset ID</param>
  87. /// <param name="gain">Sound volume</param>
  88. /// <param name="radius">Sound radius</param>
  89. /// <param name="isMaster">Set object to sync master if true</param>
  90. void LoopSound(UUID objectID, UUID soundID, double gain,
  91. double radius, bool isMaster);
  92. /// <summary>
  93. /// Trigger or play an attached sound in this part's inventory.
  94. /// </summary>
  95. /// <param name="objectID">Sound source ID</param>
  96. /// <param name="sound">Sound asset ID</param>
  97. /// <param name="volume">Sound volume</param>
  98. /// <param name="triggered">Triggered or not.</param>
  99. /// <param name="radius">Sound radius</param>
  100. /// <param name="useMaster">Play using sound master</param>
  101. /// <param name="isMaster">Play as sound master</param>
  102. void SendSound(UUID objectID, UUID sound, double volume,
  103. bool triggered, byte flags, float radius, bool useMaster,
  104. bool isMaster);
  105. /// <summary>
  106. /// Trigger a sound to be played to all agents within an axis-aligned
  107. /// bounding box.
  108. /// </summary>
  109. /// <param name="objectID">Sound source ID</param>
  110. /// <param name="sound">Sound asset ID</param>
  111. /// <param name="volume">Sound volume</param>
  112. /// <param name="min">AABB bottom south-west corner</param>
  113. /// <param name="max">AABB top north-east corner</param>
  114. void TriggerSoundLimited(UUID objectID, UUID sound, double volume,
  115. Vector3 min, Vector3 max);
  116. /// <summary>
  117. /// Set whether sounds on the given prim should be queued.
  118. /// </summary>
  119. /// <param name='objectID'></param>
  120. /// <param name='shouldQueue'></param>
  121. void SetSoundQueueing(UUID objectID, bool shouldQueue);
  122. }
  123. }