A manager for loaded sound effect files.
More...
#include <VSoundManager.h>
|
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.
|
|
A manager for loaded sound effect files.
◆ GetSound()
sf::Sound* VSoundManager::GetSound |
( |
const sf::String & |
id | ) |
|
- Parameters
-
id | The 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
-
filename | The file path and name of the sound file. |
id | A 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
-
id | A simple ID name to easily access the sound. |
volume | The volume specifically for this sound effect (will use as a percentage of the master volume). |
pitch | The pitch specifically for this sound effect (will use as a percentage of the master pitch). |
loop | If the sound is looping. |
◆ SetMasterPitch()
void VSoundManager::SetMasterPitch |
( |
float |
pitch | ) |
|
- Parameters
-
pitch | The 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
-
volume | The 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
-
id | A simple ID name to easily access the sound. |
The documentation for this class was generated from the following file: