aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorSignpostMarv2012-10-05 14:55:00 +0100
committerJustin Clark-Casey (justincc)2012-10-29 23:38:58 +0000
commit8763a637b5c2e48a97111b4f569e71b7e1c2f1d2 (patch)
tree5dfcccb249da9e5f710c3fbb7cd4865e63325804 /OpenSim/Region
parentmoving comment for llStopSound inside the method block prior to transposition... (diff)
downloadopensim-SC-8763a637b5c2e48a97111b4f569e71b7e1c2f1d2.zip
opensim-SC-8763a637b5c2e48a97111b4f569e71b7e1c2f1d2.tar.gz
opensim-SC-8763a637b5c2e48a97111b4f569e71b7e1c2f1d2.tar.bz2
opensim-SC-8763a637b5c2e48a97111b4f569e71b7e1c2f1d2.tar.xz
transposing stop sound into sound module
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs45
-rw-r--r--OpenSim/Region/Framework/Interfaces/ISoundModule.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs42
3 files changed, 56 insertions, 37 deletions
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs
index f0e446f..670794d 100644
--- a/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs
+++ b/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs
@@ -178,6 +178,51 @@ namespace OpenSim.Region.CoreModules.World.Sound
178 }); 178 });
179 } 179 }
180 180
181 public virtual void StopSound(UUID objectID)
182 {
183 SceneObjectPart m_host;
184 if (!m_scene.TryGetSceneObjectPart(objectID, out m_host))
185 return;
186
187 m_host.AdjustSoundGain(0);
188 // Xantor 20080528: Clear prim data of sound instead
189 if (m_host.ParentGroup.LoopSoundSlavePrims.Contains(m_host))
190 {
191 if (m_host.ParentGroup.LoopSoundMasterPrim == m_host)
192 {
193 foreach (SceneObjectPart part in m_host.ParentGroup.LoopSoundSlavePrims)
194 {
195 part.Sound = UUID.Zero;
196 part.SoundGain = 0;
197 part.SoundFlags = 0;
198 part.SoundRadius = 0;
199 part.ScheduleFullUpdate();
200 part.SendFullUpdateToAllClients();
201 }
202 m_host.ParentGroup.LoopSoundMasterPrim = null;
203 m_host.ParentGroup.LoopSoundSlavePrims.Clear();
204 }
205 else
206 {
207 m_host.Sound = UUID.Zero;
208 m_host.SoundGain = 0;
209 m_host.SoundFlags = 0;
210 m_host.SoundRadius = 0;
211 m_host.ScheduleFullUpdate();
212 m_host.SendFullUpdateToAllClients();
213 }
214 }
215 else
216 {
217 m_host.Sound = UUID.Zero;
218 m_host.SoundGain = 0;
219 m_host.SoundFlags = 0;
220 m_host.SoundRadius = 0;
221 m_host.ScheduleFullUpdate();
222 m_host.SendFullUpdateToAllClients();
223 }
224 }
225
181 #endregion 226 #endregion
182 } 227 }
183} 228}
diff --git a/OpenSim/Region/Framework/Interfaces/ISoundModule.cs b/OpenSim/Region/Framework/Interfaces/ISoundModule.cs
index 6930d78..45219ed 100644
--- a/OpenSim/Region/Framework/Interfaces/ISoundModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/ISoundModule.cs
@@ -68,5 +68,11 @@ namespace OpenSim.Region.Framework.Interfaces
68 void TriggerSound( 68 void TriggerSound(
69 UUID soundId, UUID ownerID, UUID objectID, UUID parentID, 69 UUID soundId, UUID ownerID, UUID objectID, UUID parentID,
70 double gain, Vector3 position, UInt64 handle, float radius); 70 double gain, Vector3 position, UInt64 handle, float radius);
71
72 /// <summary>
73 /// Stop sounds eminating from an object.
74 /// </summary>
75 /// <param name="objectID">Sound source ID</param>
76 void StopSound(UUID objectID);
71 } 77 }
72} \ No newline at end of file 78} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 7fa01c1..25be3ff 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -107,6 +107,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
107 protected IUrlModule m_UrlModule = null; 107 protected IUrlModule m_UrlModule = null;
108 protected Dictionary<UUID, UserInfoCacheEntry> m_userInfoCache = new Dictionary<UUID, UserInfoCacheEntry>(); 108 protected Dictionary<UUID, UserInfoCacheEntry> m_userInfoCache = new Dictionary<UUID, UserInfoCacheEntry>();
109 protected int EMAIL_PAUSE_TIME = 20; // documented delay value for smtp. 109 protected int EMAIL_PAUSE_TIME = 20; // documented delay value for smtp.
110 protected ISoundModule m_SoundModule = null;
110 111
111 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) 112 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item)
112 { 113 {
@@ -119,6 +120,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
119 m_TransferModule = 120 m_TransferModule =
120 m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>(); 121 m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>();
121 m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); 122 m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
123 m_SoundModule = m_ScriptEngine.World.RequestModuleInterface<ISoundModule>();
122 124
123 AsyncCommands = new AsyncCommandManager(ScriptEngine); 125 AsyncCommands = new AsyncCommandManager(ScriptEngine);
124 } 126 }
@@ -2451,43 +2453,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2451 public void llStopSound() 2453 public void llStopSound()
2452 { 2454 {
2453 m_host.AddScriptLPS(1); 2455 m_host.AddScriptLPS(1);
2454 m_host.AdjustSoundGain(0); 2456
2455 // Xantor 20080528: Clear prim data of sound instead 2457 if (m_SoundModule != null)
2456 if (m_host.ParentGroup.LoopSoundSlavePrims.Contains(m_host)) 2458 m_SoundModule.StopSound(m_host.UUID);
2457 {
2458 if (m_host.ParentGroup.LoopSoundMasterPrim == m_host)
2459 {
2460 foreach (SceneObjectPart part in m_host.ParentGroup.LoopSoundSlavePrims)
2461 {
2462 part.Sound = UUID.Zero;
2463 part.SoundGain = 0;
2464 part.SoundFlags = 0;
2465 part.SoundRadius = 0;
2466 part.ScheduleFullUpdate();
2467 part.SendFullUpdateToAllClients();
2468 }
2469 m_host.ParentGroup.LoopSoundMasterPrim = null;
2470 m_host.ParentGroup.LoopSoundSlavePrims.Clear();
2471 }
2472 else
2473 {
2474 m_host.Sound = UUID.Zero;
2475 m_host.SoundGain = 0;
2476 m_host.SoundFlags = 0;
2477 m_host.SoundRadius = 0;
2478 m_host.ScheduleFullUpdate();
2479 m_host.SendFullUpdateToAllClients();
2480 }
2481 }
2482 else
2483 {
2484 m_host.Sound = UUID.Zero;
2485 m_host.SoundGain = 0;
2486 m_host.SoundFlags = 0;
2487 m_host.SoundRadius = 0;
2488 m_host.ScheduleFullUpdate();
2489 m_host.SendFullUpdateToAllClients();
2490 }
2491 } 2459 }
2492 2460
2493 public void llPreloadSound(string sound) 2461 public void llPreloadSound(string sound)