diff options
author | Adam Frisby | 2009-05-29 22:44:49 +0000 |
---|---|---|
committer | Adam Frisby | 2009-05-29 22:44:49 +0000 |
commit | 78bec422259671ad72ad46ca98ab8029b78aefe5 (patch) | |
tree | 40e6b2dcc2495cc8409a52027acc39faefb89f49 /OpenSim | |
parent | * Allows standalone region users to skip the "You must wait 5 minutes to log ... (diff) | |
download | opensim-SC_OLD-78bec422259671ad72ad46ca98ab8029b78aefe5.zip opensim-SC_OLD-78bec422259671ad72ad46ca98ab8029b78aefe5.tar.gz opensim-SC_OLD-78bec422259671ad72ad46ca98ab8029b78aefe5.tar.bz2 opensim-SC_OLD-78bec422259671ad72ad46ca98ab8029b78aefe5.tar.xz |
* Implements Sound on Objects for IObject in MRM
* Method: IObject.Sound.Play(UUID sound, double volume)
* More feature-packed API to come soon. (I want a World.Sound with arbitrary positioning)
Diffstat (limited to 'OpenSim')
3 files changed, 29 insertions, 1 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs index ef1e896..dd9cc29 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs | |||
@@ -170,6 +170,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
170 | 170 | ||
171 | IObjectPhysics Physics { get; } | 171 | IObjectPhysics Physics { get; } |
172 | 172 | ||
173 | IObjectSound Sound { get; } | ||
173 | 174 | ||
174 | /// <summary> | 175 | /// <summary> |
175 | /// Causes the object to speak to its surroundings, | 176 | /// Causes the object to speak to its surroundings, |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectSound.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectSound.cs new file mode 100644 index 0000000..7204f02 --- /dev/null +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectSound.cs | |||
@@ -0,0 +1,12 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenMetaverse; | ||
5 | |||
6 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object | ||
7 | { | ||
8 | interface IObjectSound | ||
9 | { | ||
10 | void Play(UUID soundAsset, double volume); | ||
11 | } | ||
12 | } | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index f29522f..c1c255b 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs | |||
@@ -38,7 +38,7 @@ using SculptType=OpenSim.Region.OptionalModules.Scripting.Minimodule.Object.Scul | |||
38 | 38 | ||
39 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | 39 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule |
40 | { | 40 | { |
41 | class SOPObject : MarshalByRefObject, IObject, IObjectPhysics, IObjectShape | 41 | class SOPObject : MarshalByRefObject, IObject, IObjectPhysics, IObjectShape, IObjectSound |
42 | { | 42 | { |
43 | private readonly Scene m_rootScene; | 43 | private readonly Scene m_rootScene; |
44 | private readonly uint m_localID; | 44 | private readonly uint m_localID; |
@@ -638,5 +638,20 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
638 | 638 | ||
639 | 639 | ||
640 | #endregion | 640 | #endregion |
641 | |||
642 | |||
643 | #region Implementation of IObjectSound | ||
644 | |||
645 | public IObjectSound Sound | ||
646 | { | ||
647 | get { return this; } | ||
648 | } | ||
649 | |||
650 | public void Play(UUID asset, double volume) | ||
651 | { | ||
652 | GetSOP().SendSound(asset.ToString(), volume, true, 0); | ||
653 | } | ||
654 | |||
655 | #endregion | ||
641 | } | 656 | } |
642 | } | 657 | } |