diff options
author | SignpostMarv | 2012-10-15 14:28:34 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-10-29 23:38:59 +0000 |
commit | 9df510157e26ffcaf04fd4b85512778fddc08f68 (patch) | |
tree | cdbe80ed975bd16cd59416e556fdbb2a4273d4ef /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |
parent | removing superfluous lines from SceneObjectPart.SendSound (diff) | |
download | opensim-SC_OLD-9df510157e26ffcaf04fd4b85512778fddc08f68.zip opensim-SC_OLD-9df510157e26ffcaf04fd4b85512778fddc08f68.tar.gz opensim-SC_OLD-9df510157e26ffcaf04fd4b85512778fddc08f68.tar.bz2 opensim-SC_OLD-9df510157e26ffcaf04fd4b85512778fddc08f68.tar.xz |
deduplicating code into a single LoopSound method
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0252145..c479944 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2370,28 +2370,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2370 | m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0, 0, false, false); | 2370 | m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0, 0, false, false); |
2371 | } | 2371 | } |
2372 | 2372 | ||
2373 | // Xantor 20080528 we should do this differently. | ||
2374 | // 1) apply the sound to the object | ||
2375 | // 2) schedule full update | ||
2376 | // just sending the sound out once doesn't work so well when other avatars come in view later on | ||
2377 | // or when the prim gets moved, changed, sat on, whatever | ||
2378 | // see large number of mantises (mantes?) | ||
2379 | // 20080530 Updated to remove code duplication | ||
2380 | // 20080530 Stop sound if there is one, otherwise volume only changes don't work | ||
2381 | public void llLoopSound(string sound, double volume) | 2373 | public void llLoopSound(string sound, double volume) |
2382 | { | 2374 | { |
2383 | m_host.AddScriptLPS(1); | 2375 | m_host.AddScriptLPS(1); |
2384 | 2376 | if (m_SoundModule != null) | |
2385 | if (m_host.Sound != UUID.Zero) | 2377 | { |
2386 | llStopSound(); | 2378 | m_SoundModule.LoopSound(m_host.UUID, KeyOrName(sound), |
2387 | 2379 | volume, 20, false); | |
2388 | m_host.Sound = KeyOrName(sound); | 2380 | } |
2389 | m_host.SoundGain = volume; | ||
2390 | m_host.SoundFlags = 1; // looping | ||
2391 | m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable? | ||
2392 | |||
2393 | m_host.ScheduleFullUpdate(); | ||
2394 | m_host.SendFullUpdateToAllClients(); | ||
2395 | } | 2381 | } |
2396 | 2382 | ||
2397 | public void llLoopSoundMaster(string sound, double volume) | 2383 | public void llLoopSoundMaster(string sound, double volume) |
@@ -2399,8 +2385,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2399 | m_host.AddScriptLPS(1); | 2385 | m_host.AddScriptLPS(1); |
2400 | if (m_SoundModule != null) | 2386 | if (m_SoundModule != null) |
2401 | { | 2387 | { |
2402 | m_SoundModule.LoopSoundMaster(m_host.UUID, KeyOrName(sound), | 2388 | m_SoundModule.LoopSound(m_host.UUID, KeyOrName(sound), |
2403 | volume, 20); | 2389 | volume, 20, true); |
2404 | } | 2390 | } |
2405 | } | 2391 | } |
2406 | 2392 | ||