Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
ALSound Class Reference
Inheritance diagram for ALSound:
Inheritance graph
[legend]

Public Member Functions

bool Create () OVERRIDE
 
bool Cache (Sound, const std::string &) OVERRIDE
 
bool CacheMusic (const std::string &) OVERRIDE
 
bool IsCached (Sound) OVERRIDE
 
bool IsCachedMusic (const std::string &) OVERRIDE
 
bool GetEnable () OVERRIDE
 
void SetAudioVolume (int volume) OVERRIDE
 
int GetAudioVolume () OVERRIDE
 
void SetMusicVolume (int volume) OVERRIDE
 
int GetMusicVolume () OVERRIDE
 
void SetListener (const Math::Vector &eye, const Math::Vector &lookat) OVERRIDE
 
void FrameMove (float rTime) OVERRIDE
 
int Play (Sound sound, float amplitude=1.0f, float frequency=1.0f, bool bLoop=false) OVERRIDE
 
int Play (Sound sound, const Math::Vector &pos, float amplitude=1.0f, float frequency=1.0f, bool bLoop=false) OVERRIDE
 
bool FlushEnvelope (int channel) OVERRIDE
 
bool AddEnvelope (int channel, float amplitude, float frequency, float time, SoundNext oper) OVERRIDE
 
bool Position (int channel, const Math::Vector &pos) OVERRIDE
 
bool Frequency (int channel, float frequency) OVERRIDE
 
bool Stop (int channel) OVERRIDE
 
bool StopAll () OVERRIDE
 
bool MuteAll (bool bMute) OVERRIDE
 
bool PlayMusic (int rank, bool bRepeat, float fadeTime=2.0f) OVERRIDE
 
bool PlayMusic (const std::string &filename, bool bRepeat, float fadeTime=2.0f) OVERRIDE
 
bool RestartMusic () OVERRIDE
 
void SuspendMusic () OVERRIDE
 
void StopMusic (float fadeTime=2.0f) OVERRIDE
 
bool IsPlayingMusic () OVERRIDE
 
bool PlayPauseMusic (const std::string &filename, bool repeat) OVERRIDE
 
void StopPauseMusic () OVERRIDE
 
- Public Member Functions inherited from CSoundInterface
void CacheAll ()
 
void AddMusicFiles ()
 

Member Function Documentation

bool ALSound::AddEnvelope ( int  channel,
float  amplitude,
float  frequency,
float  time,
SoundNext  oper 
)
virtual

Add envelope to sound. Envelope is a operatino that will be performend on sound in future like changing frequency

Parameters
channel- channel to work on
amplitude- change amplitude
frequency- change frequency
time- when to change (sample time)
oper- operation to perform
Returns
return true on success

Reimplemented from CSoundInterface.

bool ALSound::Cache ( Sound  bSound,
const std::string &  bFile 
)
virtual

Function called to cache sound effect file. This function is called by plugin interface for each file.

Parameters
bSound- id of a file, will be used to identify sound files
bFile- file to load
Returns
return true on success

Reimplemented from CSoundInterface.

bool ALSound::CacheMusic ( const std::string &  bFile)
virtual

Function called to cache music file. This function is called by CRobotMain for each file used in the mission.

Parameters
bFile- file to load
Returns
return true on success

Reimplemented from CSoundInterface.

bool ALSound::Create ( )
virtual

Function to initialize sound device

Reimplemented from CSoundInterface.

bool ALSound::FlushEnvelope ( int  channel)
virtual

Remove all operations that would be made on sound in channel.

Parameters
channel- channel to work on
Returns
return true on success

Reimplemented from CSoundInterface.

void ALSound::FrameMove ( float  rTime)
virtual

Update data each frame

Parameters
rTime- time since last update

Reimplemented from CSoundInterface.

bool ALSound::Frequency ( int  channel,
float  frequency 
)
virtual

Set sound frequency

Parameters
channel- channel to work on
frequency- change sound frequency
Returns
return true on success

Reimplemented from CSoundInterface.

int ALSound::GetAudioVolume ( )
virtual

Return global sound volume

Returns
global volume as int in range from 0 to MAXVOLUME

Reimplemented from CSoundInterface.

bool ALSound::GetEnable ( )
virtual

Return if plugin is enabled

Returns
return true if plugin is enabled

Reimplemented from CSoundInterface.

int ALSound::GetMusicVolume ( )
virtual

Return music volume

Returns
music volume as int in range from 0 to MAXVOLUME

Reimplemented from CSoundInterface.

bool ALSound::IsCached ( Sound  bSound)
virtual

Function to check if sound effect file was cached.

Parameters
bSound- id of a sound effect file
Returns
return true if the file was cached

Reimplemented from CSoundInterface.

bool ALSound::IsCachedMusic ( const std::string &  bFile)
virtual

Function called to check if music file was cached.

Parameters
bFile- file to check
Returns
return true if the file was cached

Reimplemented from CSoundInterface.

bool ALSound::IsPlayingMusic ( )
virtual

Check if music if playing

Returns
return true if music is playing

Reimplemented from CSoundInterface.

bool ALSound::MuteAll ( bool  bMute)
virtual

Mute/unmute all sounds

Parameters
bMute
Returns
return true on success

Reimplemented from CSoundInterface.

int ALSound::Play ( Sound  sound,
float  amplitude = 1.0f,
float  frequency = 1.0f,
bool  bLoop = false 
)
virtual

Play specific sound

Parameters
sound- sound to play
amplitude- change amplitude of sound before playing
frequency- change sound frequency before playing (0.5 octave down, 2.0 octave up)
bLoop- loop sound
Returns
identifier of channel that sound will be played on

Reimplemented from CSoundInterface.

int ALSound::Play ( Sound  sound,
const Math::Vector pos,
float  amplitude = 1.0f,
float  frequency = 1.0f,
bool  bLoop = false 
)
virtual

Play specific sound

Parameters
sound- sound to play
pos- position of sound in space
amplitude- change amplitude of sound before playing
frequency- change sound frequency before playing (0.5 octave down, 2.0 octave up)
bLoop- loop sound
Returns
identifier of channel that sound will be played on

Reimplemented from CSoundInterface.

bool ALSound::PlayMusic ( int  rank,
bool  bRepeat,
float  fadeTime = 2.0f 
)
virtual

Start playing music

Parameters
rank- track number
bRepeat- repeat playing
fadeTime- time of transition between music
Returns
return true on success

Reimplemented from CSoundInterface.

bool ALSound::PlayMusic ( const std::string &  filename,
bool  bRepeat,
float  fadeTime = 2.0f 
)
virtual

Start playing music

Parameters
filename- name of file to play
bRepeat- repeat playing
fadeTime- time of transition between music
Returns
return true on success

Reimplemented from CSoundInterface.

bool ALSound::PlayPauseMusic ( const std::string &  filename,
bool  repeat 
)
virtual

Start playing pause music

Parameters
filename- name of file to play
Returns
return true on success

Reimplemented from CSoundInterface.

bool ALSound::Position ( int  channel,
const Math::Vector pos 
)
virtual

Set sound position in space

Parameters
channel- channel to work on
pos- new positino of a sound
Returns
return true on success

Reimplemented from CSoundInterface.

bool ALSound::RestartMusic ( )
virtual

Restart music

Returns
return true on success

Reimplemented from CSoundInterface.

void ALSound::SetAudioVolume ( int  volume)
virtual

Change global sound volume

Parameters
volume- range from 0 to MAXVOLUME

Reimplemented from CSoundInterface.

void ALSound::SetListener ( const Math::Vector eye,
const Math::Vector lookat 
)
virtual

Set listener position

Parameters
eye- position of listener
lookat- direction listener is looking at

Reimplemented from CSoundInterface.

void ALSound::SetMusicVolume ( int  volume)
virtual

Set music volume

Parameters
volume- range from 0 to MAXVOLUME

Reimplemented from CSoundInterface.

bool ALSound::Stop ( int  channel)
virtual

Stop playing sound

Parameters
channel- channel to work on
Returns
return true on success

Reimplemented from CSoundInterface.

bool ALSound::StopAll ( )
virtual

Stop playing all sounds

Returns
return true on success

Reimplemented from CSoundInterface.

void ALSound::StopMusic ( float  fadeTime = 2.0f)
virtual

Stop playing music

Returns
nothing

Reimplemented from CSoundInterface.

void ALSound::StopPauseMusic ( )
virtual

Stop playing pause music and return to the mission music

Returns
nothing

Reimplemented from CSoundInterface.

void ALSound::SuspendMusic ( )
virtual

Susspend playing music

Returns
nothing

Reimplemented from CSoundInterface.


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