Luanti 5.16.0-dev
Loading...
Searching...
No Matches
SoundSpec Struct Reference

Describes the sound information for playback. More...

#include <sound_spec.h>

Collaboration diagram for SoundSpec:

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
void deSerializeSimple (std::istream &is, u16 protocol_version)

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ SoundSpec()

SoundSpec::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 )
inline

References fade, gain, loop, name, pitch, and start_time.

Member Function Documentation

◆ deSerializeSimple()

void SoundSpec::deSerializeSimple ( std::istream & is,
u16 protocol_version )

References deSerializeString16(), fade, gain, name, pitch, and readF32().

Here is the call graph for this function:

◆ exists()

bool SoundSpec::exists ( ) const
inline

References name.

◆ serializeSimple()

void SoundSpec::serializeSimple ( std::ostream & os,
u16 protocol_version ) const

References fade, gain, name, pitch, serializeString16(), and writeF32().

Here is the call graph for this function:

Member Data Documentation

◆ fade

◆ gain

◆ loop

◆ name

◆ pitch

◆ start_time

◆ use_local_fallback

bool SoundSpec::use_local_fallback = true

The documentation for this struct was generated from the following files: