Classes | |
struct | FadeState |
Public Member Functions | |
OpenALSoundManager (SoundManagerSingleton *smg, OnDemandSoundFetcher *fetcher) | |
~OpenALSoundManager () | |
void | step (float dtime) |
void | addBuffer (const std::string &name, SoundBuffer *buf) |
SoundBuffer * | getBuffer (const std::string &name) |
PlayingSound * | createPlayingSound (SoundBuffer *buf, bool loop, float volume, float pitch) |
PlayingSound * | createPlayingSoundAt (SoundBuffer *buf, bool loop, float volume, v3f pos, float pitch) |
int | playSoundRaw (SoundBuffer *buf, bool loop, float volume, float pitch) |
int | playSoundRawAt (SoundBuffer *buf, bool loop, float volume, const v3f &pos, float pitch) |
void | deleteSound (int id) |
SoundBuffer * | getFetchBuffer (const std::string &name) |
void | maintain () |
bool | loadSoundFile (const std::string &name, const std::string &filepath) |
bool | loadSoundData (const std::string &name, const std::string &filedata) |
void | updateListener (const v3f &pos, const v3f &vel, const v3f &at, const v3f &up) |
void | setListenerGain (float gain) |
int | playSound (const std::string &name, bool loop, float volume, float fade, float pitch) |
int | playSoundAt (const std::string &name, bool loop, float volume, v3f pos, float pitch) |
void | stopSound (int sound) |
void | fadeSound (int soundid, float step, float gain) |
void | doFades (float dtime) |
bool | soundExists (int sound) |
void | updateSoundPosition (int id, v3f pos) |
bool | updateSoundGain (int id, float gain) |
float | getSoundGain (int id) |
Public Member Functions inherited from ISoundManager | |
virtual | ~ISoundManager ()=default |
int | playSound (const SimpleSoundSpec &spec, bool loop) |
int | playSoundAt (const SimpleSoundSpec &spec, bool loop, const v3f &pos) |
Private Attributes | |
OnDemandSoundFetcher * | m_fetcher |
ALCdevice * | m_device |
ALCcontext * | m_context |
int | m_next_id |
std::unordered_map< std::string, std::vector< SoundBuffer * > > | m_buffers |
std::unordered_map< int, PlayingSound * > | m_sounds_playing |
std::unordered_map< int, FadeState > | m_sounds_fading |
|
inline |
References infostream.
|
inline |
References deleteSound(), infostream, m_buffers, and m_sounds_playing.
|
inline |
References m_buffers.
Referenced by loadSoundData(), and loadSoundFile().
|
inline |
References SoundBuffer::buffer_id, infostream, PlayingSound::source_id, and warn_if_error().
Referenced by playSoundRaw().
|
inline |
References SoundBuffer::buffer_id, infostream, PlayingSound::source_id, and warn_if_error().
Referenced by playSoundRawAt().
|
inline |
References m_sounds_playing, and PlayingSound::source_id.
Referenced by ~OpenALSoundManager(), maintain(), and stopSound().
|
inline |
References OpenALSoundManager::FadeState::current_gain, m_sounds_fading, OpenALSoundManager::FadeState::step, stopSound(), OpenALSoundManager::FadeState::target_gain, and updateSoundGain().
Referenced by step().
|
inlinevirtual |
Implements ISoundManager.
References getSoundGain(), m_sounds_fading, rangelim, and step().
Referenced by playSound().
|
inline |
References m_buffers, and myrand().
Referenced by getFetchBuffer().
|
inline |
References OnDemandSoundFetcher::fetchSounds(), getBuffer(), loadSoundData(), loadSoundFile(), and m_fetcher.
Referenced by playSound(), and playSoundAt().
|
inlinevirtual |
Implements ISoundManager.
References m_sounds_playing, and PlayingSound::source_id.
Referenced by fadeSound().
|
inlinevirtual |
Implements ISoundManager.
References addBuffer(), and load_ogg_from_buffer().
Referenced by getFetchBuffer().
|
inlinevirtual |
Implements ISoundManager.
References addBuffer(), and load_ogg_from_file().
Referenced by getFetchBuffer().
|
inline |
References deleteSound(), m_buffers, m_sounds_playing, PlayingSound::source_id, and verbosestream.
Referenced by playSound(), playSoundAt(), soundExists(), and stopSound().
|
inlinevirtual |
Implements ISoundManager.
References fadeSound(), getFetchBuffer(), infostream, maintain(), and playSoundRaw().
|
inlinevirtual |
Implements ISoundManager.
References getFetchBuffer(), infostream, maintain(), and playSoundRawAt().
|
inline |
References createPlayingSound(), m_next_id, and m_sounds_playing.
Referenced by playSound().
|
inline |
References createPlayingSoundAt(), m_next_id, and m_sounds_playing.
Referenced by playSoundAt().
|
inlinevirtual |
Implements ISoundManager.
|
inlinevirtual |
Implements ISoundManager.
References m_sounds_playing, and maintain().
|
inlinevirtual |
Implements ISoundManager.
References doFades().
Referenced by fadeSound().
|
inlinevirtual |
Implements ISoundManager.
References deleteSound(), and maintain().
Referenced by doFades().
|
inlinevirtual |
Implements ISoundManager.
References f3_set(), and warn_if_error().
|
inlinevirtual |
Implements ISoundManager.
References m_sounds_playing, and PlayingSound::source_id.
Referenced by doFades().
|
inlinevirtual |
Implements ISoundManager.
References m_sounds_playing, and PlayingSound::source_id.
|
private |
Referenced by ~OpenALSoundManager(), addBuffer(), getBuffer(), and maintain().
|
private |
|
private |
|
private |
Referenced by getFetchBuffer().
|
private |
Referenced by playSoundRaw(), and playSoundRawAt().
|
private |
Referenced by doFades(), and fadeSound().
|
private |
Referenced by ~OpenALSoundManager(), deleteSound(), getSoundGain(), maintain(), playSoundRaw(), playSoundRawAt(), soundExists(), updateSoundGain(), and updateSoundPosition().