Describes the sound information for playback. More...
#include <sound.h>
Public Member Functions | |
SoundSpec (std::string_view name="", float gain=1.0f, bool loop=false, float fade=0.0f, float pitch=1.0f, float start_time=0.0f) | |
bool | exists () const |
void | serializeSimple (std::ostream &os, u16 protocol_version) const |
Serialize a SimpleSoundSpec . | |
void | deSerializeSimple (std::istream &is, u16 protocol_version) |
Deserialize a SimpleSoundSpec . | |
Public Attributes | |
std::string | name |
float | gain = 1.0f |
float | fade = 0.0f |
float | pitch = 1.0f |
float | start_time = 0.0f |
bool | loop = false |
bool | use_local_fallback = true |
Describes the sound information for playback.
Positional handling is done separately.
SimpleSoundSpec
, as used by modding, is a SoundSpec
with only name, fain, pitch and fade.
|
inline |
|
inline |
Deserialize a SimpleSoundSpec
.
References deSerializeString16(), fade, gain, name, pitch, and readF32().
Referenced by ContentFeatures::deSerialize(), and ItemDefinition::deSerialize().
|
inline |
References name.
Referenced by SoundMaker::playPlayerStep().
|
inline |
Serialize a SimpleSoundSpec
.
References fade, gain, name, pitch, serializeString16(), and writeF32().
Referenced by ContentFeatures::serialize(), and ItemDefinition::serialize().
float SoundSpec::fade = 0.0f |
float SoundSpec::gain = 1.0f |
Referenced by deSerializeSimple(), Client::handleCommand_PlaySound(), Game::handleDigging(), ModApiClientSound::l_sound_play(), Server::playSound(), sound::OpenALSoundManager::playSound(), sound::OpenALSoundManager::playSoundAt(), push_simplesoundspec(), read_simplesoundspec(), serializeSimple(), and GenericCAO::step().
bool SoundSpec::loop = false |
std::string SoundSpec::name |
float SoundSpec::pitch = 1.0f |
Referenced by deSerializeSimple(), Client::handleCommand_PlaySound(), ModApiClientSound::l_sound_play(), Server::playSound(), sound::OpenALSoundManager::playSound(), sound::OpenALSoundManager::playSoundAt(), push_simplesoundspec(), read_server_sound_params(), read_simplesoundspec(), and serializeSimple().
float SoundSpec::start_time = 0.0f |
bool SoundSpec::use_local_fallback = true |
Referenced by sound::OpenALSoundManager::playSound(), and sound::OpenALSoundManager::playSoundAt().