21class SoundManagerSingleton;
86 std::shared_ptr<ISoundDataOpen>
openSingleSound(
const std::string &sound_name);
104 bool loop, f32 volume, f32 pitch, f32 start_time,
105 const std::optional<std::pair<v3f, v3f>> &pos_vel_opt);
108 f32 volume, f32 fade, f32 pitch,
bool use_local_fallback, f32 start_time,
109 const std::optional<std::pair<v3f, v3f>> &pos_vel_opt);
120 std::unique_ptr<SoundFallbackPathProvider> fallback_path_provider);
129 void step(f32 dtime);
136 bool loadSoundFile(
const std::string &name,
const std::string &filepath);
137 bool loadSoundData(
const std::string &name, std::string &&filedata);
140 void addSoundToGroup(
const std::string &sound_name,
const std::string &group_name);
152 void *
run()
override;
#define DISABLE_CLASS_COPY(C)
Definition basic_macros.h:26
Definition container.h:117
void push_back(const T &t)
Definition container.h:130
Definition sound_manager.h:35
void loadSoundDataNoCheck(const std::string &name, std::string &&filedata)
Definition sound_manager.cpp:377
ALCcontext *const m_context
Definition sound_manager.h:40
void playSound(sound_handle_t id, const SoundSpec &spec)
Definition sound_manager.cpp:392
int removeDeadSounds()
Deletes sounds that are dead (=finished).
Definition sound_manager.cpp:236
std::string getOrLoadLoadedSoundNameFromGroup(const std::string &group_name)
Same as getLoadedSoundNameFromGroup, but if sound does not exist, try to load from local files.
Definition sound_manager.cpp:122
std::string getLoadedSoundNameFromGroup(const std::string &group_name)
Gets a random sound name from a group.
Definition sound_manager.cpp:94
std::unordered_map< std::string, std::vector< std::string > > m_sound_groups
Definition sound_manager.h:51
f32 m_stream_timer
Definition sound_manager.h:60
MutexedQueue< SoundManagerMsgToProxy > m_queue_to_proxy
Definition sound_manager.h:73
ALCdevice *const m_device
Definition sound_manager.h:39
void loadSoundFileNoCheck(const std::string &name, const std::string &filepath)
Definition sound_manager.cpp:371
std::vector< std::weak_ptr< PlayingSound > > m_sounds_streaming_next_bigstep
Definition sound_manager.h:58
void setListenerGain(f32 gain)
Definition sound_manager.cpp:335
std::unordered_map< std::string, std::shared_ptr< ISoundDataOpen > > m_sound_datas_open
Definition sound_manager.h:49
void addSoundToGroup(const std::string &sound_name, const std::string &group_name)
Definition sound_manager.cpp:383
void fadeSound(sound_handle_t soundid, f32 step, f32 target_gain)
Definition sound_manager.cpp:416
void stepStreams(f32 dtime)
Definition sound_manager.cpp:21
void reportRemovedSound(sound_handle_t id)
Definition sound_manager.h:160
~OpenALSoundManager() override
Definition sound_manager.cpp:269
const ALExtensions m_exts
Definition sound_manager.h:42
bool m_is_paused
Definition sound_manager.h:65
f32 m_time_until_dead_removal
Definition sound_manager.h:45
void updateSoundPosVel(sound_handle_t sound, const v3f &pos_, const v3f &vel_)
Definition sound_manager.cpp:429
std::unordered_map< sound_handle_t, std::shared_ptr< PlayingSound > > m_sounds_playing
Definition sound_manager.h:54
std::shared_ptr< PlayingSound > createPlayingSound(const std::string &sound_name, bool loop, f32 volume, f32 pitch, f32 start_time, const std::optional< std::pair< v3f, v3f > > &pos_vel_opt)
Definition sound_manager.cpp:138
void step(f32 dtime)
Definition sound_manager.cpp:276
bool loadSoundData(const std::string &name, std::string &&filedata)
Definition sound_manager.cpp:361
void send(SoundManagerMsgToProxy msg)
Definition sound_manager.h:155
void playSoundAt(sound_handle_t id, const SoundSpec &spec, const v3f &pos_, const v3f &vel_)
Definition sound_manager.cpp:398
std::vector< std::weak_ptr< PlayingSound > > m_sounds_streaming_current_bigstep
Definition sound_manager.h:57
void updateListener(const v3f &pos_, const v3f &vel_, const v3f &at_, const v3f &up_)
Definition sound_manager.cpp:320
std::unique_ptr< SoundFallbackPathProvider > m_fallback_path_provider
Definition sound_manager.h:37
void playSoundGeneric(sound_handle_t id, const std::string &group_name, bool loop, f32 volume, f32 fade, f32 pitch, bool use_local_fallback, f32 start_time, const std::optional< std::pair< v3f, v3f > > &pos_vel_opt)
Definition sound_manager.cpp:179
void pauseAll()
Definition sound_manager.cpp:302
void doFades(f32 dtime)
Definition sound_manager.cpp:53
void stopSound(sound_handle_t sound)
Definition sound_manager.cpp:410
std::unordered_map< std::string, std::unique_ptr< ISoundDataUnopen > > m_sound_datas_unopen
Definition sound_manager.h:48
std::shared_ptr< ISoundDataOpen > openSingleSound(const std::string &sound_name)
Gives the open sound for a loaded sound.
Definition sound_manager.cpp:72
void * run() override
Definition sound_manager.cpp:443
std::vector< std::weak_ptr< PlayingSound > > m_sounds_fading
Definition sound_manager.h:62
OpenALSoundManager(SoundManagerSingleton *smg, std::unique_ptr< SoundFallbackPathProvider > fallback_path_provider)
Definition sound_manager.cpp:256
std::unordered_set< std::string > m_warned_positional_stereo_sounds
Definition sound_manager.h:68
bool loadSoundFile(const std::string &name, const std::string &filepath)
Definition sound_manager.cpp:347
void resumeAll()
Definition sound_manager.cpp:311
MutexedQueue< SoundManagerMsgToMgr > m_queue_to_mgr
Definition sound_manager.h:72
Class for the openal device and context.
Definition sound_singleton.h:20
int sound_handle_t
Definition client.h:62
core::vector3df v3f
Definition irr_v3d.h:11
Definition al_extensions.cpp:11
constexpr f32 REMOVE_DEAD_SOUNDS_INTERVAL
Definition sound_constants.h:87
constexpr f32 STREAM_BIGSTEP_TIME
Definition sound_constants.h:93
std::variant< std::monostate, sound_manager_messages_to_proxy::ReportRemovedSound, sound_manager_messages_to_proxy::Stopped > SoundManagerMsgToProxy
Definition sound_manager_messages.h:61
Describes the sound information for playback.
Definition sound.h:20
Struct for AL and ALC extensions.
Definition al_extensions.h:15
Definition sound_manager_messages.h:56