|
SuperTuxKart
|
Central place to request for musics to be loaded, played, stopped, etc... More...
#include <music_manager.hpp>

Public Member Functions | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. | |
Private Member Functions | |
| void | loadMusicInformation () |
| void | loadMusicFromOneDir (const std::string &dir) |
Private Attributes | |
| std::atomic< MusicInformation * > | m_current_music |
| bool | m_initialized |
| If the sound could not be initialized, e.g. More... | |
| std::map< std::string, MusicInformation * > | m_all_music |
| Stores all music information files (read from the .music files). | |
| float | m_master_gain |
Friends | |
| class | MusicInformation |
Central place to request for musics to be loaded, played, stopped, etc...
| MusicInformation * MusicManager::getMusicInformation | ( | const std::string & | filename | ) |
| runtime_error | if the music file could not be found/opened |
| void MusicManager::setMasterMusicVolume | ( | float | gain | ) |
Sets the master music volume.
| gain | The volume. |
| 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.
| gain | The temporary volume value. |
| void MusicManager::startMusic | ( | MusicInformation * | mi, |
| bool | start_right_now = true |
||
| ) |
Schedules the indicated music to be played next.
| mi | Music information of the music to be played. |
| start_right_now |
|
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.