OmegaEngine API  1.0.3
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
OmegaEngine.Audio.Sound Class Reference

A memory-cached sound that is played on-demand. More...

Inheritance diagram for OmegaEngine.Audio.Sound:
OmegaEngine.EngineElement OmegaEngine.IAudio OmegaEngine.Audio.Sound3D

Public Member Functions

 Sound (XSound sound)
 Sets up a new Sound based on an XSound asset. More...
 
virtual void StartPlayback (bool looping)
 Starts the sound playback More...
 
virtual void StopPlayback ()
 Stops the sound playback More...
 
- Public Member Functions inherited from OmegaEngine.EngineElement
void Dispose ()
 

Public Attributes

bool Playing => !SoundBuffer.Disposed && SoundBuffer.Status == BufferStatus.Playing
 
bool Looping => !SoundBuffer.Disposed && SoundBuffer.Status == BufferStatus.Looping
 
- Public Attributes inherited from OmegaEngine.EngineElement
bool IsEngineSet => _engine != null
 true if the Engine has been set. More...
 

Protected Member Functions

override void OnEngineSet ()
 Hook that is calld when Engine is set for the first time.
 
override void OnDispose ()
 Hook that is called when the object needs to dispose its internal resources.
 
- Protected Member Functions inherited from OmegaEngine.EngineElement
void RegisterChild (EngineElement element, bool autoDispose=true)
 Registers a child EngineElement for automatic Engine setting and Dispose calling. More...
 
void UnregisterChild (EngineElement element)
 Unregisters a child EngineElement (opposite of RegisterChild). More...
 

Protected Attributes

readonly XSound Asset
 A reference to the asset providing the data for this sound. More...
 
SecondarySoundBuffer SoundBuffer
 The sound buffer containing the decoded data ready for playback. More...
 

Properties

int Volume [get, set]
 >
 
- Properties inherited from OmegaEngine.EngineElement
Engine Engine [get, set]
 The Engine instance used by this object. Must be set before using the object. May not be changed once it has been set! More...
 
bool IsDisposed [get]
 Indicates whether this object has been disposed and can therefore no longer be used. More...
 
- Properties inherited from OmegaEngine.IAudio
bool Playing [get]
 Is this sound currently being played? More...
 
bool Looping [get]
 Is this sound set to loop? More...
 
int Volume [get, set]
 The playback volume for the asset. More...
 

Detailed Description

A memory-cached sound that is played on-demand.

Constructor & Destructor Documentation

◆ Sound()

OmegaEngine.Audio.Sound.Sound ( XSound  sound)
inline

Sets up a new Sound based on an XSound asset.

Parameters
soundThe XSound asset to get the audio data from.

Member Function Documentation

◆ StartPlayback()

virtual void OmegaEngine.Audio.Sound.StartPlayback ( bool  looping)
inlinevirtual

Starts the sound playback

Implements OmegaEngine.IAudio.

Reimplemented in OmegaEngine.Audio.Sound3D.

◆ StopPlayback()

virtual void OmegaEngine.Audio.Sound.StopPlayback ( )
inlinevirtual

Stops the sound playback

Implements OmegaEngine.IAudio.

Reimplemented in OmegaEngine.Audio.Sound3D.

Member Data Documentation

◆ Asset

readonly XSound OmegaEngine.Audio.Sound.Asset
protected

A reference to the asset providing the data for this sound.

◆ SoundBuffer

SecondarySoundBuffer OmegaEngine.Audio.Sound.SoundBuffer
protected

The sound buffer containing the decoded data ready for playback.


The documentation for this class was generated from the following file: