Wrapper around an instance of the Music interface Adds information like composer, song title, etc...
More...
#include <music_information.hpp>
|
|
void | addMusicToTracks () |
| |
|
bool | isPlaying () const |
| |
|
const stringw & | getComposer () const |
| | Returns the composer of the music.
|
| |
|
const stringw & | getTitle () const |
| | Returns the title of the music.
|
| |
|
const std::string & | getNormalFilename () const |
| | Returns the filename of the normal speed music.
|
| |
|
const std::string & | getFastFilename () const |
| | If available, returns the file name of the faster/last-lap music.
|
| |
|
| static MusicInformation * | create (const std::string &filename) |
| | A simple factory to create music information files without raising an exception on error, instead a NULL will be returned. More...
|
| |
|
|
| MusicInformation (const XMLNode *root, const std::string &filename) |
| |
|
void | update (float dt) |
| |
|
void | startMusic () |
| | Starts the music.
|
| |
|
void | stopMusic () |
| |
|
void | pauseMusic () |
| |
|
void | resumeMusic () |
| |
|
void | setDefaultVolume () |
| |
|
void | switchToFastMusic () |
| | If there is a fast music available, switch to it.
|
| |
| void | setTemporaryVolume (float volume) |
| | Overwrites the current volume with a temporary value (used e.g. More...
|
| |
|
bool | preStart () |
| | Return false if it should not be started, done in sfx thread.
|
| |
| void | setMusicWaiting () |
| | Sets the music to be waiting, i.e. More...
|
| |
|
|
stringw | m_composer |
| |
|
stringw | m_title |
| |
|
std::string | m_normal_filename |
| |
|
std::string | m_fast_filename |
| |
|
std::vector< std::string > | m_all_tracks |
| |
|
bool | m_music_waiting |
| | If music is loaded but hasn't been started yet (MusicManager::startMusic() was told not to start right away).
|
| |
|
bool | m_enable_fast |
| | If faster music is enabled at all.
|
| |
|
float | m_gain |
| |
|
float | m_normal_loop_start |
| |
|
float | m_fast_loop_start |
| |
|
float | m_normal_loop_end |
| |
|
float | m_fast_loop_end |
| |
|
float | m_faster_time |
| | Time for fading faster music in.
|
| |
|
float | m_temporary_volume |
| |
|
std::mutex | m_music_mutex |
| |
|
Music * | m_normal_music |
| |
|
Music * | m_fast_music |
| |
|
enum MusicInformation:: { ... } | m_mode |
| | < playing faster music
|
| |
|
float | m_time_since_faster |
| |
|
|
static const int | LOOP_FOREVER =-1 |
| |
Wrapper around an instance of the Music interface Adds information like composer, song title, etc...
Delegates many calls to the underlying Music instance.
◆ anonymous enum
| Enumerator |
|---|
| SOUND_NORMAL | normal music is played
|
| SOUND_FADING | normal music fading out, faster fading in
|
◆ create()
A simple factory to create music information files without raising an exception on error, instead a NULL will be returned.
This avoids resource freeing problems if the exception is raised, and simplifies calling code.
- Parameters
-
| filename | The name of a music file. |
- Returns
- The MusicInformation object, or NULL in case of an error.
◆ setMusicWaiting()
| void MusicInformation::setMusicWaiting |
( |
| ) |
|
|
inlineprivate |
Sets the music to be waiting, i.e.
startMusic still needs to be called. Used to pre-load track music during track loading time.
◆ setTemporaryVolume()
| void MusicInformation::setTemporaryVolume |
( |
float |
volume | ) |
|
|
private |
Overwrites the current volume with a temporary value (used e.g.
to fade from normal music to last lap music).
The documentation for this class was generated from the following files: