|
Capycore Engine
0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
|
Manages audio playback and sound instances within the engine. More...
#include <audio_service.h>
Public Member Functions | |
| AudioService ()=default | |
| std::optional< std::shared_ptr< SoundResource > > | register_sound (const std::string &file_path, const std::string &name, SoundType type=SoundType::GENERIC) |
| bool | unregister_sound (const std::string &name) |
| std::optional< std::shared_ptr< SoundResource > > | get_sound_resource (const std::string &file_path, const std::string &name="") const noexcept |
| std::reference_wrapper< SoundInstance > | play_sound (std::shared_ptr< SoundResource > sound_resource, float volume=1.0f, bool loop=false) |
| std::reference_wrapper< SoundInstance > | play_sound (const std::string &name, float volume=1.0f, bool loop=false) |
| void | stop_sound (SoundInstance &instance) |
| void | stop_sound (const std::string &name) |
| void | stop_all_sounds () |
| bool | has_sound_instance (const std::string &name) const noexcept |
| std::optional< std::reference_wrapper< SoundInstance > > | get_sound_instance (const std::string &name) const |
| std::vector< std::reference_wrapper< SoundInstance > > | get_all_playing_sounds () const |
| void | update () |
| Updates the audio manager, meaning it cleans up finished sounds. | |
Public Member Functions inherited from IEngineService | |
| virtual | ~IEngineService ()=default |
Manages audio playback and sound instances within the engine.
|
default |
| std::vector< std::reference_wrapper< SoundInstance > > AudioService::get_all_playing_sounds | ( | ) | const |
| std::optional< std::reference_wrapper< SoundInstance > > AudioService::get_sound_instance | ( | const std::string & | name | ) | const |
|
noexcept |
|
noexcept |
| std::reference_wrapper< SoundInstance > AudioService::play_sound | ( | const std::string & | name, |
| float | volume = 1.0f, |
||
| bool | loop = false |
||
| ) |
| std::reference_wrapper< SoundInstance > AudioService::play_sound | ( | std::shared_ptr< SoundResource > | sound_resource, |
| float | volume = 1.0f, |
||
| bool | loop = false |
||
| ) |
| std::optional< std::shared_ptr< SoundResource > > AudioService::register_sound | ( | const std::string & | file_path, |
| const std::string & | name, | ||
| SoundType | type = SoundType::GENERIC |
||
| ) |
| void AudioService::stop_all_sounds | ( | ) |
| void AudioService::stop_sound | ( | const std::string & | name | ) |
| void AudioService::stop_sound | ( | SoundInstance & | instance | ) |
| bool AudioService::unregister_sound | ( | const std::string & | name | ) |
| void AudioService::update | ( | ) |
Updates the audio manager, meaning it cleans up finished sounds.