#include <ISound.hpp>
|
| virtual | ~ISound ()=default |
| virtual bool | isReady () const =0 |
| virtual void | play ()=0 |
| | Fires the sound from the beginning.
|
| virtual void | pause ()=0 |
| | Suspends the sound without touching the position.
|
| virtual void | stop ()=0 |
| | Stops the sound AND rewinds to zero.
|
| virtual void | setVolume (float volume)=0 |
| | set the volume of the sound
|
| virtual float | getVolume () const =0 |
| | get the volume of the sound
|
| virtual void | setPosition (Vector3f position)=0 |
| | set the 3D position of the sound, for backends that spatialize against a listener. A backend without real spatial audio may just store this and keep playing at full volume - a no-op here still leaves a usable sound, unlike a fake 3D model with nothing to render.
|
| virtual Vector3f | getPosition () const =0 |
| | get the 3D position of the sound
|
| virtual void | setVelocity (Vector3f velocity)=0 |
| | set the velocity of the sound, used by backends that apply a doppler effect
|
| virtual Vector3f | getVelocity () const =0 |
| | get the velocity of the sound
|
◆ ~ISound()
| virtual audio::ISound::~ISound |
( |
| ) |
|
|
virtualdefault |
◆ getPosition()
| virtual Vector3f audio::ISound::getPosition |
( |
| ) |
const |
|
pure virtual |
◆ getVelocity()
| virtual Vector3f audio::ISound::getVelocity |
( |
| ) |
const |
|
pure virtual |
◆ getVolume()
| virtual float audio::ISound::getVolume |
( |
| ) |
const |
|
pure virtual |
◆ isReady()
| virtual bool audio::ISound::isReady |
( |
| ) |
const |
|
pure virtual |
◆ pause()
| virtual void audio::ISound::pause |
( |
| ) |
|
|
pure virtual |
◆ play()
| virtual void audio::ISound::play |
( |
| ) |
|
|
pure virtual |
Fires the sound from the beginning.
The ONLY deliberate divergence from IMusic::play() : an ISound is a one-shot, not a transport. play() on a sound already playing RESTARTS it from zero - that is what lets a gunshot retrigger faster than its own duration. IMusic, by contrast, ignores a play() while playing.
The difference is written here because it is intended. It cannot be guessed from the signature, and both vendors have to honour it identically.
Implemented in RaySound, SdlSound, SdlSound, and SfmlSound.
◆ setPosition()
| virtual void audio::ISound::setPosition |
( |
Vector3f | position | ) |
|
|
pure virtual |
set the 3D position of the sound, for backends that spatialize against a listener. A backend without real spatial audio may just store this and keep playing at full volume - a no-op here still leaves a usable sound, unlike a fake 3D model with nothing to render.
- Parameters
-
Implemented in RaySound, SdlSound, SdlSound, and SfmlSound.
◆ setVelocity()
| virtual void audio::ISound::setVelocity |
( |
Vector3f | velocity | ) |
|
|
pure virtual |
◆ setVolume()
| virtual void audio::ISound::setVolume |
( |
float | volume | ) |
|
|
pure virtual |
◆ stop()
| virtual void audio::ISound::stop |
( |
| ) |
|
|
pure virtual |
The documentation for this class was generated from the following file: