Drag[en]gine Game Engine  1.21
deSound Class Reference

Sound resource. More...

#include <deSound.h>

Inheritance diagram for deSound:
deFileResource deResource deObject

Public Types

typedef deTObjectReference< deSoundRef
 Type holding strong reference. More...
 
- Public Types inherited from deResource
typedef deTObjectReference< deResourceRef
 Type holding strong reference. More...
 
- Public Types inherited from deObject
typedef deTObjectReference< deObjectRef
 Type holding strong reference. More...
 

Public Member Functions

Management
int GetBytesPerSample () const
 Bytes per sample. More...
 
int GetSampleCount () const
 Number of samples. More...
 
int GetChannelCount () const
 Number of channels. More...
 
int GetSampleRate () const
 Sample rate. More...
 
float GetPlayTime () const
 Play time in seconds. More...
 
System Peers
deBaseAudioSoundGetPeerAudio () const
 Audio system peer object. More...
 
void SetPeerAudio (deBaseAudioSound *peer)
 Set audio system peer object. More...
 
deBaseSynthesizerSoundGetPeerSynthesizer () const
 Synthesizer system peer object. More...
 
void SetPeerSynthesizer (deBaseSynthesizerSound *peer)
 Set synthesizer system peer object. More...
 
Special
void FinalizeConstruction (int bytesPerSample, int sampleRate, int sampleCount, int channelCount)
 Finalize construction after asynchronous loading. 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...
 
TIME_SYSTEM GetModificationTime () const
 Modification time used to detect resources changing on disk while loaded. More...
 
void SetModificationTime (TIME_SYSTEM modificationTime)
 Set modification time used to detect resources changing on disk while loaded. More...
 
bool GetAsynchron () const
 Resource is asynchron. More...
 
void SetAsynchron (bool asynchron)
 Set if resource is asynchron. More...
 
bool GetOutdated () const
 
void MarkOutdated ()
 
 deFileResource (deFileResourceManager *resourceManager, deVirtualFileSystem *vfs, const char *filename, TIME_SYSTEM modificationTime)
 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, TIME_SYSTEM modificationTime, int bytesPerSample, int sampleRate, int sampleCount, int channelCount)
 Create sound. More...
 
 deSound (deSoundManager *manager, deVirtualFileSystem *vfs, const char *filename, TIME_SYSTEM modificationTime)
 Create sound for internal loading. More...
 
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 resource.

Sounds represent sampled data to play back with speakers or used with synthesizers. Sound resources can be used for short sound effect or long music files. To obtain the samples modules use sound decoders. It is at the discretion of the involved modules if they deem the sound file short enough to cache in memory or if they use the samples in a streaming way.

Member Typedef Documentation

◆ Ref

Type holding strong reference.

Constructor & Destructor Documentation

◆ deSound() [1/2]

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

Create sound.

◆ deSound() [2/2]

deSound::deSound ( deSoundManager manager,
deVirtualFileSystem vfs,
const char *  filename,
TIME_SYSTEM  modificationTime 
)

Create sound for internal loading.

Warning
This is a special internal constructor. Never ever call this on your own!

◆ ~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

◆ FinalizeConstruction()

void deSound::FinalizeConstruction ( int  bytesPerSample,
int  sampleRate,
int  sampleCount,
int  channelCount 
)

Finalize construction after asynchronous loading.

Warning
This is a special internal function. Never ever call this on your own!

◆ GetBytesPerSample()

int deSound::GetBytesPerSample ( ) const
inline

Bytes per sample.

◆ GetChannelCount()

int deSound::GetChannelCount ( ) const
inline

Number of channels.

◆ GetPeerAudio()

deBaseAudioSound* deSound::GetPeerAudio ( ) const
inline

Audio system peer object.

◆ GetPeerSynthesizer()

deBaseSynthesizerSound* deSound::GetPeerSynthesizer ( ) const
inline

Synthesizer system peer object.

◆ GetPlayTime()

float deSound::GetPlayTime ( ) const
inline

Play time in seconds.

◆ GetSampleCount()

int deSound::GetSampleCount ( ) const
inline

Number of samples.

◆ GetSampleRate()

int deSound::GetSampleRate ( ) const
inline

Sample rate.

◆ SetPeerAudio()

void deSound::SetPeerAudio ( deBaseAudioSound peer)

Set audio system peer object.

◆ SetPeerSynthesizer()

void deSound::SetPeerSynthesizer ( deBaseSynthesizerSound peer)

Set synthesizer system peer object.


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