persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
SFXComponent Class Reference

#include <SFXComponent.hpp>

Inheritance diagram for SFXComponent:
Collaboration diagram for SFXComponent:

Public Member Functions

void init () override
void destroy () override
 Automatically stops all SFX audio from playing.
void update (ae::q20_12_t) override
ae::ComponentTypeID getType () const override
void registerSFX (SFX sfx)
 Register the SFX to use.
void playSFX (SFX sfx, int volume=127, int panning=64)
 Play the specified SFX, if registered.
void stopSFX ()
 Stops all SFX audio from playing.

Static Public Attributes

static constexpr ae::ComponentTypeID TYPE_ID = static_cast<ae::ComponentTypeID>(ComponentType::SFX)

Protected Member Functions

void submitToManager () override

Private Attributes

AudioManager & am = AudioManager::getInstance()

Detailed Description

Definition at line 14 of file SFXComponent.hpp.

Member Function Documentation

◆ destroy()

void SFXComponent::destroy ( )
override

Automatically stops all SFX audio from playing.

Definition at line 3 of file SFXComponent.cpp.

Here is the call graph for this function:

◆ getType()

ae::ComponentTypeID SFXComponent::getType ( ) const
inlineoverride

Definition at line 31 of file SFXComponent.hpp.

◆ init()

void SFXComponent::init ( )
inlineoverride

Definition at line 18 of file SFXComponent.hpp.

◆ playSFX()

void SFXComponent::playSFX ( SFX sfx,
int volume = 127,
int panning = 64 )

Play the specified SFX, if registered.

Parameters
sfxthe SFX to play
volumethe volume of the SFX. Range is from 0-127
panningthe direction to play the sound effect (left to right). The range is 0-127 (64 plays both left and right equally)

Definition at line 13 of file SFXComponent.cpp.

Here is the call graph for this function:

◆ registerSFX()

void SFXComponent::registerSFX ( SFX sfx)

Register the SFX to use.

Note
Multiple SFXs can be registered at once
Parameters
sfxthe SFX to register

Definition at line 8 of file SFXComponent.cpp.

◆ stopSFX()

void SFXComponent::stopSFX ( )

Stops all SFX audio from playing.

Definition at line 19 of file SFXComponent.cpp.

Here is the caller graph for this function:

◆ submitToManager()

void SFXComponent::submitToManager ( )
inlineoverrideprotected

Definition at line 60 of file SFXComponent.hpp.

◆ update()

void SFXComponent::update ( ae::q20_12_t )
inlineoverride

Definition at line 27 of file SFXComponent.hpp.

Member Data Documentation

◆ am

AudioManager& SFXComponent::am = AudioManager::getInstance()
private

Definition at line 65 of file SFXComponent.hpp.

◆ TYPE_ID

ae::ComponentTypeID SFXComponent::TYPE_ID = static_cast<ae::ComponentTypeID>(ComponentType::SFX)
staticconstexpr

Definition at line 17 of file SFXComponent.hpp.


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