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

Represents a sound file. More...

#include <Sound.h>

+ Inheritance diagram for XPMP2::SoundFile:

Public Member Functions

 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...
 
virtual bool isReady ()=0
 Ready to play? More...
 

Public Attributes

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.

See also
For 3D cones also see https://www.fmod.com/docs/2.01/api/core-api-channelcontrol.html#channelcontrol_set3dconesettings

Constructor & Destructor Documentation

◆ SoundFile() [1/2]

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.

Exceptions
FmodErrorin case of errors during CreateSound

◆ ~SoundFile()

virtual XPMP2::SoundFile::~SoundFile ( )
inlinevirtual

Make sure destructor is virtual.

◆ SoundFile() [2/2]

XPMP2::SoundFile::SoundFile ( const SoundFile o)
delete

Copying is not permitted.

Member Function Documentation

◆ hasConeInfo()

bool XPMP2::SoundFile::hasConeInfo ( ) const
inline

Has full cone information?

◆ isReady()

virtual bool XPMP2::SoundFile::isReady ( )
pure virtual

Ready to play?

Implemented in XPMP2::SoundFMOD, and XPMP2::SoundWAV.

Member Data Documentation

◆ bLoop

bool XPMP2::SoundFile::bLoop = true

sound to be played in a loop?

◆ coneDir

float XPMP2::SoundFile::coneDir = NAN

Which direction relative to plane's heading does the cone point to? (180 would be typical for jet engines)

◆ coneInAngle

float XPMP2::SoundFile::coneInAngle = NAN

Inside cone angle. This is the angle spread within which the sound is unattenuated.

◆ coneOutAngle

float XPMP2::SoundFile::coneOutAngle = NAN

Outside cone angle. This is the angle spread outside of which the sound is attenuated to its SoundFile::coneOutVol.

◆ coneOutVol

float XPMP2::SoundFile::coneOutVol = NAN

Cone outside volume.

◆ conePitch

float XPMP2::SoundFile::conePitch = NAN

Which pitch does the cone point to (up/down)? (0 would be typical, ie. level with the plane)

◆ filePath

std::string XPMP2::SoundFile::filePath

File path to sound file.

◆ pSndSys

SoundSystem* XPMP2::SoundFile::pSndSys = nullptr

Sound system for which this object was created.


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