Drag[en]gine Game Engine  1.0
deSound Class Reference

Sound class. More...

#include <deSound.h>

Inheritance diagram for deSound:
deFileResource deResource deObject

Public Member Functions

Management
int GetBytesPerSample () const
 
int GetSampleCount () const
 
int GetChannelCount () const
 
char * GetSamples () const
 
int GetSampleRate () const
 
float GetPlayTime () const
 
bool GetStreaming () const
 
System Peers
deBaseAudioSoundGetAudioSound () const
 
void SetAudioSound (deBaseAudioSound *audSound)
 
deBaseSynthesizerSoundGetPeerSynthesizer () const
 Synthesizer system peer object. More...
 
void SetPeerSynthesizer (deBaseSynthesizerSound *peer)
 Set synthesizer system peer object. More...
 
- Public Member Functions inherited from deFileResource
deVirtualFileSystemGetVirtualFileSystem () const
 Virtual file system or NULL if build from memory. More...
 
const decStringGetFilename () const
 Filename or empty string if build from memory. More...
 
bool GetAsynchron () const
 Resource is asynchron. More...
 
void SetAsynchron (bool asynchron)
 Set if resource is asynchron. More...
 
 deFileResource (deResourceManager *resourceManager, deVirtualFileSystem *vfs, const char *filename)
 Create file resource. More...
 
- Public Member Functions inherited from deResource
deResourceManagerGetResourceManager () const
 Resource manager or NULL if resource is leaking. More...
 
deEngineGetEngine () const
 Game engine object from resource manager. More...
 
deResourceGetLLManagerPrev () const
 Previous resource in the resource manager linked list. More...
 
void SetLLManagerPrev (deResource *resource)
 Set next resource in the resource manager linked list. More...
 
deResourceGetLLManagerNext () const
 Next resource in the resource manager linked list. More...
 
void SetLLManagerNext (deResource *resource)
 Set next resource in the resource manager linked list. More...
 
void MarkLeaking ()
 Marks the resource leaking. More...
 
 deResource (deResourceManager *resourceManager)
 Create resource. More...
 
- Public Member Functions inherited from deObject
int GetRefCount () const
 Reference count. More...
 
void AddReference ()
 Add reference increasing reference count by 1. More...
 
void FreeReference ()
 Decrease reference count by one and delete object if count reaches 0. More...
 
 deObject ()
 Create object with reference count of 1. More...
 

Constructors and Destructors

 deSound (deSoundManager *manager, deVirtualFileSystem *vfs, const char *filename, int bytesPerSample, int sampleRate, int sampleCount, int channelCount, bool streaming)
 
virtual ~deSound ()
 Clean up sound object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from deFileResource
virtual ~deFileResource ()
 Clean up file resource. More...
 
- Protected Member Functions inherited from deResource
virtual ~deResource ()
 Clean up resource. More...
 
- Protected Member Functions inherited from deObject
virtual ~deObject ()
 Clean up object. More...
 

Detailed Description

Sound class.

Stores a sound. Sounds are PCM samples used to play short sound effects once or in a loop. Sounds can be placed in scenes with spatial location or in a world or microphone to play directly. Sounds contain also various parameters determining how the sound is played back. The sample data is interleaved if more than one channel is used. The sample count indicates the total number of samples not grouping by channels.

Sounds can be of streaming or non-streaming type. For non-streaming sounds the pcm data is loaded into a memory buffer shared among all speakers using this sound. This is the best choice for small sound files which do not require a lot of memory or are played by many speakers. For streaming sounds there no memory buffer is held. Speakers using this sound use a Sound Decoder object to retrieve the sound data. This is the best choice for large sound files or sound files which are played scarcly and not use in many different speakers at the same time.

Author
Pl├╝ss Roland
Version
1.0
Date
2008

Constructor & Destructor Documentation

◆ deSound()

deSound::deSound ( deSoundManager manager,
deVirtualFileSystem vfs,
const char *  filename,
int  bytesPerSample,
int  sampleRate,
int  sampleCount,
int  channelCount,
bool  streaming 
)

Creates a new sound object.

◆ ~deSound()

virtual deSound::~deSound ( )
protectedvirtual

Clean up sound object.

Note
Subclasses should set their destructor protected too to avoid users accidently deleting a reference counted object through the object pointer. Only FreeReference() is allowed to delete the object.

Member Function Documentation

◆ GetAudioSound()

deBaseAudioSound* deSound::GetAudioSound ( ) const
inline

Retrieves the audio system peer object.

References SetAudioSound().

◆ GetBytesPerSample()

int deSound::GetBytesPerSample ( ) const
inline

Retrieves the bytes per sample.

◆ GetChannelCount()

int deSound::GetChannelCount ( ) const
inline

Retrieves the number of channels.

◆ GetPeerSynthesizer()

deBaseSynthesizerSound* deSound::GetPeerSynthesizer ( ) const
inline

Synthesizer system peer object.

References SetPeerSynthesizer().

◆ GetPlayTime()

float deSound::GetPlayTime ( ) const
inline

Retrieves the play time in seconds.

◆ GetSampleCount()

int deSound::GetSampleCount ( ) const
inline

Retrieves the number of samples.

◆ GetSampleRate()

int deSound::GetSampleRate ( ) const
inline

Retrieves the sample rate.

◆ GetSamples()

char* deSound::GetSamples ( ) const
inline

Retrieves the samples data if non-streaming or NULL if streaming.

◆ GetStreaming()

bool deSound::GetStreaming ( ) const
inline

Determines if the sound source is a streaming sound.

◆ SetAudioSound()

void deSound::SetAudioSound ( deBaseAudioSound audSound)

Sets the audio system peer object.

Referenced by GetAudioSound().

◆ SetPeerSynthesizer()

void deSound::SetPeerSynthesizer ( deBaseSynthesizerSound peer)

Set synthesizer system peer object.

Referenced by GetPeerSynthesizer().


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