Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
DummySoundManager Class Referencefinal

#include <sound.h>

+ Inheritance diagram for DummySoundManager:
+ Collaboration diagram for DummySoundManager:

Public Member Functions

void step (f32 dtime) override
 Removes finished sounds, steps streamed sounds, and does similar tasks.
 
void pauseAll () override
 Pause all sound playback.
 
void resumeAll () override
 Resume sound playback after pause.
 
void updateListener (const v3f &pos, const v3f &vel, const v3f &at, const v3f &up) override
 
void setListenerGain (f32 gain) override
 
bool loadSoundFile (const std::string &name, const std::string &filepath) override
 Adds a sound to load from a file (only OggVorbis).
 
bool loadSoundData (const std::string &name, std::string &&filedata) override
 Same as loadSoundFile, but reads the OggVorbis file from memory.
 
void addSoundToGroup (const std::string &sound_name, const std::string &group_name) override
 Adds sound with name sound_name to group group_name.
 
void playSound (sound_handle_t id, const SoundSpec &spec) override
 Plays a random sound from a sound group (position-less).
 
void playSoundAt (sound_handle_t id, const SoundSpec &spec, const v3f &pos, const v3f &vel) override
 Same as playSound, but at a position.
 
void stopSound (sound_handle_t sound) override
 Request the sound to be stopped.
 
void fadeSound (sound_handle_t sound, f32 step, f32 target_gain) override
 
void updateSoundPosVel (sound_handle_t sound, const v3f &pos, const v3f &vel) override
 Update position and velocity of positional sound.
 
- Public Member Functions inherited from ISoundManager
virtual ~ISoundManager ()=default
 
std::vector< sound_handle_tpollRemovedSounds ()
 Get and reset the list of sounds that were stopped.
 
sound_handle_t allocateId (u32 num_owners)
 Returns a positive id.
 
void freeId (sound_handle_t id, u32 num_owners=1)
 Free an id allocated via allocateId.
 

Additional Inherited Members

- Protected Member Functions inherited from ISoundManager
void reportRemovedSound (sound_handle_t id)
 

Member Function Documentation

◆ addSoundToGroup()

void DummySoundManager::addSoundToGroup ( const std::string & sound_name,
const std::string & group_name )
inlineoverridevirtual

Adds sound with name sound_name to group group_name.

Creates the group if non-existent.

Parameters
sound_nameThe name of the sound, as used in loadSoundData.
group_nameThe name of the sound group.

Implements ISoundManager.

◆ fadeSound()

void DummySoundManager::fadeSound ( sound_handle_t sound,
f32 step,
f32 target_gain )
inlineoverridevirtual

Implements ISoundManager.

◆ loadSoundData()

bool DummySoundManager::loadSoundData ( const std::string & name,
std::string && filedata )
inlineoverridevirtual

Same as loadSoundFile, but reads the OggVorbis file from memory.

Implements ISoundManager.

◆ loadSoundFile()

bool DummySoundManager::loadSoundFile ( const std::string & name,
const std::string & filepath )
inlineoverridevirtual

Adds a sound to load from a file (only OggVorbis).

Parameters
nameThe name of the sound. Must be unique, otherwise call fails.
filepathThe path for
Returns
true on success, false on failure (ie. sound was already added or file does not exist).

Implements ISoundManager.

◆ pauseAll()

void DummySoundManager::pauseAll ( )
inlineoverridevirtual

Pause all sound playback.

Implements ISoundManager.

◆ playSound()

void DummySoundManager::playSound ( sound_handle_t id,
const SoundSpec & spec )
inlineoverridevirtual

Plays a random sound from a sound group (position-less).

Parameters
idId for new sound. Move semantics apply if id > 0.

Implements ISoundManager.

References ISoundManager::reportRemovedSound().

+ Here is the call graph for this function:

◆ playSoundAt()

void DummySoundManager::playSoundAt ( sound_handle_t id,
const SoundSpec & spec,
const v3f & pos,
const v3f & vel )
inlineoverridevirtual

Same as playSound, but at a position.

Parameters
posIn node-space.
velIn node-space.

Implements ISoundManager.

References ISoundManager::reportRemovedSound().

+ Here is the call graph for this function:

◆ resumeAll()

void DummySoundManager::resumeAll ( )
inlineoverridevirtual

Resume sound playback after pause.

Implements ISoundManager.

◆ setListenerGain()

void DummySoundManager::setListenerGain ( f32 gain)
inlineoverridevirtual

Implements ISoundManager.

◆ step()

void DummySoundManager::step ( f32 dtime)
inlineoverridevirtual

Removes finished sounds, steps streamed sounds, and does similar tasks.

Should not be called while paused.

Parameters
dtimeIn seconds.

Implements ISoundManager.

◆ stopSound()

void DummySoundManager::stopSound ( sound_handle_t sound)
inlineoverridevirtual

Request the sound to be stopped.

The id should be freed afterwards.

Implements ISoundManager.

◆ updateListener()

void DummySoundManager::updateListener ( const v3f & pos,
const v3f & vel,
const v3f & at,
const v3f & up )
inlineoverridevirtual
Parameters
posIn node-space.
velIn node-space.
atVector in node-space pointing forwards.
upVector in node-space pointing upwards, orthogonal to at.

Implements ISoundManager.

◆ updateSoundPosVel()

void DummySoundManager::updateSoundPosVel ( sound_handle_t sound,
const v3f & pos,
const v3f & vel )
inlineoverridevirtual

Update position and velocity of positional sound.

Parameters
posIn node-space.
velIn node-space.

Implements ISoundManager.


The documentation for this class was generated from the following file: