XPMP2
X-Plane multiplayer library 2 - using instancing
Public Member Functions | Protected Attributes | List of all members
XPMP2::SoundFMOD Class Reference

Represents a sound file to be passed on to FMOD to be played. More...

#include <SoundFMOD.h>

+ Inheritance diagram for XPMP2::SoundFMOD:

Public Member Functions

 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. More...
 
 ~SoundFMOD () override
 Destructor removes the sound object. More...
 
bool isReady () override
 Finished loading, ready to play? More...
 
FMOD_SOUND * GetSnd () const
 Return the FMOD sound. More...
 
SoundSystemFMODGetFmodSys () const
 Return the FMOD sound system (a type cast of pSndSys) More...
 
- Public Member Functions inherited from XPMP2::SoundFile
 SoundFile (SoundSystem *_pSndSys, const std::string &_filePath, bool _bLoop, float _coneDir, float _conePitch, float _coneInAngle, float _coneOutAngle, float _coneOutVol)
 Construct a sound object from a file name and have it loaded asynchonously. More...
 
virtual ~SoundFile ()
 Make sure destructor is virtual. More...
 
 SoundFile (const SoundFile &o)=delete
 Copying is not permitted. More...
 
bool hasConeInfo () const
 Has full cone information? More...
 

Protected Attributes

FMOD_SOUND * pSound = nullptr
 FMOD sound object. More...
 
bool bLoaded = false
 cached version of the sound's openstate More...
 

Additional Inherited Members

- Public Attributes inherited from XPMP2::SoundFile
SoundSystempSndSys = nullptr
 Sound system for which this object was created. More...
 
std::string filePath
 File path to sound file. More...
 
bool bLoop = true
 sound to be played in a loop? More...
 
float coneDir = NAN
 Which direction relative to plane's heading does the cone point to? (180 would be typical for jet engines) More...
 
float conePitch = NAN
 Which pitch does the cone point to (up/down)? (0 would be typical, ie. level with the plane) More...
 
float coneInAngle = NAN
 Inside cone angle. This is the angle spread within which the sound is unattenuated. More...
 
float coneOutAngle = NAN
 Outside cone angle. This is the angle spread outside of which the sound is attenuated to its SoundFile::coneOutVol. More...
 
float coneOutVol = NAN
 Cone outside volume. More...
 

Detailed Description

Represents a sound file to be passed on to FMOD to be played.

Constructor & Destructor Documentation

◆ SoundFMOD()

XPMP2::SoundFMOD::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.

◆ ~SoundFMOD()

XPMP2::SoundFMOD::~SoundFMOD ( )
override

Destructor removes the sound object.

Member Function Documentation

◆ GetFmodSys()

SoundSystemFMOD * XPMP2::SoundFMOD::GetFmodSys ( ) const

Return the FMOD sound system (a type cast of pSndSys)

◆ GetSnd()

FMOD_SOUND* XPMP2::SoundFMOD::GetSnd ( ) const
inline

Return the FMOD sound.

◆ isReady()

bool XPMP2::SoundFMOD::isReady ( )
overridevirtual

Finished loading, ready to play?

Implements XPMP2::SoundFile.

Member Data Documentation

◆ bLoaded

bool XPMP2::SoundFMOD::bLoaded = false
protected

cached version of the sound's openstate

◆ pSound

FMOD_SOUND* XPMP2::SoundFMOD::pSound = nullptr
protected

FMOD sound object.


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