Dragonfly 4.20
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

◆ Music()

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

SFML doesn't allow music copy.

Member Function Documentation

◆ getLabel()

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

Get label associated with music.

◆ getMusic()

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

Return pointer to SFML music.

◆ loadMusic()

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

Associate music buffer with file.

Return 0 if ok, else -1.

◆ operator=()

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

SFML doesn't allow music assignment.

◆ pause()

void df::Music::pause ( )

Pause music.

◆ play()

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

Play music.

If loop is true, repeat play when done.

◆ setLabel()

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

Set label associated with music.

◆ stop()

void df::Music::stop ( )

Stop music.

Member Data Documentation

◆ m_label

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

Text label to identify music.

◆ m_music

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

The SFML music.