ISoundModule.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. using OpenSim.Region.Framework.Scenes;
  30. namespace OpenSim.Region.Framework.Interfaces
  31. {
  32. public interface ISoundModule
  33. {
  34. /// <summary>
  35. /// Maximum distance between a sound source and a recipient.
  36. /// </summary>
  37. float MaxDistance { get; }
  38. /// <summary>
  39. /// Play a sound from an object.
  40. /// </summary>
  41. /// <param name="soundID">Sound asset ID</param>
  42. /// <param name="ownerID">Sound source owner</param>
  43. /// <param name="objectID">Sound source ID</param>
  44. /// <param name="gain">Sound volume</param>
  45. /// <param name="position">Sound source position</param>
  46. /// <param name="flags">Sound flags</param>
  47. /// </param>
  48. void PlayAttachedSound(UUID soundID, UUID ownerID, UUID objectID,
  49. double gain, Vector3 position, byte flags);
  50. /// <summary>
  51. /// Trigger a sound in the scene.
  52. /// </summary>
  53. /// <param name="soundId">Sound asset ID</param>
  54. /// <param name="ownerID">Sound source owner</param>
  55. /// <param name="objectID">Sound source ID</param>
  56. /// <param name="parentID">Sound source parent.</param>
  57. /// <param name="gain">Sound volume</param>
  58. /// <param name="position">Sound source position</param>
  59. /// <param name="handle"></param>
  60. /// <param name="radius">
  61. /// Radius used to affect gain over distance.
  62. /// </param>
  63. void TriggerSound(
  64. UUID soundId, UUID ownerID, UUID objectID, UUID parentID,
  65. double gain, Vector3 position, UInt64 handle);
  66. void TriggerCollisionSound(
  67. UUID soundId, UUID ownerID, UUID objectID, UUID parentID,
  68. double gain, Vector3 position, UInt64 handle);
  69. /// <summary>
  70. /// Stop sounds eminating from an object.
  71. /// </summary>
  72. /// <param name="objectID">Sound source ID</param>
  73. void StopSound(UUID objectID);
  74. void StopSound(SceneObjectPart sop);
  75. /// <summary>
  76. /// Preload sound to viewers within range.
  77. /// </summary>
  78. /// <param name="objectID">Sound source ID</param>
  79. /// <param name="soundID">Sound asset ID</param>
  80. /// </param>
  81. void PreloadSound(UUID objectID, UUID soundID);
  82. void PreloadSound(SceneObjectPart sop, UUID soundID);
  83. /// <summary>
  84. /// Loop specified sound at specified volume with specified radius,
  85. /// optionally declaring object as new sync master.
  86. /// </summary>
  87. /// <param name="objectID">Sound source ID</param>
  88. /// <param name="soundID">Sound asset ID</param>
  89. /// <param name="gain">Sound volume</param>
  90. /// <param name="isMaster">Set object to sync master if true</param>
  91. void LoopSound(UUID objectID, UUID soundID, double gain,
  92. bool isMaster, bool isSlave);
  93. void LoopSound(SceneObjectPart sop, UUID soundID, double gain,
  94. bool isMaster, bool isSlave);
  95. /// <summary>
  96. /// Trigger or play an attached sound in this part's inventory.
  97. /// </summary>
  98. /// <param name="objectID">Sound source ID</param>
  99. /// <param name="sound">Sound asset ID</param>
  100. /// <param name="volume">Sound volume</param>
  101. /// <param name="triggered">Triggered or not.</param>
  102. /// <param name="useMaster">Play using sound master</param>
  103. /// <param name="isMaster">Play as sound master</param>
  104. void SendSound(UUID objectID, UUID sound, double volume,
  105. bool triggered, byte flags, bool useMaster,
  106. bool isMaster);
  107. void SendSound(SceneObjectPart sop, UUID sound, double volume,
  108. bool triggered, byte flags, bool useMaster,
  109. bool isMaster);
  110. /// <summary>
  111. /// Trigger a sound to be played to all agents within an axis-aligned
  112. /// bounding box.
  113. /// </summary>
  114. /// <param name="objectID">Sound source ID</param>
  115. /// <param name="sound">Sound asset ID</param>
  116. /// <param name="volume">Sound volume</param>
  117. /// <param name="min">AABB bottom south-west corner</param>
  118. /// <param name="max">AABB top north-east corner</param>
  119. void TriggerSoundLimited(UUID objectID, UUID sound, double volume,
  120. Vector3 min, Vector3 max);
  121. /// <summary>
  122. /// Set whether sounds on the given prim should be queued.
  123. /// </summary>
  124. /// <param name='objectID'></param>
  125. /// <param name='shouldQueue'></param>
  126. void SetSoundQueueing(UUID objectID, bool shouldQueue);
  127. }
  128. }