Dragonfly  4.3
A text-based game engine
Public Member Functions | Private Attributes | List of all members
df::Sound Class Reference

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_sound
 
sf::SoundBuffer m_sound_buffer
 
std::string m_label
 

Member Function Documentation

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.

Member Data Documentation

std::string df::Sound::m_label
private

Text label to identify sound.

sf::Sound df::Sound::m_sound
private

SFML sound.

sf::SoundBuffer df::Sound::m_sound_buffer
private

SFML sound buffer associated with sound.