Central place to request for musics to be loaded, played, stopped, etc...
More...
#include <music_manager.hpp>
|
MusicInformation * | getMusicInformation (const std::string &filename) |
|
void | addMusicToTracks () |
|
void | startMusic () |
| Special shortcut vor overworld (which skips other phases where the music would normally be started.
|
|
void | startMusic (MusicInformation *mi, bool start_right_now=true) |
| Schedules the indicated music to be played next.
|
|
void | stopMusic () |
| Queues a stop current music event for the audio thread.
|
|
void | pauseMusic () |
| Insert a command into the sfx queue to pause the current music.
|
|
void | resumeMusic () |
| Inserts a resume current music event into the queue.
|
|
void | switchToFastMusic () |
| Switches to fast (last lap ) music (if defined for the current music).
|
|
void | setMasterMusicVolume (float gain) |
| Sets the master music volume.
|
|
void | resetTemporaryVolume () |
| Queues a command for the sfx manager to reset a temporary volume change.
|
|
void | setTemporaryVolume (float gain) |
| Queues a command to temporarily change the volume.
|
|
float | getMasterMusicVolume () const |
| Returns the master volume.
|
|
bool | initialized () const |
| Returns if the music system is initialised.
|
|
MusicInformation * | getCurrentMusic () |
| Returns the information object of the current music.
|
|
void | clearCurrentMusic () |
| Stops and removes the current music.
|
|
|
void | loadMusicInformation () |
|
void | loadMusicFromOneDir (const std::string &dir) |
|
|
std::atomic< MusicInformation * > | m_current_music |
|
bool | m_initialized |
| If the sound could not be initialized, e.g.
|
|
std::map< std::string, MusicInformation * > | m_all_music |
| Stores all music information files (read from the .music files).
|
|
float | m_master_gain |
|
Central place to request for musics to be loaded, played, stopped, etc...
◆ getMusicInformation()
MusicInformation * MusicManager::getMusicInformation |
( |
const std::string & |
filename | ) |
|
- Exceptions
-
runtime_error | if the music file could not be found/opened |
◆ setMasterMusicVolume()
void MusicManager::setMasterMusicVolume |
( |
float |
gain | ) |
|
Sets the master music volume.
- Parameters
-
◆ setTemporaryVolume()
void MusicManager::setTemporaryVolume |
( |
float |
gain | ) |
|
Queues a command to temporarily change the volume.
This is used to make the music a bit quieter while the 'last lap fanfare' is being played.
- Parameters
-
gain | The temporary volume value. |
◆ startMusic()
void MusicManager::startMusic |
( |
MusicInformation * |
mi, |
|
|
bool |
start_right_now = true |
|
) |
| |
Schedules the indicated music to be played next.
- Parameters
-
mi | Music information of the music to be played. |
start_right_now | |
◆ m_initialized
bool MusicManager::m_initialized |
|
private |
If the sound could not be initialized, e.g.
if the player doesn't has a sound card, we want to avoid anything sound related so we crash the game.
The documentation for this class was generated from the following files: