ge211
Sound_effect Class Reference

Detailed Description

A sound effect track, which can be attached to a Mixer channel and played.

A sound effect track may be empty or non-empty; only non-empty sound effects can actually be played.

Note that Sound_effect has few public member functions. However, an effect track can be passed to the Mixer member function Mixer::play_effect(Sound_effect, double) to play it.

Definition at line 76 of file ge211_audio.h.

Public Member Functions

 Sound_effect (const std::string &filename, const Mixer &)
 Loads a new sound effect track from a resource file. More...
 
 Sound_effect ()
 Default-constructs the empty sound effect track.
 
bool empty () const
 Recognizes the empty sound effect track.
 
 operator bool () const
 Recognizes a non-empty sound effect track. More...
 

Constructor & Destructor Documentation

◆ Sound_effect()

Sound_effect ( const std::string &  filename,
const Mixer  
)

Loads a new sound effect track from a resource file.

Supported file formats include WAV, MP3, OGG, FLAC, MID, and ABC.

Throws exceptions::File_error if the file cannot be opened, and exceptions::Mixer_error if the file format cannot be understood.

Definition at line 58 of file ge211_audio.cpp.

Member Function Documentation

◆ operator bool()

operator bool ( ) const

Recognizes a non-empty sound effect track.

Equivalent to !empty().

Definition at line 67 of file ge211_audio.cpp.


The documentation for this class was generated from the following files: