![]() |
Dragonfly 4.22
A text-based game engine
|
Public Member Functions | |
| int | loadSound (std::string filename) |
| void | setLabel (std::string new_label) |
| std::string | getLabel () const |
| void | play (bool loop=false) |
| void | stop () |
| void | pause () |
| sf::Sound | getSound () const |
Private Attributes | |
| sf::Sound * | m_p_sound |
| sf::SoundBuffer | m_sound_buffer |
| std::string | m_label |
| std::string df::Sound::getLabel | ( | ) | const |
Get label associated with sound.
| sf::Sound df::Sound::getSound | ( | ) | const |
Return SFML sound.
| int df::Sound::loadSound | ( | std::string | filename | ) |
Load sound buffer from file.
Return 0 if ok, else -1.
| void df::Sound::pause | ( | ) |
Pause sound.
| void df::Sound::play | ( | bool | loop = false | ) |
Play sound.
If loop is true, repeat play when done.
| void df::Sound::setLabel | ( | std::string | new_label | ) |
Set label associated with sound.
| void df::Sound::stop | ( | ) |
Stop sound.
|
private |
Text label to identify sound.
|
private |
SFML sound.
|
private |
SFML sound buffer associated with sound.