#include <SoundSource.hpp>
Base class for audio component
Definition at line 37 of file SoundSource.hpp.
Sound status
| Enumerator |
|---|
| Stopped |
Sound is stopped.
|
| Paused |
Sound is paused.
|
| Playing |
Sound is playing.
|
Definition at line 58 of file SoundSource.hpp.
Copy constructor.
- Parameters
-
| other | The other sound source to be copied |
| newObj | The new object for this sound source |
| jop::SoundSource::SoundSource |
( |
Object & |
object, |
|
|
const uint32 |
ID |
|
) |
| |
Constructor.
- Parameters
-
| object | Reference to the object this component will be bound to |
| ID | Component identifier |
| virtual jop::SoundSource::~SoundSource |
( |
| ) |
|
|
overridepure virtual |
| float jop::SoundSource::getAttenuation |
( |
| ) |
const |
Returns attenuation value.
- Returns
- Attenuation value
| float jop::SoundSource::getMinDistance |
( |
| ) |
const |
Returns distance of max volume.
- Returns
- Minimum distance
| float jop::SoundSource::getPitch |
( |
| ) |
const |
Get the pitch.
- Returns
- The pitch value
| Status jop::SoundSource::getStatus |
( |
| ) |
const |
Returns status of the sound (Stopped,Paused,Playing)
- Returns
- enum
| float jop::SoundSource::getVolume |
( |
| ) |
const |
Get the volume.
- Returns
- The volume
| bool jop::SoundSource::isDirection |
( |
| ) |
const |
Check if sound has direction.
- Returns
- Is direction calculated for sound
| bool jop::SoundSource::isSpatialized |
( |
| ) |
const |
Returns relativity to listener.
- Returns
- True if spatialized false if relative to listener
| static bool jop::SoundSource::isSpeedOfSound |
( |
| ) |
|
|
staticprotected |
Private check is speed of sound calculated.
- Returns
- Boolean if true speed is calculated
| jop::SoundSource::JOP_DISALLOW_COPY_MOVE |
( |
SoundSource |
| ) |
|
|
protected |
| SoundSource& jop::SoundSource::setAttenuation |
( |
const float |
at | ) |
|
Change sound's fade-out distance.
Higher values mean that the sound will fade out more quickly.
- Parameters
-
- Returns
- Reference to self
- This method is exposed as command named setAttenuation
| SoundSource& jop::SoundSource::setMinDistance |
( |
const float |
min | ) |
|
Change sound's distance when it is heard in max volume.
- Parameters
-
- Returns
- Reference to self
- This method is exposed as command named setMinDistance
| SoundSource& jop::SoundSource::setPitch |
( |
const float |
value | ) |
|
Set pitch.
Be careful with this function. Setting the pitch too high or low can lead to sound artifacts or even crashes. The safe range seems to be between 0.1 and 8.
- Parameters
-
| value | The pitch value. Default is 1 |
- Returns
- Reference to self
- This method is exposed as command named setPitch
| SoundSource& jop::SoundSource::setSpatialization |
( |
const bool |
toggle | ) |
|
Toggle listener on/off.
- Parameters
-
| toggle | True enables spatialization (default) and makes sound relative to listener |
- Returns
- Reference to self
- This method is exposed as command named setListener
| SoundSource& jop::SoundSource::setVolume |
( |
const float |
vol | ) |
|
Set sound's volume.
The value will be clamped inside the appropriate range.
- Parameters
-
| vol | Float 0-100.0f default is 100.0f |
- Returns
- Reference to self
- This method is exposed as command named setVolume
| void jop::SoundSource::update |
( |
const float |
deltaTime | ) |
|
|
overridevirtual |
| SoundSource& jop::SoundSource::useDirection |
( |
const bool |
use | ) |
|
Use object's direction for sound.
- Parameters
-
| use | true will make sound to use direction |
| bool jop::SoundSource::m_calculateDelay |
|
protected |
| float jop::SoundSource::m_delayCounter |
|
protected |
| unsigned int jop::SoundSource::m_source |
|
protected |
The documentation for this class was generated from the following file: