Rubeus::AudioComponents::RSymphony class

Manages audio loading, cueing and audio effects.

Base classes

class Rubeus::RMasterComponent
A master component. Serves as parent class for all components.

Constructors, destructors, conversion operators

RSymphony()
Constructor.
~RSymphony()
Destructor.

Public functions

void addSoundTrack(const int count)
Adds sound tracks to be used later to load sound effect files.
void addMusicTrack(const int count)
Adds music tracks to be used later to play music.
void loadTrack(ETrackType trackType, ETrackName trackName, std::string filePath, float volume = 50, bool loopEnabled = false)
Load an audio file to a music track.
void playTrack(ETrackType trackType, ETrackName trackName)
Play a track.
void pauseTrack(ETrackType trackType, ETrackName trackName)
Pause a track.
void stopTrack(ETrackType trackType, ETrackName trackName)
Stop a track.
void stepDownMusicVolume(const float duration, const float floorVolume = 0)
Steps down the volume.
void setVolume(ETrackType trackType, ETrackName trackName, const float volume)
Sets the volume for a track.
void setPitch(ETrackType trackType, ETrackName trackName, const float pitch)
Sets the pitch for a track.
void addToTick(void(*)() function)
Adds a function to be ticked by the audio manager.
void tick()
Ticks the tickable functions added to audio manager.

Function documentation

void Rubeus::AudioComponents::RSymphony::addSoundTrack(const int count)

Adds sound tracks to be used later to load sound effect files.

Parameters
count The number of tracks to be constructed.

void Rubeus::AudioComponents::RSymphony::addMusicTrack(const int count)

Adds music tracks to be used later to play music.

Parameters
count The number of tracks to be constructed.

void Rubeus::AudioComponents::RSymphony::loadTrack(ETrackType trackType, ETrackName trackName, std::string filePath, float volume = 50, bool loopEnabled = false)

Load an audio file to a music track.

Parameters
trackType Type of track. Use SOUND_TRACK or MUSIC_TRACK
trackName Name (Track ID) of the track to load to. Allowed TRACK_0 upto TRACK_19, unless the number of tracks added are less than 20.
filePath Path to the sound file
volume Volume to be set. Default is 50
loopEnabled Whether the music should loop when it ends. Default is false.

void Rubeus::AudioComponents::RSymphony::playTrack(ETrackType trackType, ETrackName trackName)

Play a track.

Parameters
trackType Type of track. Use SOUND_TRACK or MUSIC_TRACK.
trackName Name of track. Use Name (Track ID) of the track to load to. Allowed TRACK_0 upto TRACK_19, unless the number of tracks added are less than 20.

void Rubeus::AudioComponents::RSymphony::pauseTrack(ETrackType trackType, ETrackName trackName)

Pause a track.

Parameters
trackType Type of track. Use SOUND_TRACK or MUSIC_TRACK.
trackName Name of track. Use Name (Track ID) of the track to load to. Allowed TRACK_0 upto TRACK_19, unless the number of tracks added are less than 20.

void Rubeus::AudioComponents::RSymphony::stopTrack(ETrackType trackType, ETrackName trackName)

Stop a track.

Parameters
trackType Type of track. Use SOUND_TRACK or MUSIC_TRACK.
trackName Name of track. Use Name (Track ID) of the track to load to. Allowed TRACK_0 upto TRACK_19, unless the number of tracks added are less than 20.

void Rubeus::AudioComponents::RSymphony::stepDownMusicVolume(const float duration, const float floorVolume = 0)

Steps down the volume.

Parameters
duration Duration of fade effect.
floorVolume Volume to stop the fade effect at.

void Rubeus::AudioComponents::RSymphony::setVolume(ETrackType trackType, ETrackName trackName, const float volume)

Sets the volume for a track.

Parameters
trackType Type of track. Use SOUND_TRACK or MUSIC_TRACK.
trackName Name of track. Use Name (Track ID) of the track to load to. Allowed TRACK_0 upto TRACK_19, unless the number of tracks added are less than 20.
volume The volume to set to.

void Rubeus::AudioComponents::RSymphony::setPitch(ETrackType trackType, ETrackName trackName, const float pitch)

Sets the pitch for a track.

Parameters
trackType Type of track. Use SOUND_TRACK or MUSIC_TRACK.
trackName Name of track. Use Name (Track ID) of the track to load to. Allowed TRACK_0 upto TRACK_19, unless the number of tracks added are less than 20.
pitch The pitch to set to.

void Rubeus::AudioComponents::RSymphony::addToTick(void(*)() function)

Adds a function to be ticked by the audio manager.

Parameters
function Function pointer to be woken up at tick.