|
3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
|
Represents a single instance of a sound. More...
#include <SoundInstance.hpp>


Public Member Functions | |
| unsafe | SoundInstance (Sound sound, AudioSource source) |
| SoundInstance (IntPtr ptrSI) | |
| void | Play () |
| void | Stop () |
| void | Pause () |
| SoundInstance (Sound *sound, const AudioSource &source) | |
| Constructs a space localized sound instance. | |
| SoundInstance (Sound *sound) | |
| Constructs a sound instance with default audio source settings. | |
| SoundInstance (SoundInstance &&other) noexcept | |
| Move constructor. Transfers ownership of the sound instance to this object. | |
| SoundInstance & | operator= (SoundInstance &&other) noexcept |
| Move assignment operator. Transfers ownership of the sound instance to this object. | |
| const AudioSource & | GetSource () noexcept |
| Gets the sound properties associated with this instance. | |
| void | SetSource (const AudioSource &source) |
| Sets the sound properties associated with this instance. | |
| SoundState | GetState () const noexcept |
| Gets the state of this sound instance. | |
| void | SetPitch (float pitch) |
| Sets the pitch of this sound instance. Range is [0.5, 2.0]. Default is 1.0. | |
| void | SetGain (float gain) |
| Sets the volume of this sound instance. Range is [0.0, 1.0]. Default is 1.0. | |
| void | SetMaxGain (float maxGain) |
| Sets the maximum volume of this sound instance. Range is [0.0, 1.0]. Default is 1.0. | |
| void | SetMinGain (float minGain) |
| Sets the minimum volume of this sound instance. Range is [0.0, 1.0]. Default is 0.0. | |
| void | SetPosition (const Math::Vector3 &pos) |
| Sets the 3D position of this sound instance in world space. Default is (0, 0, 0). | |
| void | SetVelocity (const Math::Vector3 &vel) |
| Sets the velocity of this sound instance, used for Doppler effect calculations. Default is (0, 0, 0). | |
| void | SetDirection (const Math::Vector3 &dir) |
| Sets the direction this sound instance is facing, used for directional (cone) sound sources. Default is (0, 0, 0), meaning omnidirectional. | |
| void | SetMaxDistance (float distance) |
| Sets the maximum distance beyond which this sound instance's volume is not attenuated further. Used with the Inverse Clamped Distance Model. Default is FLT_MAX. | |
| void | SetReferenceDistance (float refDistance) |
| Sets the reference distance at which the volume would be unattenuated. Default is 1.0. | |
| void | SetRolloffFactor (float rolloff) |
| Sets the rolloff factor, controlling how quickly the volume attenuates with distance. Default is 1.0. | |
| void | SetConeOuterGain (float outerGain) |
| Sets the gain applied outside the sound cone's outer angle. Range is [0.0, 1.0]. Default is 0.0. | |
| void | SetConeInnerAngle (float angle) |
| Sets the inner angle of the sound cone, in degrees, within which the sound is at full volume. Range is [0, 360]. Default is 360. | |
| void | SetConeOuterAngle (float angle) |
| Sets the outer angle of the sound cone, in degrees, beyond which the sound is attenuated to the cone outer gain. Range is [0, 360]. Default is 360. | |
| float | GetPitch () |
| Gets the pitch of this sound instance. | |
| float | GetGain () |
| Gets the volume of this sound instance. | |
| float | GetMaxGain () |
| Gets the maximum volume of this sound instance. | |
| float | GetMinGain () |
| Gets the minimum volume of this sound instance. | |
| Math::Vector3 | GetPosition () |
| Gets the 3D position of this sound instance in world space. | |
| Math::Vector3 | GetVelocity () |
| Gets the velocity of this sound instance. | |
| Math::Vector3 | GetDirection () |
| Gets the direction this sound instance is facing. | |
| float | GetMaxDistance () |
| Gets the maximum distance beyond which this sound instance's volume is not attenuated further. | |
| float | GetReferenceDistance () |
| Gets the reference distance at which the volume would be unattenuated. | |
| float | GetRolloffFactor () |
| Gets the rolloff factor. | |
| float | GetConeOuterGain () |
| Gets the gain applied outside the sound cone's outer angle. | |
| float | GetConeInnerAngle () |
| Gets the inner angle of the sound cone, in degrees. | |
| float | GetConeOuterAngle () |
| Gets the outer angle of the sound cone, in degrees. | |
| bool | IsLooping () |
| Gets whether this sound instance is set to loop upon reaching the end of playback. | |
| void | SetLooping (bool looping) |
| Sets whether this sound instance should loop upon reaching the end of playback. Default is false. | |
| void | Play (bool dontOverlap=true) const noexcept |
| Starts or resumes playback of this sound instance. | |
| void | Stop () const noexcept |
| Stops playback of this sound instance and resets its playback position. | |
| void | Pause () const noexcept |
| Pauses playback of this sound instance, preserving its current playback position. | |
| ~SoundInstance () | |
| Deletes the associated OpenAL sound source. | |
| Public Member Functions inherited from Engine3DRadSpace.NatPtrWrapper | |
| virtual void | Dispose () |
Properties | |
| float | Pitch [get, set] |
| float | Gain [get, set] |
| float | MaxGain [get, set] |
| float | MinGain [get, set] |
| unsafe Vector3 | Position [get, set] |
| unsafe Vector3 | Velocity [get, set] |
| unsafe Vector3 | Direction [get, set] |
| float | MaxDistance [get, set] |
| float | RerefenceDistance [get, set] |
| float | RolloffFactor [get, set] |
| float | ConeOuterGain [get, set] |
| float | ConeInnerAngle [get, set] |
| float | ConeOuterAngle [get, set] |
| bool | IsLooping [get, set] |
| Properties inherited from Engine3DRadSpace.NatPtrWrapper | |
| IntPtr | Handle [get] |
Additional Inherited Members | |
| Protected Member Functions inherited from Engine3DRadSpace.NatPtrWrapper | |
| NatPtrWrapper (IntPtr handle, Action< IntPtr > fnDestroy) | |
| NatPtrWrapper (Action< IntPtr > fnDestroy) | |
| void | Reset (IntPtr newObj) |
| void | Dispose (bool disposing) |
| Protected Attributes inherited from Engine3DRadSpace.NatPtrWrapper | |
| IntPtr | _handle |
| bool | _disposed |
Represents a single instance of a sound.
|
inline |
|
inline |
| SoundInstance::SoundInstance | ( | Sound * | sound, |
| const AudioSource & | source ) |
Constructs a space localized sound instance.
| sound | The sound to be played |
| source | The audio source |
|
explicit |
Constructs a sound instance with default audio source settings.
| sound | The sound to be played |
|
noexcept |
Move constructor. Transfers ownership of the sound instance to this object.
| other | The sound instance to move from |
| SoundInstance::~SoundInstance | ( | ) |
Deletes the associated OpenAL sound source.
| float SoundInstance::GetConeInnerAngle | ( | ) |
Gets the inner angle of the sound cone, in degrees.
| float SoundInstance::GetConeOuterAngle | ( | ) |
Gets the outer angle of the sound cone, in degrees.
| float SoundInstance::GetConeOuterGain | ( | ) |
Gets the gain applied outside the sound cone's outer angle.
| Vector3 SoundInstance::GetDirection | ( | ) |
Gets the direction this sound instance is facing.
| float SoundInstance::GetGain | ( | ) |
Gets the volume of this sound instance.
| float SoundInstance::GetMaxDistance | ( | ) |
Gets the maximum distance beyond which this sound instance's volume is not attenuated further.
| float SoundInstance::GetMaxGain | ( | ) |
Gets the maximum volume of this sound instance.
| float SoundInstance::GetMinGain | ( | ) |
Gets the minimum volume of this sound instance.
| float SoundInstance::GetPitch | ( | ) |
Gets the pitch of this sound instance.
| Vector3 SoundInstance::GetPosition | ( | ) |
Gets the 3D position of this sound instance in world space.
| float SoundInstance::GetReferenceDistance | ( | ) |
Gets the reference distance at which the volume would be unattenuated.
| float SoundInstance::GetRolloffFactor | ( | ) |
Gets the rolloff factor.
|
noexcept |
Gets the sound properties associated with this instance.
|
noexcept |
Gets the state of this sound instance.
| Vector3 SoundInstance::GetVelocity | ( | ) |
Gets the velocity of this sound instance.
Gets whether this sound instance is set to loop upon reaching the end of playback.
|
noexcept |
Move assignment operator. Transfers ownership of the sound instance to this object.
| other | The sound instance to move from |
|
inline |
|
noexcept |
Pauses playback of this sound instance, preserving its current playback position.
|
inline |
|
noexcept |
Starts or resumes playback of this sound instance.
| dontOverlap | if true, restarts playback from the beginning instead of overlapping with an already playing instance |
| void SoundInstance::SetConeInnerAngle | ( | float | angle | ) |
Sets the inner angle of the sound cone, in degrees, within which the sound is at full volume. Range is [0, 360]. Default is 360.
| angle | inner cone angle, in degrees |
| void SoundInstance::SetConeOuterAngle | ( | float | angle | ) |
Sets the outer angle of the sound cone, in degrees, beyond which the sound is attenuated to the cone outer gain. Range is [0, 360]. Default is 360.
| angle | outer cone angle, in degrees |
| void SoundInstance::SetConeOuterGain | ( | float | outerGain | ) |
Sets the gain applied outside the sound cone's outer angle. Range is [0.0, 1.0]. Default is 0.0.
| outerGain | outer cone gain |
| void SoundInstance::SetDirection | ( | const Math::Vector3 & | dir | ) |
Sets the direction this sound instance is facing, used for directional (cone) sound sources. Default is (0, 0, 0), meaning omnidirectional.
| dir | the direction |
| void SoundInstance::SetGain | ( | float | gain | ) |
Sets the volume of this sound instance. Range is [0.0, 1.0]. Default is 1.0.
| gain | volume |
| void SoundInstance::SetLooping | ( | bool | looping | ) |
Sets whether this sound instance should loop upon reaching the end of playback. Default is false.
| looping | true to enable looping, false to disable |
| void SoundInstance::SetMaxDistance | ( | float | distance | ) |
Sets the maximum distance beyond which this sound instance's volume is not attenuated further. Used with the Inverse Clamped Distance Model. Default is FLT_MAX.
| distance | maximum distance |
| void SoundInstance::SetMaxGain | ( | float | maxGain | ) |
Sets the maximum volume of this sound instance. Range is [0.0, 1.0]. Default is 1.0.
| maxGain | maximum volume |
| void SoundInstance::SetMinGain | ( | float | minGain | ) |
Sets the minimum volume of this sound instance. Range is [0.0, 1.0]. Default is 0.0.
| minGain | minimum volume |
| void SoundInstance::SetPitch | ( | float | pitch | ) |
Sets the pitch of this sound instance. Range is [0.5, 2.0]. Default is 1.0.
| pitch | The pitch value to set |
| void SoundInstance::SetPosition | ( | const Math::Vector3 & | pos | ) |
Sets the 3D position of this sound instance in world space. Default is (0, 0, 0).
| pos | the position |
| void SoundInstance::SetReferenceDistance | ( | float | refDistance | ) |
Sets the reference distance at which the volume would be unattenuated. Default is 1.0.
| refDistance | reference distance |
| void SoundInstance::SetRolloffFactor | ( | float | rolloff | ) |
Sets the rolloff factor, controlling how quickly the volume attenuates with distance. Default is 1.0.
| rolloff | rolloff factor |
| void SoundInstance::SetSource | ( | const AudioSource & | source | ) |
Sets the sound properties associated with this instance.
| source | The audio source to set |
| void SoundInstance::SetVelocity | ( | const Math::Vector3 & | vel | ) |
Sets the velocity of this sound instance, used for Doppler effect calculations. Default is (0, 0, 0).
| vel | the velocity |
|
inline |
|
noexcept |
Stops playback of this sound instance and resets its playback position.
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |