PixelLightAPI
.
|
Abstract sound manager main class. More...
#include <SoundManager.h>
Classes | |
class | Format |
Sound format. More... | |
Public Types | |
enum | EListener { ListenerPosition = 0, ListenerVelocity = 1, ListenerForward = 2, ListenerUpward = 3, ListenerNumber = 4 } |
Listener attributes. More... | |
Public Member Functions | |
pl_class (PLSOUND_RTTI_EXPORT, SoundManager,"PLSound", PLCore::Object,"Abstract sound manager main class") pl_class_endpublic | |
Sound statistics. | |
virtual PLSOUND_API | ~SoundManager () |
Destructor. | |
PLSOUND_API const Statistics & | GetStatistics () const |
Returns the sound statistics. | |
PLSOUND_API PLCore::uint32 | GetNumOfResources () const |
Returns the number of resources. | |
PLSOUND_API Resource * | GetResource (PLCore::uint32 nIndex=0) const |
Returns a sound resource. | |
PLSOUND_API bool | AddResource (Resource &cResource) |
Adds a sound resource to the sound manager. | |
PLSOUND_API bool | RemoveResource (Resource &cResource) |
Removes a sound resource from the sound manager. | |
virtual PLCore::String | GetDescription () const =0 |
Returns the sound manager description. | |
virtual bool | GetFormatList (PLCore::List< Format > &lstList) const =0 |
Gets a list of all known sound formats. | |
virtual float | GetVolume () const =0 |
Gets the master volume. | |
virtual void | SetVolume (float fVolume=1.0f)=0 |
Sets the master volume. | |
virtual float | GetPitch () const =0 |
Returns the master pitch multiplier. | |
virtual void | SetPitch (float fPitch=1.0f)=0 |
Sets the master pitch multiplier. | |
virtual float | GetDopplerFactor () const =0 |
Gets the doppler factor. | |
virtual void | SetDopplerFactor (float fFactor=1.0f)=0 |
Sets the doppler factor. | |
virtual Buffer * | CreateSoundBuffer (const PLCore::String &sFilename="", bool bStream=false)=0 |
Creates a sound buffer. | |
virtual Source * | CreateSoundSource (Buffer *pSoundBuffer=nullptr)=0 |
Creates a sound source. | |
virtual PLMath::Vector3 | GetListenerAttribute (EListener nAttribute) const =0 |
Gets a listener attribute value. | |
virtual bool | SetListenerAttribute (EListener nAttribute, const PLMath::Vector3 &vV)=0 |
Sets a listener attribute value. | |
Protected Member Functions | |
PLSOUND_API | SoundManager () |
Constructor. | |
Protected Attributes | |
Statistics | m_sStatistics |
PLCore::Array< Resource * > | m_lstResources |
Abstract sound manager main class.
Listener attributes.
virtual PLSOUND_API PLSound::SoundManager::~SoundManager | ( | ) | [virtual] |
Destructor.
PLSOUND_API PLSound::SoundManager::SoundManager | ( | ) | [protected] |
Constructor.
PLSound::SoundManager::pl_class | ( | PLSOUND_RTTI_EXPORT | , |
SoundManager | , | ||
"PLSound" | , | ||
PLCore::Object | , | ||
"Abstract sound manager main class" | |||
) | [inline] |
Sound statistics.
< Number of sound buffers
< Number of sound sources
< Number of currently active sound sources
PLSOUND_API const Statistics& PLSound::SoundManager::GetStatistics | ( | ) | const |
Returns the sound statistics.
PLSOUND_API PLCore::uint32 PLSound::SoundManager::GetNumOfResources | ( | ) | const |
Returns the number of resources.
PLSOUND_API Resource* PLSound::SoundManager::GetResource | ( | PLCore::uint32 | nIndex = 0 | ) | const |
Returns a sound resource.
[in] | nIndex | Index of the resource to return |
PLSOUND_API bool PLSound::SoundManager::AddResource | ( | Resource & | cResource | ) |
Adds a sound resource to the sound manager.
[in] | cResource | Sound resource to add |
PLSOUND_API bool PLSound::SoundManager::RemoveResource | ( | Resource & | cResource | ) |
Removes a sound resource from the sound manager.
[in] | cResource | Sound resource to remove |
virtual PLCore::String PLSound::SoundManager::GetDescription | ( | ) | const [pure virtual] |
Returns the sound manager description.
virtual bool PLSound::SoundManager::GetFormatList | ( | PLCore::List< Format > & | lstList | ) | const [pure virtual] |
Gets a list of all known sound formats.
[out] | lstList | List to receive the known sound formats (see Format) |
virtual float PLSound::SoundManager::GetVolume | ( | ) | const [pure virtual] |
Gets the master volume.
virtual void PLSound::SoundManager::SetVolume | ( | float | fVolume = 1.0f | ) | [pure virtual] |
Sets the master volume.
[in] | fVolume | Volume (value from 0.0-1.0 -> 0.0 = silence, 1.0 = full volume) |
virtual float PLSound::SoundManager::GetPitch | ( | ) | const [pure virtual] |
Returns the master pitch multiplier.
virtual void PLSound::SoundManager::SetPitch | ( | float | fPitch = 1.0f | ) | [pure virtual] |
virtual float PLSound::SoundManager::GetDopplerFactor | ( | ) | const [pure virtual] |
Gets the doppler factor.
virtual void PLSound::SoundManager::SetDopplerFactor | ( | float | fFactor = 1.0f | ) | [pure virtual] |
virtual Buffer* PLSound::SoundManager::CreateSoundBuffer | ( | const PLCore::String & | sFilename = "" , |
bool | bStream = false |
||
) | [pure virtual] |
Creates a sound buffer.
[in] | sFilename | Sound filename, if empty, only create the sound buffer without loading it (full path, supported file formats are API dependent) |
[in] | bStream | Stream the file? (recommended for large files!) |
virtual Source* PLSound::SoundManager::CreateSoundSource | ( | Buffer * | pSoundBuffer = nullptr | ) | [pure virtual] |
Creates a sound source.
[in] | pSoundBuffer | Sound buffer to load, a null pointer if load no sound buffer by default |
virtual PLMath::Vector3 PLSound::SoundManager::GetListenerAttribute | ( | EListener | nAttribute | ) | const [pure virtual] |
Gets a listener attribute value.
[in] | nAttribute | Listener attribute to return |
virtual bool PLSound::SoundManager::SetListenerAttribute | ( | EListener | nAttribute, |
const PLMath::Vector3 & | vV | ||
) | [pure virtual] |
Sets a listener attribute value.
[in] | nAttribute | Listener attribute to set |
[in] | vV | New listener attribute value |
Statistics PLSound::SoundManager::m_sStatistics [protected] |
Sound statistics
PLCore::Array<Resource*> PLSound::SoundManager::m_lstResources [protected] |
Sound resources of this sound manager
Reimplemented from PLCore::ResourceManager< Buffer >.
|