|
XPMP2
X-Plane multiplayer library 2 - using instancing
|
Encapsulates direct access to the FMOD Sound System. More...
#include <SoundFMOD.h>
Inheritance diagram for XPMP2::SoundSystemFMOD:Public Member Functions | |
| SoundSystemFMOD () | |
| Construtor, throws exception if FMOD sound system cannot be initialized. More... | |
| ~SoundSystemFMOD () 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... | |
| bool | UsePreV2Fmod () |
| Use pre-v2 FMOD version structures? More... | |
| FMOD_SYSTEM * | GetSys () const |
| Return the FMOD sound system. More... | |
| unsigned int | GetVer () const |
| Return the FMOD version. More... | |
| void | SoundLogEnable (bool bEnable=true) |
| Enables/disables FMOD logging. 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. More... | |
| void | SetMasterVolume (float volMaster) override |
| Set Master Volume on our channel group. More... | |
| void | SetAllMute (bool bMute) override |
| Mute all sounds (temporarily) More... | |
| bool | IsValid (uint64_t sndId) override |
| Is the sound id available? 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... | |
Protected Member Functions | |
| void | SetLowPassGain (bool bOn) |
| Set low pass gain on all active sounds. More... | |
| template<class T_ADVSET > | |
| void | SoundSetFmodSettings (T_ADVSET &advSet) |
| Helper functon to set FMOD settings. 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 FMOD_RESULT F_CALLBACK | ChnCB (FMOD_CHANNELCONTROL *channelcontrol, FMOD_CHANNELCONTROL_TYPE controltype, FMOD_CHANNELCONTROL_CALLBACK_TYPE callbacktype, void *commanddata1, void *commanddata2) |
| Callback function for when sound ends, allows for internal bookkeeping. More... | |
| static FMOD_RESULT F_CALLBACK | SoundLogCB (FMOD_DEBUG_FLAGS flags, const char *file, int line, const char *func, const char *message) |
| Callback function called by FMOD for logging purposes. More... | |
| static uint64_t | GetSndId (FMOD_CHANNEL *pFmodChn) |
| Read SoundChannel from FMOD Channel's user data. More... | |
Protected Attributes | |
| FMOD_SYSTEM * | pFmodSystem = nullptr |
| FMOD system. More... | |
| unsigned int | fmodVer = 0 |
| FMOD version. More... | |
| FMOD_CHANNELGROUP * | pChnGrp = nullptr |
| Our channel group that we place everything under. More... | |
| bool | bLowPass = false |
| Low Pass filter currently active? 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... | |
Static Protected Attributes | |
| static SoundSystemFMOD * | me = nullptr |
| static pointer to myself More... | |
Encapsulates direct access to the FMOD Sound System.
| XPMP2::SoundSystemFMOD::SoundSystemFMOD | ( | ) |
Construtor, throws exception if FMOD sound system cannot be initialized.
FMOD 1.08.30 version of FMOD_ADVANCEDSETTINGS
|
override |
Destructor.
|
staticprotected |
Callback function for when sound ends, allows for internal bookkeeping.
|
staticprotected |
Read SoundChannel from FMOD Channel's user data.
|
inline |
Return the FMOD sound system.
|
inline |
Return the FMOD version.
|
overridevirtual |
Is the sound id available?
Reimplemented from XPMP2::SoundSystem.
|
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.
|
overridevirtual |
Mute all sounds (temporarily)
Implements XPMP2::SoundSystem.
|
protected |
Set low pass gain on all active sounds.
|
overridevirtual |
Set Master Volume on our channel group.
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.
|
staticprotected |
Callback function called by FMOD for logging purposes.
XPLMDebugString(), but so far it didn't hurt, and it should be debug builds only anyway. | void XPMP2::SoundSystemFMOD::SoundLogEnable | ( | bool | bEnable = true | ) |
Enables/disables FMOD logging.
L versions of the FMOD library
|
protected |
Helper functon to set FMOD settings.
Implemented as template function so it works with both FMOD_ADVANCEDSETTINGS and FMOD_10830_ADVANCEDSETTINGS for backwards compatibility with v1.8 of FMOD as used in XP11.
|
overridevirtual |
Stop the sound.
Implements XPMP2::SoundSystem.
|
overridevirtual |
Unpause a sound, which got started in a paused state to avoid crackling.
Implements XPMP2::SoundSystem.
|
overridevirtual |
Any updates to be done at the end of the frame.
Implements XPMP2::SoundSystem.
|
inline |
Use pre-v2 FMOD version structures?
|
protected |
Low Pass filter currently active?
|
protected |
FMOD version.
|
staticprotected |
static pointer to myself
|
protected |
Our channel group that we place everything under.
|
protected |
FMOD system.