@ -32,11 +32,9 @@
# include <array>
# include <array>
# include <al.h>
# include <al.h>
# include <alc.h>
# include "Magnum/Magnum.h"
# include "Magnum/Magnum.h"
# include "Magnum/Audio/Context.h"
# include "Magnum/Audio/Context.h"
# include "Magnum/Audio/Extensions.h"
# include "Magnum/Audio/visibility.h"
# include "Magnum/Audio/visibility.h"
# include "Magnum/Math/Vector3.h"
# include "Magnum/Math/Vector3.h"
@ -61,85 +59,9 @@ class Renderer {
OutOfMemory = AL_OUT_OF_MEMORY /**< Unable to allocate memory */
OutOfMemory = AL_OUT_OF_MEMORY /**< Unable to allocate memory */
} ;
} ;
/**
* @ brief HRTF status
*
* @ see @ ref hrtfStatus ( ) , @ ref isHrtfEnabled ( )
* @ requires_al_extension Extension @ alc_extension { SOFTX , HRTF } or
* @ alc_extension { SOFT , HRTF }
*/
enum class HrtfStatus : ALenum {
Disabled = ALC_HRTF_DISABLED_SOFT , /**< HRTF is disabled */
Enabled = ALC_HRTF_ENABLED_SOFT , /**< HRTF is enabled */
/**
* HRTF is disabled because it is not allowed on the device . This
* may be caused by invalid resource permissions , or an other user
* configuration that disallows HRTF .
* @ requires_al_extension Extension @ alc_extension { SOFT , HRTF }
*/
Denied = ALC_HRTF_DENIED_SOFT ,
/**
* HRTF is enabled because it must be used on the device . This may
* be caused by a device that can only use HRTF , or other user
* configuration that forces HRTF to be used .
* @ requires_al_extension Extension @ alc_extension { SOFT , HRTF }
*/
Required = ALC_HRTF_REQUIRED_SOFT ,
/**
* HRTF is enabled automatically because the device reported
* headphones .
* @ requires_al_extension Extension @ alc_extension { SOFT , HRTF }
*/
Detected = ALC_HRTF_HEADPHONES_DETECTED_SOFT ,
/**
* The device does not support HRTF with the current format .
* Typically this is caused by non - stereo output or an incompatible
* output frequency .
* @ requires_al_extension Extension @ alc_extension { SOFT , HRTF }
*/
UnsupportedFormat = ALC_HRTF_UNSUPPORTED_FORMAT_SOFT
} ;
/** @brief Error status */
/** @brief Error status */
static Error error ( ) { return Error ( alGetError ( ) ) ; }
static Error error ( ) { return Error ( alGetError ( ) ) ; }
/**
* @ brief Whether HRTFs ( Head Related Transfer Functions ) are enabled
*
* HRFTs may not be enabled / disabled in a running context . Instead
* create a new @ ref Context with HRFTs enabled or disabled .
* @ see @ ref hrtfStatus ( ) , @ ref Audio : : Context : : Configuration : : setHrtf ( ) ,
* @ fn_al { GetIntegerv } with @ def_alc { HRTF_SOFT }
* @ requires_al_extension Extension @ alc_extension { SOFTX , HRTF } or
* @ alc_extension { SOFT , HRTF }
*/
static bool isHrtfEnabled ( ) {
Int enabled = ALC_FALSE ;
alGetIntegerv ( ALC_HRTF_SOFT , & enabled ) ;
return enabled = = ALC_TRUE ;
}
/**
* @ brief HRTF status
*
* @ see @ ref isHrtfEnabled ( ) , @ fn_al { GetIntegerv } with
* @ def_alc { HRTF_STATUS_SOFT }
* @ requires_al_extension Extension @ alc_extension { SOFTX , HRTF } or
* @ alc_extension { SOFT , HRTF }
*/
static HrtfStatus hrtfStatus ( ) {
if ( ! Context : : current ( ) - > isExtensionSupported < Extensions : : ALC : : SOFT : : HRTF > ( ) )
return isHrtfEnabled ( ) ? HrtfStatus : : Enabled : HrtfStatus : : Disabled ;
Int status = ALC_HRTF_DISABLED_SOFT ;
alGetIntegerv ( ALC_HRTF_STATUS_SOFT , & status ) ;
return HrtfStatus ( status ) ;
}
/** @{ @name Listener positioning */
/** @{ @name Listener positioning */
/**
/**
@ -344,9 +266,6 @@ MAGNUM_AUDIO_EXPORT Debug& operator<<(Debug& debug, Renderer::Error value);
/** @debugoperatorclassenum{Magnum::Audio::Renderer,Magnum::Audio::Renderer::DistanceModel} */
/** @debugoperatorclassenum{Magnum::Audio::Renderer,Magnum::Audio::Renderer::DistanceModel} */
MAGNUM_AUDIO_EXPORT Debug & operator < < ( Debug & debug , Renderer : : DistanceModel value ) ;
MAGNUM_AUDIO_EXPORT Debug & operator < < ( Debug & debug , Renderer : : DistanceModel value ) ;
/** @debugoperatorclassenum{Magnum::Audio::Renderer,Magnum::Audio::Renderer::HrtfStatus} */
MAGNUM_AUDIO_EXPORT Debug & operator < < ( Debug & debug , Renderer : : HrtfStatus value ) ;
} }
} }
# endif
# endif