ISoundModule.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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>
  47. void PlayAttachedSound(UUID soundID, UUID ownerID, UUID objectID,
  48. double gain, Vector3 position, byte flags);
  49. /// <summary>
  50. /// Trigger a sound in the scene.
  51. /// </summary>
  52. /// <param name="soundId">Sound asset ID</param>
  53. /// <param name="ownerID">Sound source owner</param>
  54. /// <param name="objectID">Sound source ID</param>
  55. /// <param name="parentID">Sound source parent.</param>
  56. /// <param name="gain">Sound volume</param>
  57. /// <param name="position">Sound source position</param>
  58. /// <param name="handle"></param>
  59. /// <param name="radius">
  60. /// Radius used to affect gain over distance.
  61. /// </param>
  62. void TriggerSound(
  63. UUID soundId, UUID ownerID, UUID objectID, UUID parentID,
  64. double gain, Vector3 position, UInt64 handle);
  65. /// <summary>
  66. /// Stop sounds eminating from an object.
  67. /// </summary>
  68. /// <param name="objectID">Sound source ID</param>
  69. void StopSound(UUID objectID);
  70. /// <summary>
  71. /// Preload sound to viewers within range.
  72. /// </summary>
  73. /// <param name="objectID">Sound source ID</param>
  74. /// <param name="soundID">Sound asset ID</param>
  75. /// </param>
  76. void PreloadSound(UUID objectID, UUID soundID);
  77. /// <summary>
  78. /// Loop specified sound at specified volume with specified radius,
  79. /// optionally declaring object as new sync master.
  80. /// </summary>
  81. /// <param name="objectID">Sound source ID</param>
  82. /// <param name="soundID">Sound asset ID</param>
  83. /// <param name="gain">Sound volume</param>
  84. /// <param name="isMaster">Set object to sync master if true</param>
  85. void LoopSound(UUID objectID, UUID soundID, double gain,
  86. bool isMaster, bool isSlave);
  87. /// <summary>
  88. /// Trigger or play an attached sound in this part's inventory.
  89. /// </summary>
  90. /// <param name="objectID">Sound source ID</param>
  91. /// <param name="sound">Sound asset ID</param>
  92. /// <param name="volume">Sound volume</param>
  93. /// <param name="triggered">Triggered or not.</param>
  94. /// <param name="useMaster">Play using sound master</param>
  95. /// <param name="isMaster">Play as sound master</param>
  96. void SendSound(UUID objectID, UUID sound, double volume,
  97. bool triggered, byte flags, bool useMaster,
  98. bool isMaster);
  99. /// <summary>
  100. /// Trigger a sound to be played to all agents within an axis-aligned
  101. /// bounding box.
  102. /// </summary>
  103. /// <param name="objectID">Sound source ID</param>
  104. /// <param name="sound">Sound asset ID</param>
  105. /// <param name="volume">Sound volume</param>
  106. /// <param name="min">AABB bottom south-west corner</param>
  107. /// <param name="max">AABB top north-east corner</param>
  108. void TriggerSoundLimited(UUID objectID, UUID sound, double volume,
  109. Vector3 min, Vector3 max);
  110. /// <summary>
  111. /// Set whether sounds on the given prim should be queued.
  112. /// </summary>
  113. /// <param name='objectID'></param>
  114. /// <param name='shouldQueue'></param>
  115. void SetSoundQueueing(UUID objectID, bool shouldQueue);
  116. }
  117. }