Luanti 5.15.0-dev
 
Loading...
Searching...
No Matches
SoundMaker Class Reference

#include <sound_maker.h>

+ Collaboration diagram for SoundMaker:

Public Member Functions

 SoundMaker (ISoundManager *sound, const NodeDefManager *ndef)
 
void registerReceiver (MtEventManager *mgr)
 
void update (f32 dtime, bool makes_footstep_sound, const SoundSpec &sound_footstep)
 

Public Attributes

SoundSpec m_player_leftpunch_sound
 
SoundSpec m_player_leftpunch_sound2
 
SoundSpec m_player_rightpunch_sound
 

Private Member Functions

void playPlayerStep ()
 
void playPlayerJump ()
 

Static Private Member Functions

static void viewBobbingStep (MtEvent *e, void *data)
 
static void playerRegainGround (MtEvent *e, void *data)
 
static void playerJump (MtEvent *e, void *data)
 
static void cameraPunchLeft (MtEvent *e, void *data)
 
static void cameraPunchRight (MtEvent *e, void *data)
 
static void nodeDug (MtEvent *e, void *data)
 
static void playerDamage (MtEvent *e, void *data)
 
static void playerFallingDamage (MtEvent *e, void *data)
 

Private Attributes

ISoundManagerm_sound
 
const NodeDefManagerm_ndef
 
float m_player_step_timer = 0.0f
 
float m_player_jump_timer = 0.0f
 
bool makes_footstep_sound = true
 
SoundSpec m_player_step_sound
 

Constructor & Destructor Documentation

◆ SoundMaker()

SoundMaker::SoundMaker ( ISoundManager * sound,
const NodeDefManager * ndef )
inline

Member Function Documentation

◆ cameraPunchLeft()

void SoundMaker::cameraPunchLeft ( MtEvent * e,
void * data )
staticprivate

References m_player_leftpunch_sound, m_player_leftpunch_sound2, m_sound, and ISoundManager::playSound().

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cameraPunchRight()

void SoundMaker::cameraPunchRight ( MtEvent * e,
void * data )
staticprivate

References m_player_rightpunch_sound, m_sound, and ISoundManager::playSound().

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nodeDug()

void SoundMaker::nodeDug ( MtEvent * e,
void * data )
staticprivate

References NodeDefManager::get(), m_ndef, m_sound, NodeDugEvent::n, ISoundManager::playSound(), and ContentFeatures::sound_dug.

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ playerDamage()

void SoundMaker::playerDamage ( MtEvent * e,
void * data )
staticprivate

References m_sound, and ISoundManager::playSound().

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ playerFallingDamage()

void SoundMaker::playerFallingDamage ( MtEvent * e,
void * data )
staticprivate

References m_sound, and ISoundManager::playSound().

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ playerJump()

void SoundMaker::playerJump ( MtEvent * e,
void * data )
staticprivate

References playPlayerJump().

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ playerRegainGround()

void SoundMaker::playerRegainGround ( MtEvent * e,
void * data )
staticprivate

References playPlayerStep().

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ playPlayerJump()

void SoundMaker::playPlayerJump ( )
private

References m_player_jump_timer, m_sound, and ISoundManager::playSound().

Referenced by playerJump().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ playPlayerStep()

void SoundMaker::playPlayerStep ( )
private

References SoundSpec::exists(), m_player_step_sound, m_player_step_timer, m_sound, makes_footstep_sound, and ISoundManager::playSound().

Referenced by playerRegainGround(), and viewBobbingStep().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerReceiver()

void SoundMaker::registerReceiver ( MtEventManager * mgr)

References MtEvent::CAMERA_PUNCH_LEFT, MtEvent::CAMERA_PUNCH_RIGHT, cameraPunchLeft(), cameraPunchRight(), MtEvent::NODE_DUG, nodeDug(), MtEvent::PLAYER_DAMAGE, MtEvent::PLAYER_FALLING_DAMAGE, MtEvent::PLAYER_JUMP, MtEvent::PLAYER_REGAIN_GROUND, playerDamage(), playerFallingDamage(), playerJump(), playerRegainGround(), MtEventManager::reg(), MtEvent::VIEW_BOBBING_STEP, and viewBobbingStep().

Referenced by Game::initSound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

void SoundMaker::update ( f32 dtime,
bool makes_footstep_sound,
const SoundSpec & sound_footstep )

References m_player_jump_timer, m_player_step_sound, m_player_step_timer, and makes_footstep_sound.

Referenced by Game::updateSound().

+ Here is the caller graph for this function:

◆ viewBobbingStep()

void SoundMaker::viewBobbingStep ( MtEvent * e,
void * data )
staticprivate

References playPlayerStep().

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_ndef

const NodeDefManager* SoundMaker::m_ndef
private

Referenced by nodeDug().

◆ m_player_jump_timer

float SoundMaker::m_player_jump_timer = 0.0f
private

Referenced by playPlayerJump(), and update().

◆ m_player_leftpunch_sound

SoundSpec SoundMaker::m_player_leftpunch_sound

◆ m_player_leftpunch_sound2

SoundSpec SoundMaker::m_player_leftpunch_sound2

◆ m_player_rightpunch_sound

SoundSpec SoundMaker::m_player_rightpunch_sound

◆ m_player_step_sound

SoundSpec SoundMaker::m_player_step_sound
private

Referenced by playPlayerStep(), and update().

◆ m_player_step_timer

float SoundMaker::m_player_step_timer = 0.0f
private

Referenced by playPlayerStep(), and update().

◆ m_sound

◆ makes_footstep_sound

bool SoundMaker::makes_footstep_sound = true
private

Referenced by playPlayerStep(), and update().


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