Vigilante Game Framework  1.0.0.8
A 2D/3D C++ Game Framework using SFML.
Public Member Functions | List of all members
VSoundManager Class Reference

A manager for loaded sound effect files. More...

#include <VSoundManager.h>

Public Member Functions

void SetMasterVolume (float volume)
 
void SetMasterPitch (float pitch)
 
float MasterVolume ()
 
float MasterPitch ()
 
bool Load (const sf::String &filename, const sf::String &id)
 
void Play (const sf::String &id, float volume=100.0f, float pitch=1.0f, bool loop=false)
 
sf::SoundStream::Status Status (const sf::String &id)
 
void Stop (const sf::String &id)
 
void StopAll ()
 Stop all sound effects.
 
sf::Sound * GetSound (const sf::String &id)
 
void Cleanup ()
 Cleanup Sound and SoundBuffer lists.
 

Detailed Description

A manager for loaded sound effect files.

Member Function Documentation

◆ GetSound()

sf::Sound* VSoundManager::GetSound ( const sf::String &  id)
Parameters
idThe ID name of the sound.
Returns
The direct sound object for direct manipulation.

◆ Load()

bool VSoundManager::Load ( const sf::String &  filename,
const sf::String &  id 
)

Load sound at set to specific id.

Parameters
filenameThe file path and name of the sound file.
idA simple ID name to assign the file for easier access.
Returns
True if file has been loaded successfully.

◆ MasterPitch()

float VSoundManager::MasterPitch ( )
Returns
The Master Pitch used for all sounds.

◆ MasterVolume()

float VSoundManager::MasterVolume ( )
Returns
The Master Volume used for all sounds.

◆ Play()

void VSoundManager::Play ( const sf::String &  id,
float  volume = 100.0f,
float  pitch = 1.0f,
bool  loop = false 
)

Play sound with specific id, with specified volume and pitch.

Parameters
idA simple ID name to easily access the sound.
volumeThe volume specifically for this sound effect (will use as a percentage of the master volume).
pitchThe pitch specifically for this sound effect (will use as a percentage of the master pitch).
loopIf the sound is looping.

◆ SetMasterPitch()

void VSoundManager::SetMasterPitch ( float  pitch)
Parameters
pitchThe pitch that will be applied to all sound effects (0 will play all sounds at 0 pitch, 2 will play all sounds at double of individual pitch ect)

◆ SetMasterVolume()

void VSoundManager::SetMasterVolume ( float  volume)
Parameters
volumeThe volume that will be applied to all sound effects (0 will mute all sounds, 50 will play all sounds 50% of individual volumes ect)

◆ Status()

sf::SoundStream::Status VSoundManager::Status ( const sf::String &  id)

Get the status of the specific sound.

Returns
Status of the sound. (i.e. Playing, Paused, Stopped).

◆ Stop()

void VSoundManager::Stop ( const sf::String &  id)

Stop sound with specific id (good if sound loops).

Parameters
idA simple ID name to easily access the sound.

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