XPMP2
X-Plane multiplayer library 2 - using instancing
|
Encapsulates the XP12 Sound System. More...
#include <Sound.h>
Public Member Functions | |
SoundSystemXP () | |
Construtor, throws exception if XP sound system unavailable (prior to XP12.04) More... | |
~SoundSystemXP () override | |
Destructor. More... | |
bool | LoadSoundFile (const std::string &_sndName, const std::string &_filePath, bool _bLoop, float _coneDir, float _conePitch, float _coneInAngle, float _coneOutAngle, float _coneOutVol) override |
Loads a sound file so it becomes ready to play. More... | |
uint64_t | Play (const std::string &sndName, float vol, const Aircraft &ac) override |
Play a new sound, returns an id for that sound. More... | |
void | Unpause (uint64_t sndId) override |
Unpause a sound, which got started in a paused state to avoid crackling. More... | |
void | Stop (uint64_t sndId) override |
Stop the sound. More... | |
void | SetPosOrientation (uint64_t sndId, const Aircraft &ac, bool bDoOrientation) override |
Update sound's position and orientation. More... | |
void | SetVolume (uint64_t sndId, float vol) override |
Set sound's volume. More... | |
void | SetMute (uint64_t sndId, bool bMute) override |
Mute the sound (temporarily) More... | |
void | Update () override |
Any updates to be done at the end of the frame (not for XP system) More... | |
void | SetMasterVolume (float volMaster) override |
Set Master Volume, effectively a multiplicator to SetVolume() More... | |
void | SetAllMute (bool bMute) override |
Mute all sounds (temporarily) More... | |
Public Member Functions inherited from XPMP2::SoundSystem | |
SoundSystem () | |
Construtor. More... | |
virtual | ~SoundSystem () |
Destructor. More... | |
const char * | EnumerateSounds (const char *prevName, const char **ppFilePath) |
Enumerate all loaded sounds. More... | |
virtual bool | IsValid (uint64_t sndId) |
Is the sound id available? More... | |
Protected Member Functions | |
void | ChnSetVol (const SoundChannel &chn) |
Update an individual channel's volume. More... | |
void | AllChnSetVol () |
Update all channels' volume. More... | |
Protected Member Functions inherited from XPMP2::SoundSystem | |
std::pair< uint64_t, SoundChannel * > | AddChn (SoundFile *pSnd, float vol, FMOD_CHANNEL *pChn=nullptr) |
Add one more channel, returning the newly created id. More... | |
SoundChannel * | GetChn (uint64_t sndId) |
Return the SoundChannel object for a given id, or nullptr if not found. More... | |
void | RemoveChn (uint64_t sndId) |
Remove a channel from out tracking. More... | |
Static Protected Member Functions | |
static void | PlayCallback (void *inRefcon, FMOD_RESULT status) |
Callback required by XPLMPlayPCMOnBus. More... | |
Protected Attributes | |
float | volMaster = 1.0f |
Master volume, effectively a multiplicator for individual volume. More... | |
bool | bAllMuted = false |
All sounds (temporarily) muted? More... | |
Protected Attributes inherited from XPMP2::SoundSystem | |
mapSoundPtrTy | mapSounds |
Map of all sounds, indexed by a sound name (type) More... | |
std::map< uint64_t, SoundChannel > | mapChn |
Keeps track of currently playing sounds, their key serving as id. More... | |
Encapsulates the XP12 Sound System.
Looks for availability of the new XP12.04 sound functions (see XPLMSound.h), and use those for playing sounds. Only PCM16 sounds from memory can be played this way, which means that we need to read WAV
files and load their PCM data to memory.
XPMP2::SoundSystemXP::SoundSystemXP | ( | ) |
Construtor, throws exception if XP sound system unavailable (prior to XP12.04)
|
inlineoverride |
Destructor.
|
protected |
Update all channels' volume.
|
protected |
Update an individual channel's volume.
|
overridevirtual |
Loads a sound file so it becomes ready to play.
WAV
files as we have to read the ourselves Implements XPMP2::SoundSystem.
|
overridevirtual |
Play a new sound, returns an id for that sound.
Implements XPMP2::SoundSystem.
|
staticprotected |
Callback required by XPLMPlayPCMOnBus.
|
overridevirtual |
Mute all sounds (temporarily)
Implements XPMP2::SoundSystem.
|
overridevirtual |
Set Master Volume, effectively a multiplicator to SetVolume()
Implements XPMP2::SoundSystem.
|
overridevirtual |
Mute the sound (temporarily)
Implements XPMP2::SoundSystem.
|
overridevirtual |
Update sound's position and orientation.
Implements XPMP2::SoundSystem.
|
overridevirtual |
Set sound's volume.
Implements XPMP2::SoundSystem.
|
overridevirtual |
Stop the sound.
Implements XPMP2::SoundSystem.
|
overridevirtual |
Unpause a sound, which got started in a paused state to avoid crackling.
Implements XPMP2::SoundSystem.
|
inlineoverridevirtual |
Any updates to be done at the end of the frame (not for XP system)
Implements XPMP2::SoundSystem.
|
protected |
All sounds (temporarily) muted?
|
protected |
Master volume, effectively a multiplicator for individual volume.