XPMP2
X-Plane multiplayer library 2 - using instancing
Classes | Namespaces | Macros | Typedefs | Functions
Sound.h File Reference

Sound for aircraft, based on XPLMSound. More...

Go to the source code of this file.

Classes

class  XPMP2::FmodError
 Exception class to pass on error information. More...
 
class  XPMP2::SoundFile
 Represents a sound file. More...
 
class  XPMP2::SoundWAV
 Represents a WAV file, read into memory, played by XP's Sound API. More...
 
class  XPMP2::SoundChannel
 A sound object being played, called channel. More...
 
class  XPMP2::SoundSystem
 Base class for sound systems, practically empty. More...
 
class  XPMP2::SoundSystemXP
 Encapsulates the XP12 Sound System. More...
 

Namespaces

 XPMP2
 

Macros

#define FMOD_TEST(fmodCall)
 Log an error if fmodRes is not FMOD_OK More...
 
#define FMOD_CATCH   catch (const FmodError& e) { e.LogErr(); }
 Standard catch clause to handle FmodError exceptions by just logging them. More...
 
#define FMOD_LOG(fmodCall)
 Just log an error without raising an exception. More...
 

Typedefs

typedef std::unique_ptr< SoundFile > XPMP2::SoundFilePtr
 Smart pointer to a SoundFile object. More...
 
typedef std::map< std::string, SoundFilePtr > XPMP2::mapSoundPtrTy
 Map of all sounds, indexed by a sound name (type) More...
 

Functions

FMOD_VECTOR XPMP2::FmodHeadPitch2Vec (const float head, const float pitch)
 Convert heading/pitch to normalized x/y/z vector. More...
 
void XPMP2::FmodHeadPitchRoll2Normal (const float head, const float pitch, const float roll, FMOD_VECTOR &vecDir, FMOD_VECTOR &vecNorm)
 Convert heading/pitch to normal x/y/z vector. More...
 
void XPMP2::FmodNormalizeHeadingPitch (float &head, float &pitch)
 Normalize Pitch/Heading. More...
 
void XPMP2::SoundInit ()
 Initialize the sound module and load the sounds. More...
 
void XPMP2::SoundUpdatesBegin ()
 Prepare for this frame's updates, which are about to start. More...
 
void XPMP2::SoundUpdatesDone ()
 Tell FMOD that all updates are done. More...
 
void XPMP2::SoundCleanup ()
 Graceful shoutdown. More...
 

Detailed Description

Sound for aircraft, based on XPLMSound.

Sound for aircraft, based on the FMOD library.

Author
Birger Hoppe
Note
If built with INCLUDE_FMOD_SOUND=1 then Audio Engine is FMOD Core API by Firelight Technologies Pty Ltd. Understand FMOD licensing and attribution requirements first!
Author
Birger Hoppe

Macro Definition Documentation

◆ FMOD_CATCH

#define FMOD_CATCH   catch (const FmodError& e) { e.LogErr(); }

Standard catch clause to handle FmodError exceptions by just logging them.

◆ FMOD_LOG

#define FMOD_LOG (   fmodCall)
Value:
{ \
if ((XPMP2::gFmodRes = (fmodCall)) != FMOD_OK) \
XPMP2::FmodError(#fmodCall, XPMP2::gFmodRes, __FILE__, __LINE__, __func__).LogErr(); \
}
FMOD_RESULT gFmodRes
last FMOD result code, needed by the following macro, better don't rely on anywhere else
Definition: Sound.cpp:42

Just log an error without raising an exception.

◆ FMOD_TEST

#define FMOD_TEST (   fmodCall)
Value:
{ \
if ((gFmodRes = (fmodCall)) != FMOD_OK) \
throw FmodError(#fmodCall, gFmodRes, __FILE__, __LINE__, __func__); \
}

Log an error if fmodRes is not FMOD_OK