* 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)
0.6.6-post-fixes
Adam Frisby 2009-05-29 22:44:49 +00:00
parent d0084f08f2
commit 78bec42225
3 changed files with 29 additions and 1 deletions

View File

@ -170,6 +170,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
IObjectPhysics Physics { get; } IObjectPhysics Physics { get; }
IObjectSound Sound { get; }
/// <summary> /// <summary>
/// Causes the object to speak to its surroundings, /// Causes the object to speak to its surroundings,

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenMetaverse;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object
{
interface IObjectSound
{
void Play(UUID soundAsset, double volume);
}
}

View File

@ -38,7 +38,7 @@ using SculptType=OpenSim.Region.OptionalModules.Scripting.Minimodule.Object.Scul
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
class SOPObject : MarshalByRefObject, IObject, IObjectPhysics, IObjectShape class SOPObject : MarshalByRefObject, IObject, IObjectPhysics, IObjectShape, IObjectSound
{ {
private readonly Scene m_rootScene; private readonly Scene m_rootScene;
private readonly uint m_localID; private readonly uint m_localID;
@ -637,6 +637,21 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
} }
#endregion
#region Implementation of IObjectSound
public IObjectSound Sound
{
get { return this; }
}
public void Play(UUID asset, double volume)
{
GetSOP().SendSound(asset.ToString(), volume, true, 0);
}
#endregion #endregion
} }
} }