Lums
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
lm::Sound Class Referenceabstract

An abstract class for sounds. More...

#include <Sound.hpp>

Inheritance diagram for lm::Sound:
lm::Music lm::Sfx

Public Member Functions

void setPath (const std::string name, bool resource=true)
 
void load ()
 
bool loaded ()
 
void unload ()
 
virtual void play (Vector3f pos={0.f, 0.f, 0.f})=0
 
virtual void pause ()=0
 
virtual void stop ()=0
 

Protected Member Functions

void loadFileOGG ()
 
void setVolumeLimits (ALuint *source, ALfloat *maxGain, ALfloat *minGain)
 

Protected Attributes

float volume
 
FILE * file
 
OggVorbis_File stream
 
ALenum format
 
ALsizei sampleRate
 
std::string path
 

Detailed Description

An abstract class for sounds.

Member Function Documentation

void lm::Sound::load ( )

Load the sound

bool lm::Sound::loaded ( )

Check wether the sound is loaded

Returns
true if the sound is loaded, false otherwise
void lm::Sound::loadFileOGG ( )
protected

Load the ogg file and set appropriate fields.

virtual void lm::Sound::pause ( )
pure virtual

Pause the sound

Implemented in lm::Music, and lm::Sfx.

virtual void lm::Sound::play ( Vector3f  pos = {0.f, 0.f, 0.f})
pure virtual

Play a sound

Parameters
posThe source position

Implemented in lm::Music, and lm::Sfx.

void lm::Sound::setPath ( const std::string  name,
bool  resource = true 
)

Set the loading path for the sound

Parameters
nameThe file path
resourceIf true, path is relative to the resource path
void lm::Sound::setVolumeLimits ( ALuint *  source,
ALfloat *  maxGain,
ALfloat *  minGain 
)
protected

Set the volume range

Parameters
sourceThe source to use
maxGainThe maximum gain
minGainThe minimum gain
virtual void lm::Sound::stop ( )
pure virtual

Stop the sound

Implemented in lm::Music, and lm::Sfx.

void lm::Sound::unload ( )

Unload the sound

Member Data Documentation

FILE* lm::Sound::file
protected

The sound file

ALenum lm::Sound::format
protected

The sound format

std::string lm::Sound::path
protected

The fully resolved file path

ALsizei lm::Sound::sampleRate
protected

The sound sample rate

OggVorbis_File lm::Sound::stream
protected

The current sound stream

float lm::Sound::volume
protected

The sound current volume, between 0 and 1


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