home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************\
- Copyright (C) James Boer, 2002.
- All rights reserved worldwide.
-
- This software is provided "as is" without express or implied
- warranties. You may freely copy and compile this source into
- applications you distribute provided that the copyright text
- below is included in the resulting source code, for example:
- "Portions Copyright (C) James Boer, 2002"
- \***********************************************************/
- #ifndef IAUDIOEXT_H__
- #define IAUDIOEXT_H__
-
- #include "3dl2.h"
- #include "3dl2help.h"
- #include "eax.h"
- #include "ZoomFX.h"
-
- #ifndef DOXYGEN_SHOULD_SKIP_THIS
- namespace Audio
- {
- #endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
- /*! \file IAudioExt.h*/
-
- //! EAXListenerProps is used to set all EAX listener properties at once
- /*!
- EAXListenerProps is derived from the EAX structure _EAXLISTENERPROPERTIES.
- The structure is made slightly more user friendly by providing a Clear()
- function which resets all EAX listener properties to their default
- values. The Clear() function is also automatically called when the
- structure is created. Because it is derived from _EAXLISTENERPROPERTIES,
- it can be used interchangeably with this structure since it is binary
- compatible.
- */
- struct EAXListenerProps : public _EAXLISTENERPROPERTIES
- {
- //! Default constructor calls the Clear() function.
- EAXListenerProps()
- { Clear(); }
- //! Sets all members to their default values, as defined in eax.h
- void Clear()
- {
- lRoom = EAXLISTENER_DEFAULTROOM;
- lRoomHF = EAXLISTENER_DEFAULTROOMHF;
- flRoomRolloffFactor = EAXLISTENER_DEFAULTROOMROLLOFFFACTOR;
- flDecayTime = EAXLISTENER_DEFAULTDECAYTIME;
- flDecayHFRatio = EAXLISTENER_DEFAULTDECAYHFRATIO;
- lReflections = EAXLISTENER_DEFAULTREFLECTIONS;
- flReflectionsDelay = EAXLISTENER_DEFAULTREFLECTIONSDELAY;
- lReverb = EAXLISTENER_DEFAULTREVERB;
- flReverbDelay = EAXLISTENER_DEFAULTREVERBDELAY;
- dwEnvironment = EAXLISTENER_DEFAULTENVIRONMENT;
- flEnvironmentSize = EAXLISTENER_DEFAULTENVIRONMENTSIZE;
- flEnvironmentDiffusion = EAXLISTENER_DEFAULTENVIRONMENTDIFFUSION;
- flAirAbsorptionHF = EAXLISTENER_DEFAULTAIRABSORPTIONHF;
- dwFlags = EAXLISTENER_DEFAULTFLAGS;
- }
- };
-
- //! Public EAX listener interface extension
- /*!
- IEAXListener is a public interface class designed to provide an
- easy-to-use interface to a listener's EAX properties. The interface
- is obtained through the function Listener::EAX(), and it always
- guaranteed to return a valid interface, even if EAX is disabled.
- The specialized interface is much easier to use than a generic
- property set interface. IEAXListener and any related structures
- and interfaces are based on the EAX 2.0 specifications.
- \sa IEAXBuffer, IListener, IListener::EAX()
- */
- class IEAXListener
- {
- public:
-
- /*!
- Sets the room effect level.
- \param iRoom Valid range from -10000 to 0. Defaults to -1000
- */
- virtual void SetRoom(int32 iRoom) = 0;
- /*!
- Sets the room effect level at high frequencies.
- \param iRoomHF Valid range from -10000 to 0. Defaults to -1000
- */
- virtual void SetRoomHF(int32 iRoomHF) = 0;
- /*!
- Sets the room effect rolloff factor.
- \param fRoomRolloffFactor Valid range from 0.0 to 10.0. Defaults to 0.0
- */
- virtual void SetRoomRolloffFactor(float fRoomRolloffFactor) = 0;
- /*!
- Sets the reverberation decay time in seconds.
- \param fRoomRolloffFactor Valid range from 0.1 to 20.0. Defaults to 1.49
- */
- virtual void SetDecayTime(float fDecayTime) = 0;
- /*!
- Sets the decay high-frequency ratio.
- \param fDecayHFRatio Valid range from 0.1 to 2.0. Defaults to 0.83
- */
- virtual void SetDecayHFRatio(float fDecayHFRatio) = 0;
- /*!
- Sets the early reflections level relative to room effect.
- \param iReflections Valid range from -10000 to 1000. Defaults to -2602
- */
- virtual void SetReflections(int32 iReflections) = 0;
- /*!
- Sets the initial early reflections delay time.
- \param fReflectionsDelay Valid range from 0.0 to 0.3. Defaults to .007
- */
- virtual void SetReflectionsDelay(float fReflectionsDelay) = 0;
- /*!
- Sets the reverberation level.
- \param iReverb Valid range from -10000 to 2000. Defaults to 200
- */
- virtual void SetReverb(int32 iReverb) = 0;
- /*!
- Sets the late reverberation delay time relative to the early reflections
- delay time.
- \param fReverbDelay Valid range from 0.0 to 0.1. Defaults to 0.011
- */
- virtual void SetReverbDelay(float fReverbDelay) = 0;
- /*!
- Sets a preset environment (see eax documentation for listing)
- \param nEnvironment preset environment enumeration
- */
- virtual void SetEnvironment(uint32 nEnvironment) = 0;
- /*!
- Sets the approximate environment size in meters
- \param fEnvironmentSize Valid range from 1.0 to 100.0. Defaults to 7.5
- */
- virtual void SetEnvironmentSize(float fEnvironmentSize) = 0;
- /*!
- Sets the level of environment diffusion
- \param fEnvironmentDiffusion Valid range from 0.0 to 1.0. Defaults to 1.0
- */
- virtual void SetEnvironmentDiffusion(float fEnvironmentDiffusion) = 0;
- /*!
- Sets the air absorption factor
- \param fAirAbsorption Valid range from -100.0 to 0.0. Defaults to -5.0
- */
- virtual void SetAirAbsorptionHF(float fAirAbsorption) = 0;
- /*!
- Sets all EAX listener flags - see EAX documentation for details
- \param fEnvironmentDiffusion all EAX listener flags
- */
- virtual void SetFlags(uint32 nFlags) = 0;
- /*!
- Sets all current EAX listener parameters
- \param props all EAX listener properties
- */
- virtual void SetProperties(const EAXListenerProps& props) = 0;
- /*!
- Gets all current EAX listener parameters
- \param props all EAX listener properties
- */
- virtual void GetProperties(EAXListenerProps& props) = 0;
- };
-
- //! EAXBufferProps is used to set all EAX buffer properties at once
- /*!
- EAXBufferProps is derived from the EAX structure _EAXBUFFERPROPERTIES.
- The structure is made slightly more user friendly by providing a Clear()
- function which resets all EAX buffer properties to their default
- values. The Clear() function is also automatically called when the
- structure is created. Because it is derived from _EAXBUFFERPROPERTIES,
- it can be used interchangeably with this structure since it is binary
- compatible.
- */
- struct EAXBufferProps : public _EAXBUFFERPROPERTIES
- {
- //! Default constructor calls the Clear() function.
- EAXBufferProps()
- { Clear(); }
- //! Sets all members to their default values, as defined in eax.h
- void Clear()
- {
- lDirect = EAXBUFFER_DEFAULTDIRECT;
- lDirectHF = EAXBUFFER_DEFAULTDIRECTHF;
- lRoom = EAXBUFFER_DEFAULTROOM;
- lRoomHF = EAXBUFFER_DEFAULTROOMHF;
- flRoomRolloffFactor = EAXBUFFER_DEFAULTROOMROLLOFFFACTOR;
- lObstruction = EAXBUFFER_DEFAULTOBSTRUCTION;
- flObstructionLFRatio = EAXBUFFER_DEFAULTOBSTRUCTIONLFRATIO;
- lOcclusion = EAXBUFFER_DEFAULTOCCLUSION;
- flOcclusionLFRatio = EAXBUFFER_DEFAULTOCCLUSIONLFRATIO;
- flOcclusionRoomRatio = EAXBUFFER_DEFAULTOCCLUSIONROOMRATIO;
- lOutsideVolumeHF = EAXBUFFER_DEFAULTOUTSIDEVOLUMEHF;
- flAirAbsorptionFactor = EAXBUFFER_DEFAULTAIRABSORPTIONFACTOR;
- dwFlags = EAXBUFFER_DEFAULTFLAGS;
- }
- };
-
-
- //! Public EAX buffer interface extension
- /*!
- IEAXBuffer is a public interface class designed to provide an
- easy-to-use interface to a buffer's EAX properties. The interface
- is obtained through the function ISound3D::EAX(), and it always
- guaranteed to return a valid interface, even if EAX is disabled.
- The specialized interface is much easier to use than a generic
- property set interface. IEAXBuffer and any related structures
- and interfaces are based on the EAX 2.0 specifications.
- \sa IEAXListener, ISound3D, ISound3D::EAX()
- */
- class IEAXBuffer
- {
- public:
- /*!
- Sets the direct path audio level
- \param iDirect Valid range from -10000 to 1000. Defaults to 0
- */
- virtual void SetDirect(int32 iDirect) = 0;
- /*!
- Sets the direct path audio level at high frequencies
- \param iDirectHF Valid range from -10000 to 0. Defaults to 0
- */
- virtual void SetDirectHF(int32 iDirectHF) = 0;
- /*!
- Sets the room effect level
- \param iRoom Valid range from -10000 to 1000. Defaults to 0
- */
- virtual void SetRoom(int32 iRoom) = 0;
- /*!
- Sets the room effect level at high frequencies
- \param iRoomHF Valid range from -10000 to 0. Defaults to 0
- */
- virtual void SetRoomHF(int32 iRoomHF) = 0;
- /*!
- Sets the room effect rolloff factor
- \param fRoomRolloffFactor Valid range from 0.0 to 10.0. Defaults to 0.0
- */
- virtual void SetRoomRolloffFactor(float fRoomRolloffFactor) = 0;
- /*!
- Sets the buffer's obstruction level
- \param iObstruction Valid range from -10000 to 0. Defaults to 0
- */
- virtual void SetObstruction(int32 iObstruction) = 0;
- /*!
- Sets the buffer's obstruction low-frequency level
- \param fObstructionLFRatio Valid range from 0.0 to 1.0. Defaults to 0.0
- */
- virtual void SetObstructionLFRatio(float fObstructionLFRatio) = 0;
- /*!
- Sets the buffer's occlusion level
- \param iOcclusion Valid range from -10000 to 0. Defaults to 0
- */
- virtual void SetOcclusion(int32 iOcclusion) = 0;
- /*!
- Sets the buffer's occlusion low-frequency level
- \param fOcclusionLFRatio Valid range from 0.0 to 1.0. Defaults to 0.25
- */
- virtual void SetOcclusionLFRatio(float fOcclusionLFRatio) = 0;
- /*!
- Sets the buffer's room-level occlusion control
- \param fOcclusionRoomRatio Valid range from 0.0 to 10.0. Defaults to 0.5
- */
- virtual void SetOcclusionRoomRatio(float fOcclusionRoomRatio) = 0;
- /*!
- Sets the buffer's outside volume for high frequencies
- \param iOutsideVolumeHF Valid range from -10000 to 0. Defaults to 0
- */
- virtual void SetOutsideVolumeHF(int32 iOutsideVolumeHF) = 0;
- /*!
- Sets the air absorption factor
- \param fAirAbsorption Valid range from 0.0 to 10.0. Defaults to 1.0
- */
- virtual void SetAirAbsorptionFactor(float fAirAbsorptionFactor) = 0;
- /*!
- Sets all EAX buffer flags - see EAX documentation for details
- \param fEnvironmentDiffusion all EAX buffer flags
- */
- virtual void SetFlags(uint32 nFlags) = 0;
- /*!
- Sets all current EAX buffer parameters
- \param props all EAX buffer properties
- */
- virtual void SetProperties(const EAXBufferProps& props) = 0;
- /*!
- Gets all current EAX buffer parameters
- \param props all EAX buffer properties
- */
- virtual void GetProperties(EAXBufferProps& props) = 0;
- };
-
-
- //! ZoomFXBox is used to set all ZoomFX orientation properties
- /*!
- ZoomFXBox is derived from the ZoomFX structure ZOOMFX_BOX.
- The structure is made slightly more user friendly by providing a Clear()
- function which resets all ZoomFX buffer properties to their default
- values. The Clear() function is also automatically called when the
- structure is created. Because it is derived from ZOOMFX_BOX,
- it can be used interchangeably with this structure since it is binary
- compatible.
- */
- struct ZoomFXBox : public ZOOMFX_BOX
- {
- //! Default constructor calls the Clear() function.
- ZoomFXBox() { Clear(); }
- //! Sets all members to their default values, as defined in zoomfx.h
- void Clear()
- {
- vMin.x = 0.0f;
- vMin.y = 0.0f;
- vMin.z = 0.0f;
- vMax.x = 0.0f;
- vMax.y = 0.0f;
- vMax.z = 0.0f;
- }
- };
-
- //! ZoomFXOrientation is used to set all ZoomFX orientation properties
- /*!
- ZoomFXOrientation is derived from the ZoomFX structure ZOOMFX_ORIENTATION.
- The structure is made slightly more user friendly by providing a Clear()
- function which resets all ZoomFX buffer properties to their default
- values. The Clear() function is also automatically called when the
- structure is created. Because it is derived from ZOOMFX_ORIENTATION,
- it can be used interchangeably with this structure since it is binary
- compatible.
- */
- struct ZoomFXOrientation : public ZOOMFX_ORIENTATION
- {
- //! Default constructor calls the Clear() function.
- ZoomFXOrientation() { Clear(); }
- //! Sets all members to their default values, as defined in zoomfx.h
- void Clear()
- {
- vFront.x = 0.0f;
- vFront.y = 0.0f;
- vFront.z = 1.0f;
- vTop.x = 0.0f;
- vTop.y = 1.0f;
- vTop.z = 0.0f;
- }
- };
-
- //! ZoomFXProps is used to set all ZoomFX buffer properties at once
- /*!
- ZoomFXProps is derived from the ZoomFX structure ZOOMFX_BUFFERPROPERTIES.
- The structure is made slightly more user friendly by providing a Clear()
- function which resets all ZoomFX buffer properties to their default
- values. The Clear() function is also automatically called when the
- structure is created. Because it is derived from ZOOMFX_BUFFERPROPERTIES,
- it can be used interchangeably with this structure since it is binary
- compatible.
- */
- struct ZoomFXProps : public ZOOMFX_BUFFERPROPERTIES
- {
- //! Default constructor calls the Clear() function.
- ZoomFXProps() { Clear(); }
- //! Sets all members to their default values, as defined in zoomfx.h
- void Clear()
- {
- box.vMin.x = 0.0f;
- box.vMin.y = 0.0f;
- box.vMin.z = 0.0f;
- box.vMax.x = 0.0f;
- box.vMax.y = 0.0f;
- box.vMax.z = 0.0f;
- orientation.vFront.x = 0.0f;
- orientation.vFront.y = 0.0f;
- orientation.vFront.z = 1.0f;
- orientation.vTop.x = 0.0f;
- orientation.vTop.y = 1.0f;
- orientation.vTop.z = 0.0f;
- lMacroFx = ZOOMFXBUFFER_MACROFX_DEFAULT;
- }
- };
-
-
-
-
-
- //! Public ZoomFX buffer interface extension
- class IZoomFX
- {
- public:
- /*!
- Set the ZoomFX bounding box dimensions.
- \param box ZoomFXBox used to set the min and max coordinates
- of the bounding box
- */
- virtual void SetBox(const ZoomFXBox& box) = 0;
- /*!
- Set the ZoomFX bounding box orientation.
- \param orientation The ZoomFXOrientation structure uses two
- vectors to define the bounding box orientation.
- */
- virtual void SetOrientation(const ZoomFXOrientation& orientation) = 0;
- /*!
- Sets the percentage level of the MacroFX near-position effect.
- \param nMacroFX percentage of effect
- */
- virtual void SetMacroFX(uint32 nMacroFX) = 0;
- /*!
- Sets all ZoomFX and MacroFX properties at once.
- \param props all properties to set
- */
- virtual void SetProperties(const ZoomFXProps& props) = 0;
- /*!
- Gets all ZoomFX and MacroFX properties at once.
- \param props all properties to get
- */
- virtual void GetProperties(ZoomFXProps& props) = 0;
-
- };
-
- #ifndef DOXYGEN_SHOULD_SKIP_THIS
- }; // namespace Audio
- #endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
-
- #endif // IAUDIOEXT_H__
-