diff options
author | alondria | 2008-03-22 23:02:41 +0000 |
---|---|---|
committer | alondria | 2008-03-22 23:02:41 +0000 |
commit | 5ebef6410eeef54e1bd3d00331996daba78aa534 (patch) | |
tree | a43204b7a152b00170a9c5a7754908eee74ed58e | |
parent | * Miscellaneous comment before I found out that mantis 807 probably isn't an ... (diff) | |
download | opensim-SC-5ebef6410eeef54e1bd3d00331996daba78aa534.zip opensim-SC-5ebef6410eeef54e1bd3d00331996daba78aa534.tar.gz opensim-SC-5ebef6410eeef54e1bd3d00331996daba78aa534.tar.bz2 opensim-SC-5ebef6410eeef54e1bd3d00331996daba78aa534.tar.xz |
Implements llLoopSound(), llStopSound(), and llAdjustSoundVolume().
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 13 |
5 files changed, 39 insertions, 7 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 3d2bf4a..518659f 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -635,6 +635,7 @@ namespace OpenSim.Framework | |||
635 | void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID); | 635 | void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID); |
636 | void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags); | 636 | void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags); |
637 | void SendTriggeredSound(LLUUID soundID, LLUUID ownerID, LLUUID objectID, LLUUID parentID, ulong handle, LLVector3 position, float gain); | 637 | void SendTriggeredSound(LLUUID soundID, LLUUID ownerID, LLUUID objectID, LLUUID parentID, ulong handle, LLVector3 position, float gain); |
638 | void SendAttachedSoundGainChange(LLUUID objectID, float gain); | ||
638 | 639 | ||
639 | void SendNameReply(LLUUID profileId, string firstname, string lastname); | 640 | void SendNameReply(LLUUID profileId, string firstname, string lastname); |
640 | void SendAlertMessage(string message); | 641 | void SendAlertMessage(string message); |
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index fca78f7..3f971a8 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -1559,6 +1559,15 @@ namespace OpenSim.Region.ClientStack | |||
1559 | OutPacket(sound, ThrottleOutPacketType.Task); | 1559 | OutPacket(sound, ThrottleOutPacketType.Task); |
1560 | } | 1560 | } |
1561 | 1561 | ||
1562 | public void SendAttachedSoundGainChange(LLUUID objectID, float gain) | ||
1563 | { | ||
1564 | AttachedSoundGainChangePacket sound = (AttachedSoundGainChangePacket)PacketPool.Instance.GetPacket(PacketType.AttachedSoundGainChange); | ||
1565 | sound.DataBlock.ObjectID = objectID; | ||
1566 | sound.DataBlock.Gain = gain; | ||
1567 | |||
1568 | OutPacket(sound, ThrottleOutPacketType.Task); | ||
1569 | } | ||
1570 | |||
1562 | public void SendSunPos(LLVector3 sunPos, LLVector3 sunVel) | 1571 | public void SendSunPos(LLVector3 sunPos, LLVector3 sunVel) |
1563 | { | 1572 | { |
1564 | SimulatorViewerTimeMessagePacket viewertime = (SimulatorViewerTimeMessagePacket)PacketPool.Instance.GetPacket(PacketType.SimulatorViewerTimeMessage); | 1573 | SimulatorViewerTimeMessagePacket viewertime = (SimulatorViewerTimeMessagePacket)PacketPool.Instance.GetPacket(PacketType.SimulatorViewerTimeMessage); |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index ea20725..51a633e 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -1739,7 +1739,21 @@ namespace OpenSim.Region.Environment.Scenes | |||
1739 | } | 1739 | } |
1740 | } | 1740 | } |
1741 | 1741 | ||
1742 | public void SendSound(string sound, double volume, bool triggered) | 1742 | public void AdjustSoundGain(double volume) |
1743 | { | ||
1744 | if (volume > 1) | ||
1745 | volume = 1; | ||
1746 | if (volume < 0) | ||
1747 | volume = 0; | ||
1748 | |||
1749 | List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars(); | ||
1750 | foreach (ScenePresence p in avatarts) | ||
1751 | { | ||
1752 | p.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume); | ||
1753 | } | ||
1754 | } | ||
1755 | |||
1756 | public void SendSound(string sound, double volume, bool triggered, byte flags) | ||
1743 | { | 1757 | { |
1744 | if (volume > 1) | 1758 | if (volume > 1) |
1745 | volume = 1; | 1759 | volume = 1; |
@@ -1753,7 +1767,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1753 | LLVector3 position = AbsolutePosition; // region local | 1767 | LLVector3 position = AbsolutePosition; // region local |
1754 | ulong regionHandle = m_parentGroup.Scene.RegionInfo.RegionHandle; | 1768 | ulong regionHandle = m_parentGroup.Scene.RegionInfo.RegionHandle; |
1755 | 1769 | ||
1756 | byte flags = 0; | 1770 | //byte flags = 0; |
1757 | 1771 | ||
1758 | if (!LLUUID.TryParse(sound, out soundID)) | 1772 | if (!LLUUID.TryParse(sound, out soundID)) |
1759 | { | 1773 | { |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index f648813..705f27e 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -411,6 +411,11 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
411 | { | 411 | { |
412 | } | 412 | } |
413 | 413 | ||
414 | public void SendAttachedSoundGainChange(LLUUID objectID, float gain) | ||
415 | { | ||
416 | |||
417 | } | ||
418 | |||
414 | public void SendAlertMessage(string message) | 419 | public void SendAlertMessage(string message) |
415 | { | 420 | { |
416 | } | 421 | } |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 56c6b59..efcec75 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -1214,13 +1214,14 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1214 | public void llPlaySound(string sound, double volume) | 1214 | public void llPlaySound(string sound, double volume) |
1215 | { | 1215 | { |
1216 | m_host.AddScriptLPS(1); | 1216 | m_host.AddScriptLPS(1); |
1217 | m_host.SendSound(sound, volume, false); | 1217 | m_host.SendSound(sound, volume, false, 0); |
1218 | } | 1218 | } |
1219 | 1219 | ||
1220 | public void llLoopSound(string sound, double volume) | 1220 | public void llLoopSound(string sound, double volume) |
1221 | { | 1221 | { |
1222 | m_host.AddScriptLPS(1); | 1222 | m_host.AddScriptLPS(1); |
1223 | NotImplemented("llLoopSound"); | 1223 | m_host.SendSound(sound, volume, false, 1); |
1224 | //NotImplemented("llLoopSound"); | ||
1224 | } | 1225 | } |
1225 | 1226 | ||
1226 | public void llLoopSoundMaster(string sound, double volume) | 1227 | public void llLoopSoundMaster(string sound, double volume) |
@@ -1244,13 +1245,14 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1244 | public void llTriggerSound(string sound, double volume) | 1245 | public void llTriggerSound(string sound, double volume) |
1245 | { | 1246 | { |
1246 | m_host.AddScriptLPS(1); | 1247 | m_host.AddScriptLPS(1); |
1247 | m_host.SendSound(sound, volume, true); | 1248 | m_host.SendSound(sound, volume, true, 0); |
1248 | } | 1249 | } |
1249 | 1250 | ||
1250 | public void llStopSound() | 1251 | public void llStopSound() |
1251 | { | 1252 | { |
1252 | m_host.AddScriptLPS(1); | 1253 | m_host.AddScriptLPS(1); |
1253 | NotImplemented("llStopSound"); | 1254 | m_host.SendSound(LLUUID.Zero.ToString(), 1.0, false, 2); |
1255 | //NotImplemented("llStopSound"); | ||
1254 | } | 1256 | } |
1255 | 1257 | ||
1256 | public void llPreloadSound(string sound) | 1258 | public void llPreloadSound(string sound) |
@@ -2609,7 +2611,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2609 | public void llAdjustSoundVolume(double volume) | 2611 | public void llAdjustSoundVolume(double volume) |
2610 | { | 2612 | { |
2611 | m_host.AddScriptLPS(1); | 2613 | m_host.AddScriptLPS(1); |
2612 | NotImplemented("llAdjustSoundVolume"); | 2614 | m_host.AdjustSoundGain(volume); |
2615 | //NotImplemented("llAdjustSoundVolume"); | ||
2613 | } | 2616 | } |
2614 | 2617 | ||
2615 | public void llSetSoundQueueing(int queue) | 2618 | public void llSetSoundQueueing(int queue) |