A sound that is currently played. More...
#include <playing_sound.h>
Classes | |
struct | FadeState |
Public Member Functions | |
PlayingSound (ALuint source_id, std::shared_ptr< ISoundDataOpen > data, bool loop, f32 volume, f32 pitch, f32 start_time, const std::optional< std::pair< v3f, v3f > > &pos_vel_opt, const ALExtensions &exts) | |
~PlayingSound () noexcept | |
bool | stepStream (bool playback_speed_changed=false) |
bool | fade (f32 step, f32 target_gain) noexcept |
bool | doFade (f32 dtime) noexcept |
void | updatePosVel (const v3f &pos, const v3f &vel) noexcept |
void | setGain (f32 gain) noexcept |
f32 | getGain () noexcept |
void | setPitch (f32 pitch) |
bool | isStreaming () const noexcept |
void | play () noexcept |
ALint | getState () noexcept |
bool | isDead () noexcept |
void | pause () noexcept |
void | resume () noexcept |
Private Attributes | |
ALuint | m_source_id |
std::shared_ptr< ISoundDataOpen > | m_data |
ALuint | m_next_sample_pos = 0 |
bool | m_looping |
bool | m_is_positional |
bool | m_stopped_means_dead = true |
std::optional< FadeState > | m_fade_state = std::nullopt |
A sound that is currently played.
Can be streaming. Can be fading.
sound::PlayingSound::PlayingSound | ( | ALuint | source_id, |
std::shared_ptr< ISoundDataOpen > | data, | ||
bool | loop, | ||
f32 | volume, | ||
f32 | pitch, | ||
f32 | start_time, | ||
const std::optional< std::pair< v3f, v3f > > & | pos_vel_opt, | ||
const ALExtensions & | exts ) |
References m_data, m_is_positional, m_looping, m_next_sample_pos, m_source_id, m_stopped_means_dead, setGain(), setPitch(), stepStream(), updatePosVel(), and sound::warn_if_al_error().
|
inlinenoexcept |
References m_source_id.
|
noexcept |
|
noexcept |
References MYMAX.
|
noexcept |
References m_is_positional, and m_source_id.
|
inlinenoexcept |
References m_source_id.
Referenced by isDead(), resume(), and stepStream().
|
inlinenoexcept |
References getState(), and m_stopped_means_dead.
Referenced by stepStream().
|
inlinenoexcept |
|
inlinenoexcept |
References m_source_id.
Referenced by sound::OpenALSoundManager::pauseAll().
|
inlinenoexcept |
References m_source_id.
Referenced by resume(), and stepStream().
|
inlinenoexcept |
References getState(), and play().
Referenced by sound::OpenALSoundManager::resumeAll().
|
noexcept |
void sound::PlayingSound::setPitch | ( | f32 | pitch | ) |
References isStreaming(), m_source_id, and stepStream().
Referenced by PlayingSound().
bool sound::PlayingSound::stepStream | ( | bool | playback_speed_changed = false | ) |
References getState(), isDead(), m_data, m_looping, m_next_sample_pos, m_source_id, m_stopped_means_dead, sound::MIN_STREAM_BUFFER_LENGTH, play(), sound::STREAM_BIGSTEP_TIME, and warningstream.
Referenced by PlayingSound(), and setPitch().
References sound::warn_if_al_error().
Referenced by PlayingSound().
|
private |
Referenced by PlayingSound(), isStreaming(), and stepStream().
|
private |
|
private |
Referenced by PlayingSound(), and getGain().
|
private |
Referenced by PlayingSound(), and stepStream().
|
private |
Referenced by PlayingSound(), and stepStream().
|
private |
Referenced by PlayingSound(), ~PlayingSound(), getGain(), getState(), pause(), play(), setPitch(), and stepStream().
|
private |
Referenced by PlayingSound(), isDead(), and stepStream().