Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Nz::SoundEmitter Class Referenceabstract

Audio class that represents a sound source, that emits sound. More...

Inheritance diagram for Nz::SoundEmitter:
Nz::Music Nz::Sound

Public Member Functions

virtual ~SoundEmitter ()
 Destructs the object.
 
virtual void EnableLooping (bool loop)=0
 
void EnableSpatialization (bool spatialization)
 Enables spatialization. More...
 
float GetAttenuation () const
 Gets the attenuation. More...
 
virtual UInt32 GetDuration () const =0
 
float GetMinDistance () const
 Gets the minimum distance to hear. More...
 
float GetPitch () const
 Gets the pitch. More...
 
virtual UInt32 GetPlayingOffset () const =0
 
Vector3f GetPosition () const
 Gets the position of the emitter. More...
 
Vector3f GetVelocity () const
 Gets the velocity of the emitter. More...
 
virtual SoundStatus GetStatus () const =0
 
float GetVolume () const
 Gets the volume of the emitter. More...
 
virtual bool IsLooping () const =0
 
bool IsSpatialized () const
 Checks whether the sound emitter has spatialization enabled. More...
 
virtual void Pause ()=0
 
virtual void Play ()=0
 
void SetAttenuation (float attenuation)
 Sets the attenuation. More...
 
void SetMinDistance (float minDistance)
 Sets the minimum distance to hear. More...
 
void SetPitch (float pitch)
 Sets the pitch. More...
 
void SetPosition (const Vector3f &position)
 Sets the position of the emitter. More...
 
void SetPosition (float x, float y, float z)
 Sets the position of the emitter. More...
 
void SetVelocity (const Vector3f &velocity)
 Sets the velocity of the emitter. More...
 
void SetVelocity (float velX, float velY, float velZ)
 Sets the velocity of the emitter. More...
 
void SetVolume (float volume)
 Sets the volume of the emitter. More...
 
virtual void Stop ()=0
 
SoundEmitteroperator= (const SoundEmitter &)=delete
 
SoundEmitteroperator= (SoundEmitter &&)=delete
 TODO.
 

Protected Member Functions

 SoundEmitter ()
 Constructs a SoundEmitter object.
 
 SoundEmitter (const SoundEmitter &emitter)
 Constructs a SoundEmitter object which is a copy of another. More...
 
 SoundEmitter (SoundEmitter &&)=delete
 
SoundStatus GetInternalStatus () const
 Gets the status of the sound emitter. More...
 

Protected Attributes

unsigned int m_source
 

Detailed Description

Audio class that represents a sound source, that emits sound.

Remarks
Module Audio needs to be initialized to use this class
This class is abstract

Constructor & Destructor Documentation

◆ SoundEmitter()

Nz::SoundEmitter::SoundEmitter ( const SoundEmitter emitter)
protected

Constructs a SoundEmitter object which is a copy of another.

Parameters
emitterSoundEmitter to copy
Remarks
Position and velocity are not copied

Member Function Documentation

◆ EnableSpatialization()

void Nz::SoundEmitter::EnableSpatialization ( bool  spatialization)

Enables spatialization.

Parameters
spatializationTrue if spatialization is enabled

◆ GetAttenuation()

float Nz::SoundEmitter::GetAttenuation ( ) const

Gets the attenuation.

Returns
Amount that your sound will drop off as by the inverse square law

◆ GetInternalStatus()

SoundStatus Nz::SoundEmitter::GetInternalStatus ( ) const
protected

Gets the status of the sound emitter.

Returns
Enumeration of type SoundStatus (Playing, Stopped, ...)

◆ GetMinDistance()

float Nz::SoundEmitter::GetMinDistance ( ) const

Gets the minimum distance to hear.

Returns
Distance to begin to hear

◆ GetPitch()

float Nz::SoundEmitter::GetPitch ( ) const

Gets the pitch.

Returns
Pitch of the sound

◆ GetPosition()

Vector3f Nz::SoundEmitter::GetPosition ( ) const

Gets the position of the emitter.

Returns
Position of the sound

◆ GetVelocity()

Vector3f Nz::SoundEmitter::GetVelocity ( ) const

Gets the velocity of the emitter.

Returns
Velocity of the sound

◆ GetVolume()

float Nz::SoundEmitter::GetVolume ( ) const

Gets the volume of the emitter.

Parameters
volumeFloat between [0, inf) with 100.f being the default

◆ IsSpatialized()

bool Nz::SoundEmitter::IsSpatialized ( ) const

Checks whether the sound emitter has spatialization enabled.

Returns
true if it the case

◆ SetAttenuation()

void Nz::SoundEmitter::SetAttenuation ( float  attenuation)

Sets the attenuation.

Parameters
attenuationAmount that your sound will drop off as by the inverse square law

◆ SetMinDistance()

void Nz::SoundEmitter::SetMinDistance ( float  minDistance)

Sets the minimum distance to hear.

Parameters
minDistanceto begin to hear

◆ SetPitch()

void Nz::SoundEmitter::SetPitch ( float  pitch)

Sets the pitch.

Parameters
pitchof the sound

◆ SetPosition() [1/2]

void Nz::SoundEmitter::SetPosition ( const Vector3f position)

Sets the position of the emitter.

Parameters
positionPosition of the sound

◆ SetPosition() [2/2]

void Nz::SoundEmitter::SetPosition ( float  x,
float  y,
float  z 
)

Sets the position of the emitter.

Parameters
positionPosition of the sound with (x, y, z)

◆ SetVelocity() [1/2]

void Nz::SoundEmitter::SetVelocity ( const Vector3f velocity)

Sets the velocity of the emitter.

Parameters
velocityVelocity of the sound

◆ SetVelocity() [2/2]

void Nz::SoundEmitter::SetVelocity ( float  velX,
float  velY,
float  velZ 
)

Sets the velocity of the emitter.

Parameters
velocityVelocity with (velX, velY, velZ)

◆ SetVolume()

void Nz::SoundEmitter::SetVolume ( float  volume)

Sets the volume of the emitter.

Parameters
volumeFloat between [0, inf) with 100.f being the default

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