Thrive
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
thrive::Sound Class Reference

Represents a single sound. More...

#include <sound_source_system.h>

Classes

struct  Properties
 Sound properties. More...
 

Public Types

enum  PlayState { Play, Pause, Stop }
 Play mode of the sound.
 

Public Member Functions

 Sound ()
 Default constructor for loading.
 
 Sound (std::string name, std::string filename)
 Constructor. More...
 
std::string filename () const
 The file that the sound is playing. More...
 
void load (const StorageContainer &storage)
 Loads a sound from storage. More...
 
std::string name () const
 The name of the sound. More...
 
void pause ()
 Pauses the sound during the next frame.
 
void play ()
 Starts (or resumes) playing the sound.
 
void stop ()
 Stops the sound during the next frame.
 
StorageContainer storage () const
 Constructs a storage container for serialization. More...
 

Static Public Member Functions

static luabind::scope luaBindings ()
 Lua bindings. More...
 

Public Attributes

Properties m_properties
 Properties.
 
SoundEmitter * m_sound = nullptr
 Pointer to internal sound.
 

Detailed Description

Represents a single sound.

Constructor & Destructor Documentation

Sound::Sound ( std::string  name,
std::string  filename 
)

Constructor.

Parameters
nameThe name of the sound (must be unique)
filenameThe name of the sound file

Member Function Documentation

std::string Sound::filename ( ) const

The file that the sound is playing.

Returns
void Sound::load ( const StorageContainer &  storage)

Loads a sound from storage.

Parameters
storage
luabind::scope Sound::luaBindings ( )
static

Lua bindings.

Exposes:

Returns
std::string Sound::name ( ) const

The name of the sound.

Returns
StorageContainer Sound::storage ( ) const

Constructs a storage container for serialization.

Returns

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