diff options
author | Adam Frisby | 2009-05-29 23:49:48 +0000 |
---|---|---|
committer | Adam Frisby | 2009-05-29 23:49:48 +0000 |
commit | c30b5ee0144faf60bcdaf6f79c91e3eeb316f104 (patch) | |
tree | 4f22a6f2091707f3160b1efefe60b90cbca81cdc /OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs | |
parent | * Protip: When you click 'make public' in resharper, note to save before comm... (diff) | |
download | opensim-SC-c30b5ee0144faf60bcdaf6f79c91e3eeb316f104.zip opensim-SC-c30b5ee0144faf60bcdaf6f79c91e3eeb316f104.tar.gz opensim-SC-c30b5ee0144faf60bcdaf6f79c91e3eeb316f104.tar.bz2 opensim-SC-c30b5ee0144faf60bcdaf6f79c91e3eeb316f104.tar.xz |
* Adds World.Audio.* to MRM
* This includes methods such as PlaySound which take a Position as an argument, allowing you to trigger sounds arbitrarily across the scene without needing a parent object in the position.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs index dc80dcc..1ec4a33 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs | |||
@@ -26,13 +26,15 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using OpenMetaverse; | ||
29 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
30 | using OpenSim.Region.Framework.Interfaces; | 31 | using OpenSim.Region.Framework.Interfaces; |
31 | using OpenSim.Region.Framework.Scenes; | 32 | using OpenSim.Region.Framework.Scenes; |
33 | using OpenSim.Region.OptionalModules.Scripting.Minimodule.WorldX; | ||
32 | 34 | ||
33 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | 35 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule |
34 | { | 36 | { |
35 | public class World : System.MarshalByRefObject, IWorld | 37 | public class World : System.MarshalByRefObject, IWorld, IWorldAudio |
36 | { | 38 | { |
37 | private readonly Scene m_internalScene; | 39 | private readonly Scene m_internalScene; |
38 | private readonly Heightmap m_heights; | 40 | private readonly Heightmap m_heights; |
@@ -93,6 +95,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
93 | private event OnChatDelegate _OnChat; | 95 | private event OnChatDelegate _OnChat; |
94 | private bool _OnChatActive; | 96 | private bool _OnChatActive; |
95 | 97 | ||
98 | public IWorldAudio Audio | ||
99 | { | ||
100 | get { return this; } | ||
101 | } | ||
102 | |||
96 | public event OnChatDelegate OnChat | 103 | public event OnChatDelegate OnChat |
97 | { | 104 | { |
98 | add | 105 | add |
@@ -211,5 +218,29 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
211 | { | 218 | { |
212 | get { return m_heights; } | 219 | get { return m_heights; } |
213 | } | 220 | } |
221 | |||
222 | #region Implementation of IWorldAudio | ||
223 | |||
224 | public void PlaySound(UUID audio, Vector3 position, double volume) | ||
225 | { | ||
226 | ISoundModule soundModule = m_internalScene.RequestModuleInterface<ISoundModule>(); | ||
227 | if (soundModule != null) | ||
228 | { | ||
229 | soundModule.TriggerSound(audio, UUID.Zero, UUID.Zero, UUID.Zero, volume, position, | ||
230 | m_internalScene.RegionInfo.RegionHandle); | ||
231 | } | ||
232 | } | ||
233 | |||
234 | public void PlaySound(UUID audio, Vector3 position) | ||
235 | { | ||
236 | ISoundModule soundModule = m_internalScene.RequestModuleInterface<ISoundModule>(); | ||
237 | if (soundModule != null) | ||
238 | { | ||
239 | soundModule.TriggerSound(audio, UUID.Zero, UUID.Zero, UUID.Zero, 1.0, position, | ||
240 | m_internalScene.RegionInfo.RegionHandle); | ||
241 | } | ||
242 | } | ||
243 | |||
244 | #endregion | ||
214 | } | 245 | } |
215 | } | 246 | } |