TurtleBrains  0.2.1
High quality, portable, C++ API for native application and game development.
TurtleBrains::Audio::AudioController Class Reference

#include <tb_audio_manager.h>

Public Member Functions

 AudioController (const AudioHandle &audioData=kInvalidAudio)
 
 AudioController (const AudioController &other)
 
 ~AudioController (void)
 
void Stop (void)
 
void StopLooping (void)
 
void SetPitch (const float pitch)
 
void SetVolume (const float volume)
 
float GetVolume (void) const
 
bool IsComplete (void) const
 

Friends

class AudioManager
 

Detailed Description

The AudioController may become an AudioEvent or Audio class that allows the controlling of an effect as the AudioChannel and possibly even AudioHandle data may become more hidden. At a minimum there will be some object that gives the ability to Stop, SetVolume and SetPitch if this object changes.

Constructor & Destructor Documentation

TurtleBrains::Audio::AudioController::AudioController ( const AudioHandle audioData = kInvalidAudio)
explicit

Constructs an AudioController, this may change and should be considered an implementation detail of TurtleBrains. Note this class may change drastically in future iterations.

TurtleBrains::Audio::AudioController::AudioController ( const AudioController other)

Constructs an AudioController from another AudioController as a copy constructor would.

TurtleBrains::Audio::AudioController::~AudioController ( void  )

Cleans up and destroys the AudioController, once destroyed the audio channel/sound effect it had been controlling cannot be stopped or modified.

Member Function Documentation

float TurtleBrains::Audio::AudioController::GetVolume ( void  ) const

TODO: TIM: Documentation: Teach the user how to use this.

bool TurtleBrains::Audio::AudioController::IsComplete ( void  ) const

TODO: TIM: Documentation: Teach the user how to use this.

void TurtleBrains::Audio::AudioController::SetPitch ( const float  pitch)

Changes the pitch, 'speed / frequency' of the sound and how it plays. 1.0 plays at normal pitch while 0.5 plays at what seems to be half speed, much slower. 2.0f should be twice as fast as normal.

void TurtleBrains::Audio::AudioController::SetVolume ( const float  volume)

Changes the volume of the sound where 0.0f is silent and 1.0f is full volume. If a value is out of that range it will be clamped to remain in range, so a value of 1.2 will become 1.0.

void TurtleBrains::Audio::AudioController::Stop ( void  )

Abruptly stops the sound or music from playing and to play again call to AudioManager::PlayEvent.

void TurtleBrains::Audio::AudioController::StopLooping ( void  )

Removes a looping flag from the sound so it will continue to play through until it finishes and then stop playing. Does not abruptly stop the sound.