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

Public Member Functions

int loadMusic (std::string filename)
 
void setLabel (std::string new_label)
 
std::string getLabel () const
 
void play (bool loop=true)
 
void stop ()
 
void pause ()
 
sf::Music * getMusic ()
 

Private Member Functions

 Music (Music const &)
 
void operator= (Music const &)
 

Private Attributes

sf::Music m_music
 
std::string m_label
 

Constructor & Destructor Documentation

df::Music::Music ( Music const &  )
private

SFML doesn't allow music copy.

Member Function Documentation

std::string df::Music::getLabel ( ) const

Get label associated with music.

sf::Music* df::Music::getMusic ( )

Return pointer to SFML music.

int df::Music::loadMusic ( std::string  filename)

Associate music buffer with file.

Return 0 if ok, else -1.

void df::Music::operator= ( Music const &  )
private

SFML doesn't allow music assignment.

void df::Music::pause ( )

Pause music.

void df::Music::play ( bool  loop = true)

Play music.

If loop is true, repeat play when done.

void df::Music::setLabel ( std::string  new_label)

Set label associated with music.

void df::Music::stop ( )

Stop music.

Member Data Documentation

std::string df::Music::m_label
private

Text label to identify music.

sf::Music df::Music::m_music
private

The SFML music.