#include <musicmanager.h>
Inherits Task.
Inheritance diagram for MusicManager:


Public Member Functions | |
| MusicManager () | |
| ~MusicManager () | |
| void | init (ISoundMusic *ism) |
| Init system for music playing. | |
| void | loadList (std::string file) |
| Load music file list. | |
| void | stop () |
| Stop playing currently played music (if any). | |
| void | play () |
| Start playing music. | |
| virtual void | update (int atime) |
| Check if music is still playing. | |
Private Attributes | |
| std::vector< std::string > | mFiles |
| ISoundMusic * | mISMusic |
| files to play | |
| bool | mPlay |
Music manager is usefull if you have list if music files and want randomly play from the list. The music manager is also task - it should be registered as main application task. It needs to be task since it check if the music stop playing and in such case select a new music to play.
Definition at line 21 of file musicmanager.h.
|
|
Definition at line 12 of file musicmanager.cpp. |
|
|
Definition at line 18 of file musicmanager.cpp. |
|
|
Init system for music playing.
Definition at line 23 of file musicmanager.cpp. References mISMusic. |
|
|
Load music file list. Load XML file containing list of music files. The currently playing music (if any) is stopped and new music is started (if music should be playing).
Definition at line 28 of file musicmanager.cpp. References TiXmlElement::Attribute(), TiXmlHandle::Element(), TiXmlHandle::FirstChild(), TiXmlDocument::LoadFile(), LOGD, LOGE, mFiles, and TiXmlNode::NextSiblingElement(). Here is the call graph for this function: ![]() |
|
|
Start playing music.
Definition at line 74 of file musicmanager.cpp. References mPlay, and update(). Here is the call graph for this function: ![]() |
|
|
Stop playing currently played music (if any).
Definition at line 68 of file musicmanager.cpp. References mISMusic, mPlay, and ISoundMusic::stop(). Here is the call graph for this function: ![]() |
|
|
Check if music is still playing. If the music stoped playing and should be playing, new file from music file list is loaded and is played. Reimplemented from Task. Definition at line 81 of file musicmanager.cpp. References ISoundMusic::isPlaying(), locateFile(), mFiles, mISMusic, mPlay, and ISoundMusic::play(). Referenced by play(). Here is the call graph for this function: ![]() |
|
|
Definition at line 67 of file musicmanager.h. Referenced by loadList(), and update(). |
|
|
files to play
Definition at line 69 of file musicmanager.h. Referenced by init(), MusicManager(), stop(), and update(). |
|
|
Definition at line 71 of file musicmanager.h. Referenced by MusicManager(), play(), stop(), and update(). |
1.4.5