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

#include <MusicComponent.hpp>

Inheritance diagram for MusicComponent:
Collaboration diagram for MusicComponent:

Public Member Functions

void init () override
void destroy () override
 Automatically deregisters the currently registered music, if any.
void update (ae::q20_12_t) override
ae::ComponentTypeID getType () const override
template<typename AudioID>
void registerMusic (AudioType type, AudioID audioId)
 Wrapper to set up the music to play.
void playMusic ()
 Play the registered song if currently paused.
void pauseMusic ()
 Pause the registered song if currently playing.
void stopMusic ()
 Deregister the currently registered music.

Static Public Attributes

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

Protected Member Functions

void submitToManager () override

Private Member Functions

void registerMusic (AudioType type, int audioId)
 Implementation to set up the music to play.

Private Attributes

AudioManager & am = AudioManager::getInstance()

Detailed Description

Definition at line 13 of file MusicComponent.hpp.

Member Function Documentation

◆ destroy()

void MusicComponent::destroy ( )
override

Automatically deregisters the currently registered music, if any.

Definition at line 6 of file MusicComponent.cpp.

Here is the call graph for this function:

◆ getType()

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

Definition at line 30 of file MusicComponent.hpp.

◆ init()

void MusicComponent::init ( )
inlineoverride

Definition at line 17 of file MusicComponent.hpp.

◆ pauseMusic()

void MusicComponent::pauseMusic ( )

Pause the registered song if currently playing.

Definition at line 31 of file MusicComponent.cpp.

◆ playMusic()

void MusicComponent::playMusic ( )

Play the registered song if currently paused.

Definition at line 26 of file MusicComponent.cpp.

◆ registerMusic() [1/2]

template<typename AudioID>
void MusicComponent::registerMusic ( AudioType type,
AudioID audioId )
inline

Wrapper to set up the music to play.

Note
Can only register one music track
Parameters
typethe audio type
audioIdthe specific audio to play

Definition at line 43 of file MusicComponent.hpp.

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

◆ registerMusic() [2/2]

void MusicComponent::registerMusic ( AudioType type,
int audioId )
private

Implementation to set up the music to play.

Note
Can only register one music track
Parameters
typethe audio type
audioIdthe specific audio to play

Definition at line 11 of file MusicComponent.cpp.

Here is the call graph for this function:

◆ stopMusic()

void MusicComponent::stopMusic ( )

Deregister the currently registered music.

Definition at line 36 of file MusicComponent.cpp.

Here is the caller graph for this function:

◆ submitToManager()

void MusicComponent::submitToManager ( )
inlineoverrideprotected

Definition at line 64 of file MusicComponent.hpp.

◆ update()

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

Definition at line 26 of file MusicComponent.hpp.

Member Data Documentation

◆ am

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

Definition at line 69 of file MusicComponent.hpp.

◆ TYPE_ID

ae::ComponentTypeID MusicComponent::TYPE_ID = static_cast<ae::ComponentTypeID>(ComponentType::Music)
staticconstexpr

Definition at line 16 of file MusicComponent.hpp.


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