Loading...
Searching...
No Matches
CALSound Class Reference
Inheritance diagram for CALSound:
[legend]

## Public Member Functions

bool | Create () override
void | Reset () override
bool | Cache (SoundType, const std::string &) override
void | CacheMusic (const std::string &) override
bool | IsCached (SoundType) 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 (SoundType sound, float amplitude=1.0f, float frequency=1.0f, bool loop=false) override
int | Play (SoundType sound, const Math::Vector &pos, float amplitude=1.0f, float frequency=1.0f, bool loop=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 mute) override
void | PlayMusic (const std::string &filename, bool repeat, float fadeTime=2.0f) override
void | StopMusic (float fadeTime=2.0f) override
bool | IsPlayingMusic () override
void | PlayPauseMusic (const std::string &filename, bool repeat) override
void | StopPauseMusic () override
Public Member Functions inherited from CSoundInterface
void | CacheAll ()

## Member Function Documentation

## Create()

bool CALSound::Create | ( |  | ) |

override virtual

Function to initialize sound device

Reimplemented from CSoundInterface.

## Reset()

void CALSound::Reset | ( |  | ) |

override virtual

Stop all sounds and music and clean cache.

Reimplemented from CSoundInterface.

## Cache()

bool CALSound::Cache | ( | SoundType | sound,
|  | const std::string & | file )

override virtual

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

Parameters

  sound | - id of a file, will be used to identify sound files
  file | - file to load

Returns
  return true on success

Reimplemented from CSoundInterface.

## CacheMusic()

void CALSound::CacheMusic | ( | const std::string & | file | ) |

override virtual

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

Parameters

  file | - file to load

Reimplemented from CSoundInterface.

## IsCached()

bool CALSound::IsCached | ( | SoundType | sound | ) |

override virtual

Function to check if sound effect file was cached.

Parameters

  sound | - id of a sound effect file

Returns
  return true if the file was cached

Reimplemented from CSoundInterface.

## IsCachedMusic()

bool CALSound::IsCachedMusic | ( | const std::string & | file | ) |

override virtual

Function called to check if music file was cached.

Parameters

  file | - file to check

Returns
  return true if the file was cached

Reimplemented from CSoundInterface.

## GetEnable()

bool CALSound::GetEnable | ( |  | ) |

override virtual

Return if plugin is enabled

Returns
  return true if plugin is enabled

Reimplemented from CSoundInterface.

## SetAudioVolume()

void CALSound::SetAudioVolume | ( | int | volume | ) |

override virtual

Change global sound volume

Parameters

  volume | - range from 0 to MAXVOLUME

Reimplemented from CSoundInterface.

## GetAudioVolume()

int CALSound::GetAudioVolume | ( |  | ) |

override virtual

Return global sound volume

Returns
  global volume as int in range from 0 to MAXVOLUME

Reimplemented from CSoundInterface.

## SetMusicVolume()

void CALSound::SetMusicVolume | ( | int | volume | ) |

override virtual

Set music volume

Parameters

  volume | - range from 0 to MAXVOLUME

Reimplemented from CSoundInterface.

## GetMusicVolume()

int CALSound::GetMusicVolume | ( |  | ) |

override virtual

Return music volume

Returns
  music volume as int in range from 0 to MAXVOLUME

Reimplemented from CSoundInterface.

## SetListener()

void CALSound::SetListener | ( | const Math::Vector & | eye,
|  | const Math::Vector & | lookat )

override virtual

Set listener position

Parameters

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

Reimplemented from CSoundInterface.

## FrameMove()

void CALSound::FrameMove | ( | float | rTime | ) |

override virtual

Update data each frame

Parameters

  rTime | - time since last update

Reimplemented from CSoundInterface.

## Play() [1/2]

int CALSound::Play | ( | SoundType | sound,
|  | float | amplitude = 1.0f,
|  | float | frequency = 1.0f,
|  | bool | loop = false )

override 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)
  loop | - loop sound

Returns
  identifier of channel that sound will be played on

Reimplemented from CSoundInterface.

## Play() [2/2]

int CALSound::Play | ( | SoundType | sound,
|  | const Math::Vector & | pos,
|  | float | amplitude = 1.0f,
|  | float | frequency = 1.0f,
|  | bool | loop = false )

override 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)
  loop | - loop sound

Returns
  identifier of channel that sound will be played on

Reimplemented from CSoundInterface.

## FlushEnvelope()

bool CALSound::FlushEnvelope | ( | int | channel | ) |

override 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.

## AddEnvelope()

bool CALSound::AddEnvelope | ( | int | channel,
|  | float | amplitude,
|  | float | frequency,
|  | float | time,
|  | SoundNext | oper )

override 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.

## Position()

bool CALSound::Position | ( | int | channel,
|  | const Math::Vector & | pos )

override 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.

## Frequency()

bool CALSound::Frequency | ( | int | channel,
|  | float | frequency )

override virtual

Set sound frequency

Parameters

  channel | - channel to work on
  frequency | - change sound frequency

Returns
  return true on success

Reimplemented from CSoundInterface.

## Stop()

bool CALSound::Stop | ( | int | channel | ) |

override virtual

Stop playing sound

Parameters

  channel | - channel to work on

Returns
  return true on success

Reimplemented from CSoundInterface.

## StopAll()

bool CALSound::StopAll | ( |  | ) |

override virtual

Stop playing all sounds

Returns
  return true on success

Reimplemented from CSoundInterface.

## MuteAll()

bool CALSound::MuteAll | ( | bool | mute | ) |

override virtual

Mute/unmute all sounds

Parameters

  mute |

Returns
  return true on success

Reimplemented from CSoundInterface.

## PlayMusic()

void CALSound::PlayMusic | ( | const std::string & | filename,
|  | bool | repeat,
|  | float | fadeTime = 2.0f )

override virtual

Start playing music This function is executed asynchronously

Parameters

  filename | - name of file to play
  repeat | - repeat playing
  fadeTime | - time of transition between music, 0 to disable

Reimplemented from CSoundInterface.

## StopMusic()

void CALSound::StopMusic | ( | float | fadeTime = 2.0f | ) |

override virtual

Stop playing music

Returns
  nothing

Reimplemented from CSoundInterface.

## IsPlayingMusic()

bool CALSound::IsPlayingMusic | ( |  | ) |

override virtual

Check if music if playing

Returns
  return true if music is playing

Reimplemented from CSoundInterface.

## PlayPauseMusic()

void CALSound::PlayPauseMusic | ( | const std::string & | filename,
|  | bool | repeat )

override virtual

Start playing pause music This function is executed asynchronously

Parameters

  filename | - name of file to play
  repeat | - repeat playing

Returns
  return true on success

Reimplemented from CSoundInterface.

## StopPauseMusic()

void CALSound::StopPauseMusic | ( |  | ) |

override virtual

Stop playing pause music and return to the mission music

Returns
  nothing

Reimplemented from CSoundInterface.

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

- src/sound/oalsound/alsound.h
- src/sound/oalsound/alsound.cpp