Manages and plays sounds within a scene.
More...
|
| | this (Scene *owner) |
| | Constructs a SoundSystem with the given scene owner.
|
| |
|
override void | Update () |
| | Updates the sound system, reducing frames and freeing sounds that have finished playing.
|
| |
| | typeof (this) PlaySound(string soundPath |
| | Plays a sound from the given file path for a specified number of frames.
|
| |
|
| if (chunk==null) |
| |
|
| Mix_PlayChannel (-1, chunk, 0) |
| |
| void | OnSoundEnd (void delegate() callback) |
| | Sets the callback function to be called when a sound ends.
|
| |
|
| int | frames |
| |
|
Mix_Chunk * | chunk = Mix_LoadWAV(soundPath.toStringz()) |
| |
|
| mSounds = new Sound(chunk, frames) |
| |
Manages and plays sounds within a scene.
◆ this()
| systems::audio::SoundSystem::this |
( |
Scene * | owner | ) |
|
|
inline |
Constructs a SoundSystem with the given scene owner.
- Parameters
-
| owner | Pointer to the scene that owns this sound system. |
◆ OnSoundEnd()
| void systems::audio::SoundSystem::OnSoundEnd |
( |
void delegate() | callback | ) |
|
|
inline |
Sets the callback function to be called when a sound ends.
- Parameters
-
| callback | Delegate function to be called on sound end. |
◆ typeof()
| systems::audio::SoundSystem::typeof |
( |
this | | ) |
|
Plays a sound from the given file path for a specified number of frames.
- Parameters
-
| soundPath | Path to the sound file. |
| frames | Number of frames the sound should play. |
- Returns
- Reference to the current SoundSystem instance.
◆ frames
| int systems::audio::SoundSystem::frames |
Initial value:{
writeln("Playing sound: ", soundPath)
The documentation for this class was generated from the following file: