Implement llSetSoundQueueing().

This is controlled by the viewer, not the server.
So as per http://wiki.secondlife.com/wiki/LlSetSoundQueueing, only two sounds can be queued per prim.
You probably need to use llPreloadSound() for best results
user_profiles
Justin Clark-Casey (justincc) 2013-05-22 20:01:57 +01:00
parent 6596a1de80
commit 7d38f4940c
4 changed files with 33 additions and 6 deletions

View File

@ -369,6 +369,15 @@ namespace OpenSim.Region.CoreModules.World.Sound
}); });
} }
public void SetSoundQueueing(UUID objectID, bool shouldQueue)
{
SceneObjectPart part;
if (!m_scene.TryGetSceneObjectPart(objectID, out part))
return;
part.SoundQueueing = shouldQueue;
}
#endregion #endregion
} }
} }

View File

@ -104,7 +104,6 @@ namespace OpenSim.Region.Framework.Interfaces
/// <param name="sound">Sound asset ID</param> /// <param name="sound">Sound asset ID</param>
/// <param name="volume">Sound volume</param> /// <param name="volume">Sound volume</param>
/// <param name="triggered">Triggered or not.</param> /// <param name="triggered">Triggered or not.</param>
/// <param name="flags"></param>
/// <param name="radius">Sound radius</param> /// <param name="radius">Sound radius</param>
/// <param name="useMaster">Play using sound master</param> /// <param name="useMaster">Play using sound master</param>
/// <param name="isMaster">Play as sound master</param> /// <param name="isMaster">Play as sound master</param>
@ -123,5 +122,12 @@ namespace OpenSim.Region.Framework.Interfaces
/// <param name="max">AABB top north-east corner</param> /// <param name="max">AABB top north-east corner</param>
void TriggerSoundLimited(UUID objectID, UUID sound, double volume, void TriggerSoundLimited(UUID objectID, UUID sound, double volume,
Vector3 min, Vector3 max); Vector3 min, Vector3 max);
/// <summary>
/// Set whether sounds on the given prim should be queued.
/// </summary>
/// <param name='objectID'></param>
/// <param name='shouldQueue'></param>
void SetSoundQueueing(UUID objectID, bool shouldQueue);
} }
} }

View File

@ -219,6 +219,14 @@ namespace OpenSim.Region.Framework.Scenes
public double SoundRadius; public double SoundRadius;
/// <summary>
/// Should sounds played from this prim be queued?
/// </summary>
/// <remarks>
/// This should only be changed by sound modules. It is up to sound modules as to how they interpret this setting.
/// </remarks>
public bool SoundQueueing { get; set; }
public uint TimeStampFull; public uint TimeStampFull;
public uint TimeStampLastActivity; // Will be used for AutoReturn public uint TimeStampLastActivity; // Will be used for AutoReturn
@ -2429,7 +2437,7 @@ namespace OpenSim.Region.Framework.Scenes
if (soundModule != null) if (soundModule != null)
{ {
soundModule.SendSound(UUID, CollisionSound, soundModule.SendSound(UUID, CollisionSound,
CollisionSoundVolume, true, (byte)0, 0, false, CollisionSoundVolume, true, 0, 0, false,
false); false);
} }
} }

View File

@ -2474,9 +2474,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// send the sound, once, to all clients in range // send the sound, once, to all clients in range
if (m_SoundModule != null) if (m_SoundModule != null)
{ {
m_SoundModule.SendSound(m_host.UUID, m_SoundModule.SendSound(
ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound), volume, false, 0, m_host.UUID,
0, false, false); ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound),
volume, false, m_host.SoundQueueing ? (byte)SoundFlags.Queue : (byte)SoundFlags.None,
0, false, false);
} }
} }
@ -11822,7 +11824,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetSoundQueueing(int queue) public void llSetSoundQueueing(int queue)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llSetSoundQueueing");
if (m_SoundModule != null)
m_SoundModule.SetSoundQueueing(m_host.UUID, queue == ScriptBaseClass.TRUE.value);
} }
public void llCollisionSprite(string impact_sprite) public void llCollisionSprite(string impact_sprite)