30 #if INCLUDE_FMOD_SOUND + 0 >= 1
34 class SoundSystemFMOD;
45 const std::string& _filePath,
bool _bLoop,
46 float _coneDir,
float _conePitch,
47 float _coneInAngle,
float _coneOutAngle,
float _coneOutVol);
78 const std::string& _filePath,
bool _bLoop,
79 float _coneDir,
float _conePitch,
80 float _coneInAngle,
float _coneOutAngle,
float _coneOutVol)
override;
94 uint64_t
Play (
const std::string& sndName,
float vol,
const Aircraft& ac)
override;
96 void Unpause (uint64_t sndId)
override;
98 void Stop (uint64_t sndId)
override;
102 void SetVolume (uint64_t sndId,
float vol)
override;
104 void SetMute (uint64_t sndId,
bool bMute)
override;
115 bool IsValid (uint64_t sndId)
override;
122 static FMOD_RESULT F_CALLBACK
ChnCB(FMOD_CHANNELCONTROL *channelcontrol,
123 FMOD_CHANNELCONTROL_TYPE controltype,
124 FMOD_CHANNELCONTROL_CALLBACK_TYPE callbacktype,
132 static FMOD_RESULT F_CALLBACK
SoundLogCB(FMOD_DEBUG_FLAGS flags,
136 const char *message);
142 template<
class T_ADVSET>
146 static uint64_t
GetSndId (FMOD_CHANNEL* pFmodChn);
Actual representation of all aircraft in XPMP2.
Definition: XPMPAircraft.h:178
Represents a sound file to be passed on to FMOD to be played.
Definition: SoundFMOD.h:37
bool bLoaded
cached version of the sound's openstate
Definition: SoundFMOD.h:40
FMOD_SOUND * GetSnd() const
Return the FMOD sound.
Definition: SoundFMOD.h:55
SoundSystemFMOD * GetFmodSys() const
Return the FMOD sound system (a type cast of pSndSys)
Definition: SoundFMOD.cpp:104
SoundFMOD(SoundSystemFMOD *_pSndSys, const std::string &_filePath, bool _bLoop, float _coneDir, float _conePitch, float _coneInAngle, float _coneOutAngle, float _coneOutVol)
Constructor creates the FMOD sound object and initiates loading of the file.
Definition: SoundFMOD.cpp:63
~SoundFMOD() override
Destructor removes the sound object.
Definition: SoundFMOD.cpp:78
FMOD_SOUND * pSound
FMOD sound object.
Definition: SoundFMOD.h:39
bool isReady() override
Finished loading, ready to play?
Definition: SoundFMOD.cpp:87
Represents a sound file.
Definition: Sound.h:101
Encapsulates direct access to the FMOD Sound System.
Definition: SoundFMOD.h:62
void SetLowPassGain(bool bOn)
Set low pass gain on all active sounds.
Definition: SoundFMOD.cpp:466
SoundSystemFMOD()
Construtor, throws exception if FMOD sound system cannot be initialized.
Definition: SoundFMOD.cpp:118
void Stop(uint64_t sndId) override
Stop the sound.
Definition: SoundFMOD.cpp:347
void SetAllMute(bool bMute) override
Mute all sounds (temporarily)
Definition: SoundFMOD.cpp:460
void SetMasterVolume(float volMaster) override
Set Master Volume on our channel group.
Definition: SoundFMOD.cpp:454
void Unpause(uint64_t sndId) override
Unpause a sound, which got started in a paused state to avoid crackling.
Definition: SoundFMOD.cpp:336
static uint64_t GetSndId(FMOD_CHANNEL *pFmodChn)
Read SoundChannel from FMOD Channel's user data.
Definition: SoundFMOD.cpp:504
uint64_t Play(const std::string &sndName, float vol, const Aircraft &ac) override
Play a new sound, returns an id for that sound.
Definition: SoundFMOD.cpp:280
bool bLowPass
Low Pass filter currently active?
Definition: SoundFMOD.h:68
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.
Definition: SoundFMOD.cpp:195
unsigned int fmodVer
FMOD version.
Definition: SoundFMOD.h:66
unsigned int GetVer() const
Return the FMOD version.
Definition: SoundFMOD.h:87
void SetPosOrientation(uint64_t sndId, const Aircraft &ac, bool bDoOrientation) override
Update sound's position and orientation.
Definition: SoundFMOD.cpp:361
void SetMute(uint64_t sndId, bool bMute) override
Mute the sound (temporarily)
Definition: SoundFMOD.cpp:399
~SoundSystemFMOD() override
Destructor.
Definition: SoundFMOD.cpp:184
bool UsePreV2Fmod()
Use pre-v2 FMOD version structures?
Definition: SoundFMOD.h:83
FMOD_CHANNELGROUP * pChnGrp
Our channel group that we place everything under.
Definition: SoundFMOD.h:67
bool IsValid(uint64_t sndId) override
Is the sound id available?
Definition: SoundFMOD.cpp:483
static SoundSystemFMOD * me
static pointer to myself
Definition: SoundFMOD.h:64
void SetVolume(uint64_t sndId, float vol) override
Set sound's volume.
Definition: SoundFMOD.cpp:389
FMOD_SYSTEM * pFmodSystem
FMOD system.
Definition: SoundFMOD.h:65
void SoundSetFmodSettings(T_ADVSET &advSet)
Helper functon to set FMOD settings.
Definition: SoundFMOD.cpp:495
FMOD_SYSTEM * GetSys() const
Return the FMOD sound system.
Definition: SoundFMOD.h:85
void Update() override
Any updates to be done at the end of the frame.
Definition: SoundFMOD.cpp:409
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.
Definition: SoundFMOD.cpp:226
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.
Definition: SoundFMOD.cpp:258
void SoundLogEnable(bool bEnable=true)
Enables/disables FMOD logging.
Definition: SoundFMOD.cpp:210
Base class for sound systems, practically empty.
Definition: Sound.h:198
Definition: XPMPAircraft.h:70