|
3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
|
Represents an 2D sound effect that can be played in the scene. More...
#include <SoundEffect.hpp>


Public Member Functions | |
| SoundEffect () | |
| Sound | GetSound () |
| SoundInstance | GetSoundInstance () |
| SoundEffect () | |
| Default constructor. | |
| SoundEffect (const std::string &name, bool enabled, RefSound sound) | |
| Constructs a sound effect from an numerical asset identifier. | |
| SoundEffect (const std::string &name, bool enabled, const std::filesystem::path &path) | |
| Constructs an sound effect from an file path. | |
| SoundEffect (SoundEffect &&) noexcept=default | |
| SoundEffect & | operator= (SoundEffect &&) noexcept=default |
| Audio::Sound * | GetSound () const noexcept |
| Gets the underlying sound asset used by this object. | |
| Audio::SoundInstance * | GetInstance () const noexcept |
| Gets the underlying sound instance used by this object. | |
| void | Initialize () override |
| Does nothing. | |
| void | Load () override |
| Loads the sound asset. | |
| void | Load (const std::filesystem::path &path) override |
| Loads a sound from an specified path. | |
| void | Update () override |
| Does nothing. | |
| void | Enable () override |
| Plays the sound. | |
| void | Disable () override |
| Pauses the sound. | |
| bool | Switch () override |
| Plays the sound if stopped, and vice-versa. | |
| Reflection::UUID | GetUUID () const noexcept override |
| Gets the UUID of the SoundEffect type. | |
| Gizmos::IGizmo * | GetGizmo () const noexcept |
| Returns the gizmo object of this object, used for editor/debug rendering. | |
| float | GetVolume () const noexcept |
| Gets the gain of the sound effect. | |
| void | SetVolume (float f) noexcept |
| Sets the gain of the sound effect. Range is [0.0, 1.0]. Default is 1.0. | |
| float | GetPitch () const noexcept |
| Gets the pitch of the sound effect. | |
| void | SetPitch (float p) noexcept |
| Sets the pitch of the sound effect. Default is 1.0. Range is [0.5, 2.0]. Values outside this range may cause audio distortion. | |
| bool | IsLooping () const noexcept |
| Gets whether the sound effect is looping. | |
| void | SetLooping (bool looping) noexcept |
| Sets whether the sound effect is looping. | |
| ~SoundEffect ()=default | |
| Public Member Functions inherited from Engine3DRadSpace.Objects.InstIObject | |
| InstIObject (IntPtr handle) | |
| IObject | GetChild (int idx) |
| int | GetChildrenCount () |
| void | Show () |
| Shows this object. | |
| void | Hide () |
| Hides this object. | |
| bool | SwitchVisibility () |
| Switches the visibility state of this object. | |
| void | Load (string path) |
| override void | Dispose () |
| Public Member Functions inherited from Engine3DRadSpace.IUpdateable | |
| void | Update () |
| virtual | ~IUpdateable ()=default |
| Public Member Functions inherited from Engine3DRadSpace.Objects.IObject | |
| void | Enable () |
| void | Disable () |
| bool | Switch () |
| void | Show () |
| void | Hide () |
| bool | SwitchVisibility () |
| IObject | GetChild (int idx) |
| int | GetChildrenCount () |
| void | InternalInitialize (IGame *game) |
| Called by ObjectsList to set the _game Game instance. If there are objects manually managed, this MUST be called before Initialize or EditorInitialize. | |
| Graphics::IGraphicsDevice * | GetGraphicsDeviceHandle () const noexcept |
| Returns the graphics device handle associated with this object. | |
| IGame * | GetGame () const noexcept |
| Gets the game that this object belongs to. | |
| IObject * | operator[] (size_t idxChild) const |
| Returns the idx-th child of this object. | |
| IObject * | GetParent () const noexcept |
| Returns the parent of this object. | |
| void | SetParent (IObject *newParent) noexcept |
| Sets the parent of this object. | |
| bool | HasParent () const noexcept |
| Checks if this object has a parent. | |
| size_t | GetChildrenCount () const noexcept |
| Returns the number of children of this object. | |
| void | Uninitialize () override |
| Called before the object has the destructor called. | |
| virtual | ~IObject () |
| Public Member Functions inherited from Engine3DRadSpace.IInitializable | |
| void | Initialize () |
| virtual | ~IInitializable ()=default |
| Public Member Functions inherited from Engine3DRadSpace.ILoadable | |
| void | Load () |
| void | Load (string path) |
| virtual | ~ILoadable ()=default |
Public Attributes | |
| RefSound | Sound |
| Numerical reference to the sound asset used by this object. | |
| Public Attributes inherited from Engine3DRadSpace.Objects.IObject | |
| std::string | Name |
| Name of the object. | |
| ChildObjectCollection | Children |
| Children of this object. | |
Properties | |
| uint | SoundID [get, set] |
| float | Volume [get, set] |
| float | Pitch [get, set] |
| bool | Looping [get, set] |
| Properties inherited from Engine3DRadSpace.Objects.InstIObject | |
| IObject? | Parent [get, set] |
| string | Name [get, set] |
| bool | Enabled [get, set] |
| bool | Visible [get, set] |
| Reflection.UUID | UUID [get] |
| IGame | Game [get] |
| IGraphicsDevice | GraphicsDevice [get] |
| IGizmo | Gizmo [get] |
| ObjectCollection | Children [get] |
| Properties inherited from Engine3DRadSpace.NatPtrWrapper | |
| IntPtr | Handle [get] |
| Properties inherited from Engine3DRadSpace.Objects.IObject | |
| string | Name [get, set] |
| bool | Enabled [get, set] |
| Is this object enabled? | |
| bool | Visible [get, set] |
| Is this object visible? | |
| Reflection.UUID | UUID [get] |
| IGame | Game [get] |
| IGraphicsDevice | GraphicsDevice [get] |
| IGizmo | Gizmo [get] |
| ObjectCollection | Children [get] |
| IObject | Parent [get, set] |
Additional Inherited Members | |
| Protected Member Functions inherited from Engine3DRadSpace.InstIUpdateable | |
| InstIUpdateable (IntPtr handle, bool ownsHandle) | |
| 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 Member Functions inherited from Engine3DRadSpace.IUpdateable | |
| IUpdateable ()=default | |
| IUpdateable (const IUpdateable &) noexcept=default | |
| IUpdateable & | operator= (const IUpdateable &) noexcept=default |
| IUpdateable (IUpdateable &&) noexcept=default | |
| IUpdateable & | operator= (IUpdateable &&) noexcept=default |
| Protected Member Functions inherited from Engine3DRadSpace.Objects.IObject | |
| IObject (const std::string &name="Empty", bool enabled=false, bool visible=false) | |
| Default constructor used for reflection. Objects created with this constructor are initially invalid, until internalInitialize() is called. | |
| IObject (const IObject &) noexcept=delete | |
| IObject & | operator= (const IObject &) noexcept=delete |
| IObject (IObject &&) noexcept=default | |
| IObject & | operator= (IObject &&) noexcept=default |
| Protected Member Functions inherited from Engine3DRadSpace.IInitializable | |
| IInitializable ()=default | |
| IInitializable (const IInitializable &) noexcept=default | |
| IInitializable & | operator= (const IInitializable &) noexcept=default |
| IInitializable (IInitializable &&) noexcept=default | |
| IInitializable & | operator= (IInitializable &&) noexcept=default |
| Protected Member Functions inherited from Engine3DRadSpace.ILoadable | |
| ILoadable ()=default | |
| ILoadable (const ILoadable &) noexcept=default | |
| ILoadable & | operator= (const ILoadable &) noexcept=default |
| ILoadable (ILoadable &&) noexcept=default | |
| ILoadable & | operator= (ILoadable &&) noexcept=default |
| Protected Attributes inherited from Engine3DRadSpace.NatPtrWrapper | |
| IntPtr | _handle |
| bool | _disposed |
| Protected Attributes inherited from Engine3DRadSpace.Objects.IObject | |
| IGame * | _game = nullptr |
| Graphics::IGraphicsDevice * | _device = nullptr |
| IObject * | _parent = nullptr |
Represents an 2D sound effect that can be played in the scene.
|
inline |
Default constructor.
| Engine3DRadSpace.Objects.SoundEffect.SoundEffect | ( | const std::string & | name, |
| bool | enabled, | ||
| RefSound | sound ) |
Constructs a sound effect from an numerical asset identifier.
| name | Name of the object |
| enabled | Is this object enabled? |
| sound | Numerical asset identifier for the sound |
| Engine3DRadSpace.Objects.SoundEffect.SoundEffect | ( | const std::string & | name, |
| bool | enabled, | ||
| const std::filesystem::path & | path ) |
Constructs an sound effect from an file path.
| name | Name of the object |
| enabled | Is this object enabled? |
| path | File path to the sound(OGG or WAV) |
|
defaultnoexcept |
|
default |
|
overridevirtual |
Pauses the sound.
Reimplemented from Engine3DRadSpace.Objects.InstIObject.
|
overridevirtual |
Plays the sound.
Reimplemented from Engine3DRadSpace.Objects.InstIObject.
|
virtualnoexcept |
Returns the gizmo object of this object, used for editor/debug rendering.
Implements Engine3DRadSpace.Objects.IObject.
|
noexcept |
Gets the underlying sound instance used by this object.
|
noexcept |
Gets the pitch of the sound effect.
|
inline |
|
noexcept |
Gets the underlying sound asset used by this object.
|
inline |
|
overridevirtualnoexcept |
Gets the UUID of the SoundEffect type.
Implements Engine3DRadSpace.Objects.IObject.
|
noexcept |
Gets the gain of the sound effect.
|
overridevirtual |
Does nothing.
Reimplemented from Engine3DRadSpace.Objects.InstIObject.
|
noexcept |
Gets whether the sound effect is looping.
|
overridevirtual |
Loads the sound asset.
Reimplemented from Engine3DRadSpace.Objects.InstIObject.
|
overridevirtual |
Loads a sound from an specified path.
| path | WAV or OGG file |
Implements Engine3DRadSpace.ILoadable.
|
defaultnoexcept |
|
noexcept |
Sets whether the sound effect is looping.
| looping | True to make the sound effect loop, false otherwise |
|
noexcept |
Sets the pitch of the sound effect. Default is 1.0. Range is [0.5, 2.0]. Values outside this range may cause audio distortion.
| p |
|
noexcept |
Sets the gain of the sound effect. Range is [0.0, 1.0]. Default is 1.0.
| f | Volume |
|
overridevirtual |
Plays the sound if stopped, and vice-versa.
Reimplemented from Engine3DRadSpace.Objects.InstIObject.
|
overridevirtual |
Does nothing.
Reimplemented from Engine3DRadSpace.InstIUpdateable.
| RefSound Engine3DRadSpace.Objects.SoundEffect.Sound |
Numerical reference to the sound asset used by this object.
|
getset |
|
getset |
|
getset |
|
getset |