Module
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Module::AudioInterface Class Referenceabstract

#include <AudioInterface.hpp>

Inheritance diagram for Module::AudioInterface:
Module::ThreadObject

Public Member Functions

 AudioInterface ()
 
virtual SoundplaySound (SoundClip *)
 
virtual SoundplaySound (SoundClip *, float, float)=0
 
virtual SoundCliploadSoundClip (const std::string &, const std::string &)
 
virtual void unloadSoundClip (SoundClip *)=0
 
void debugAudio ()
 

Protected Member Functions

void start ()
 
void run ()
 
virtual void replaySound (Sound *)=0
 
virtual void resumeSound (Sound *)=0
 
virtual void pauseSound (Sound *)=0
 
virtual void stopSound (Sound *)=0
 
virtual void setDevice ()=0
 
virtual void setListener (GameObject *)=0
 
virtual void setFrequency (SoundClip *, unsigned int)
 

Protected Attributes

ModuleGamegame
 
GameObjectlistener
 
Book< Soundsounds
 
Book< SoundClipclips
 

Friends

class Sound
 
class SoundClip
 
class ModuleGame
 

Detailed Description

The AudioInterface is one of Module's four core interfaces, and handles its titular audio. It may be used to load and or play sounds.

Constructor & Destructor Documentation

AudioInterface::AudioInterface ( )

Member Function Documentation

void AudioInterface::debugAudio ( )

A debug method, which prints out information about the current state of game audio.

SoundClip * AudioInterface::loadSoundClip ( const std::string &  name,
const std::string &  fileName 
)
virtual

Loads a SoundClip into memory.

Parameters
nameThe name of the SoundClip, ie: "explosion."
fileNameThe name of the file to be loaded from.
Returns
A pointer to the loaded SoundClip.
virtual void Module::AudioInterface::pauseSound ( Sound )
protectedpure virtual
Sound * AudioInterface::playSound ( SoundClip clip)
virtual

Plays a Sound.

Parameters
clipA pointer to the SoundClip that the Sound will be of.
Returns
A pointer to the Sound, which is currently playing.
virtual Sound* Module::AudioInterface::playSound ( SoundClip ,
float  ,
float   
)
pure virtual
virtual void Module::AudioInterface::replaySound ( Sound )
protectedpure virtual
virtual void Module::AudioInterface::resumeSound ( Sound )
protectedpure virtual
void AudioInterface::run ( )
protectedvirtual
virtual void Module::AudioInterface::setDevice ( )
protectedpure virtual
void AudioInterface::setFrequency ( SoundClip soundClip,
unsigned int  frequency 
)
protectedvirtual

Sets the frequency of a SoundClip.

Parameters
soundClipA pointer to the SoundClip.
frequencyThe frequency of the clip, in Hertz.
virtual void Module::AudioInterface::setListener ( GameObject )
protectedpure virtual
void AudioInterface::start ( )
protected

Starts the thread for run.

virtual void Module::AudioInterface::stopSound ( Sound )
protectedpure virtual
virtual void Module::AudioInterface::unloadSoundClip ( SoundClip )
pure virtual

Friends And Related Function Documentation

friend class ModuleGame
friend
friend class Sound
friend
friend class SoundClip
friend

Member Data Documentation

Book<SoundClip> Module::AudioInterface::clips
protected

The collection of all loaded sounds

ModuleGame* Module::AudioInterface::game
protected

The game that this is a part of

GameObject* Module::AudioInterface::listener
protected

The listener GameObject

Book<Sound> Module::AudioInterface::sounds
protected

The collection of all playing sounds