PixelLightAPI
.
|
Abstract sound source resource. More...
#include <Source.h>
Public Types | |
enum | EFlags { NoMasterPitch = 1<<0 } |
Sound source flags. More... | |
enum | EAttributes { Position = 0, Velocity = 1, NumOfAttributes = 2 } |
Source attributes. More... | |
Public Member Functions | |
virtual PLSOUND_API | ~Source () |
Destructor. | |
PLSOUND_API Buffer * | GetBuffer () const |
Returns the buffer the source is using. | |
PLSOUND_API PLCore::uint32 | GetFlags () const |
Returns the source flags. | |
PLSOUND_API void | SetFlags (PLCore::uint32 nFlags=0) |
Sets the source flags. | |
virtual PLSOUND_API bool | Load (Buffer *pBuffer=nullptr) |
Loads the sound source with the given sound buffer. | |
virtual PLSOUND_API void | Unload () |
Unload the source. | |
virtual bool | Play (bool bRestart=false)=0 |
Plays the source. | |
virtual bool | IsPlaying () const =0 |
Checks whether the source is currently playing or not. | |
virtual void | Pause ()=0 |
Pauses the source playback. | |
virtual bool | IsPaused () const =0 |
Checks whether the source is currently paused or not. | |
virtual void | Stop ()=0 |
Stops the source playback. | |
virtual float | GetVolume () const =0 |
Returns the volume. | |
virtual void | SetVolume (float fVolume=1.0f)=0 |
Sets the volume. | |
virtual bool | Is2D () const =0 |
Returns whether the source is 2D or not. | |
virtual void | Set2D (bool b2D=false)=0 |
Sets whether the source is 2D or not. | |
virtual bool | IsLooping () const =0 |
Returns whether the source is looping or not. | |
virtual void | SetLooping (bool bLooping=false)=0 |
Sets whether the source is looping or not. | |
virtual float | GetPitch () const =0 |
Returns the pitch multiplier. | |
virtual void | SetPitch (float fPitch=1.0f)=0 |
Sets the pitch multiplier. | |
virtual float | GetReferenceDistance () const =0 |
Returns the reference distance. | |
virtual void | SetReferenceDistance (float fReferenceDistance=1.0f)=0 |
Sets the reference distance. | |
virtual float | GetMaxDistance () const =0 |
Returns the maximum distance. | |
virtual void | SetMaxDistance (float fMaxDistance=10000.0f)=0 |
Sets the maximum distance. | |
virtual float | GetRolloffFactor () const =0 |
Returns the roll off factor. | |
virtual void | SetRolloffFactor (float fRolloffFactor=1.0f)=0 |
Sets the roll off factor. | |
virtual PLMath::Vector3 | GetAttribute (EAttributes nAttribute) const =0 |
Gets a source attribute value. | |
virtual bool | SetAttribute (EAttributes nAttribute, const PLMath::Vector3 &vV)=0 |
Sets a source attribute value. | |
Protected Member Functions | |
PLSOUND_API | Source (SoundManager &cSoundManager) |
Constructor. |
Abstract sound source resource.
Source attributes.
virtual PLSOUND_API PLSound::Source::~Source | ( | ) | [virtual] |
Destructor.
PLSOUND_API PLSound::Source::Source | ( | SoundManager & | cSoundManager | ) | [protected] |
Constructor.
[in] | cSoundManager | Owner sound manager |
PLSOUND_API Buffer* PLSound::Source::GetBuffer | ( | ) | const |
Returns the buffer the source is using.
PLSOUND_API PLCore::uint32 PLSound::Source::GetFlags | ( | ) | const |
Returns the source flags.
PLSOUND_API void PLSound::Source::SetFlags | ( | PLCore::uint32 | nFlags = 0 | ) |
Sets the source flags.
[in] | nFlags | Source flags (see EFlags) |
virtual PLSOUND_API bool PLSound::Source::Load | ( | Buffer * | pBuffer = nullptr | ) | [virtual] |
Loads the sound source with the given sound buffer.
[in] | pBuffer | Sound buffer the source should load, can be a null pointer (in this case just the same as Unload()) |
virtual PLSOUND_API void PLSound::Source::Unload | ( | ) | [virtual] |
Unload the source.
virtual bool PLSound::Source::Play | ( | bool | bRestart = false | ) | [pure virtual] |
Plays the source.
[in] | bRestart | Restart source if it is already playing? |
virtual bool PLSound::Source::IsPlaying | ( | ) | const [pure virtual] |
Checks whether the source is currently playing or not.
virtual void PLSound::Source::Pause | ( | ) | [pure virtual] |
Pauses the source playback.
virtual bool PLSound::Source::IsPaused | ( | ) | const [pure virtual] |
Checks whether the source is currently paused or not.
virtual void PLSound::Source::Stop | ( | ) | [pure virtual] |
Stops the source playback.
virtual float PLSound::Source::GetVolume | ( | ) | const [pure virtual] |
Returns the volume.
virtual void PLSound::Source::SetVolume | ( | float | fVolume = 1.0f | ) | [pure virtual] |
Sets the volume.
[in] | fVolume | Volume (value from 0.0-1.0 -> 0.0 = silence, 1.0 = full volume) |
virtual bool PLSound::Source::Is2D | ( | ) | const [pure virtual] |
Returns whether the source is 2D or not.
virtual void PLSound::Source::Set2D | ( | bool | b2D = false | ) | [pure virtual] |
Sets whether the source is 2D or not.
[in] | b2D | If 'true' the source is 2D, else 'false' |
virtual bool PLSound::Source::IsLooping | ( | ) | const [pure virtual] |
Returns whether the source is looping or not.
virtual void PLSound::Source::SetLooping | ( | bool | bLooping = false | ) | [pure virtual] |
Sets whether the source is looping or not.
[in] | bLooping | If 'true' the source is looping, else 'false' |
virtual float PLSound::Source::GetPitch | ( | ) | const [pure virtual] |
Returns the pitch multiplier.
virtual void PLSound::Source::SetPitch | ( | float | fPitch = 1.0f | ) | [pure virtual] |
virtual float PLSound::Source::GetReferenceDistance | ( | ) | const [pure virtual] |
Returns the reference distance.
virtual void PLSound::Source::SetReferenceDistance | ( | float | fReferenceDistance = 1.0f | ) | [pure virtual] |
Sets the reference distance.
[in] | fReferenceDistance | Reference distance |
virtual float PLSound::Source::GetMaxDistance | ( | ) | const [pure virtual] |
Returns the maximum distance.
virtual void PLSound::Source::SetMaxDistance | ( | float | fMaxDistance = 10000.0f | ) | [pure virtual] |
virtual float PLSound::Source::GetRolloffFactor | ( | ) | const [pure virtual] |
Returns the roll off factor.
virtual void PLSound::Source::SetRolloffFactor | ( | float | fRolloffFactor = 1.0f | ) | [pure virtual] |
Sets the roll off factor.
[in] | fRolloffFactor | Roll off factor |
virtual PLMath::Vector3 PLSound::Source::GetAttribute | ( | EAttributes | nAttribute | ) | const [pure virtual] |
Gets a source attribute value.
[in] | nAttribute | Source attribute to return |
virtual bool PLSound::Source::SetAttribute | ( | EAttributes | nAttribute, |
const PLMath::Vector3 & | vV | ||
) | [pure virtual] |
Sets a source attribute value.
[in] | nAttribute | Source attribute to set |
[in] | vV | New source attribute value |
|