OmegaEngine API  1.0.3
Static Public Member Functions | Protected Member Functions | List of all members
OmegaEngine.Assets.XOggSound Class Reference

A sound loaded from an OGG Vorbis file. More...

Inheritance diagram for OmegaEngine.Assets.XOggSound:
OmegaEngine.Assets.XSound OmegaEngine.Assets.Asset OmegaEngine.Assets.IReferenceCount NanoByte.Common.INamed< Asset >

Static Public Member Functions

static new XOggSound Get (Engine engine, string id)
 Returns a cached XOggSound or creates a new one if the requested ID is not cached. More...
 
- Static Public Member Functions inherited from OmegaEngine.Assets.XSound
static XSound Get (Engine engine, string id)
 Returns a cached XWaveSound or XOggSound (based on the file ending) or creates a new one if the requested ID is not cached. More...
 

Protected Member Functions

 XOggSound (Stream stream)
 Loads a sound from an OGG file. More...
 
- Protected Member Functions inherited from OmegaEngine.Assets.XSound
override void Dispose (bool disposing)
 To be called by IDisposable.Dispose and the object destructor. More...
 

Additional Inherited Members

- Public Member Functions inherited from OmegaEngine.Assets.Asset
override string ToString ()
 
virtual void HoldReference ()
 Increments the ReferenceCount by one. More...
 
virtual void ReleaseReference ()
 Decrements the ReferenceCount by one. More...
 
void Dispose ()
 Disposes the internal DirectX resources of this asset. More...
 
- Properties inherited from OmegaEngine.Assets.XSound
Stream SoundData [get, protected set]
 
WaveFormat SoundFormat [get, protected set]
 
- Properties inherited from OmegaEngine.Assets.Asset
string Name [get, set]
 The filename More...
 
int ReferenceCount [get]
 How many Renderables use this asset More...
 
bool Disposed [get]
 Was this asset already disposed? More...
 
- Properties inherited from NanoByte.Common.INamed< Asset >
string Name
 

Detailed Description

A sound loaded from an OGG Vorbis file.

Constructor & Destructor Documentation

◆ XOggSound()

OmegaEngine.Assets.XOggSound.XOggSound ( Stream  stream)
inlineprotected

Loads a sound from an OGG file.

Parameters
streamThe OGG file to load the sound from.
Exceptions
InvalidDataExceptionstream does not contain a valid Ogg Vorbis sound file.

This should only be called by Get to prevent unnecessary duplicates.

Member Function Documentation

◆ Get()

static new XOggSound OmegaEngine.Assets.XOggSound.Get ( Engine  engine,
string  id 
)
inlinestatic

Returns a cached XOggSound or creates a new one if the requested ID is not cached.

Parameters
engineThe Engine providing the cache.
idThe ID of the asset to be returned.
Returns
The requested asset; null if id was empty.
Exceptions
FileNotFoundExceptionThe specified file could not be found.
IOExceptionThere was an error reading the file.
UnauthorizedAccessExceptionRead access to the file is not permitted.
InvalidDataExceptionThe file does not contain valid Ogg Vorbis sound data.

Remember to call CacheManager.Clean when done, otherwise this object will never be released.


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