diff options
author | Chris Robinson <[email protected]> | 2011-03-11 00:13:44 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-03-11 00:13:44 -0800 |
commit | 031a2a1b1e37a198c64f49ac8994d4c589dabcf9 (patch) | |
tree | 05e8a4d62e6843f9f4135db7bb95b574c0f314d1 /OpenAL32 | |
parent | 9c87b73ad576f1c2abf22cfd38eb055eef34c67f (diff) |
Implement a basic non-real-time loopback device
Currently it behaves just like a normal device except contexts are only
processed during calls to alcRenderSamples. Additionally, the ALC_SYNC and
ALC_REFRESH context attributes are not valid for these devices, and there are
two new context attributes to specify the rendering format: ALC_FORMAT_TYPE
and ALC_FORMAT_CHANNELS. These each take one of the type and channel enums
added.
This stuff is subject to change.
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alMain.h | 57 |
1 files changed, 46 insertions, 11 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 02153a86..68e3e372 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -13,6 +13,37 @@ #include "AL/alc.h" #include "AL/alext.h" +#ifndef ALC_SOFT_device_loopback +#define ALC_SOFT_device_loopback 1 +#define AL_BYTE 1 +#define AL_UNSIGNED_BYTE 2 +#define AL_SHORT 3 +#define AL_UNSIGNED_SHORT 4 +#define AL_INT 5 +#define AL_UNSIGNED_INT 6 +#define AL_FLOAT 7 +#define AL_DOUBLE 8 +#define AL_MULAW 9 +#define AL_IMA4 10 +#define AL_MONO 1 +#define AL_STEREO 2 +#define AL_REAR 3 +#define AL_QUAD 4 +#define AL_5POINT1 5 /* (WFX order) */ +#define AL_6POINT1 6 /* (WFX order) */ +#define AL_7POINT1 7 /* (WFX order) */ +#define ALC_FORMAT_CHANNELS 0x1990 +#define ALC_FORMAT_TYPE 0x1991 +typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICE)(void); +typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTED)(ALCdevice *device, ALCsizei freq, ALenum channels, ALenum type); +typedef void (ALC_APIENTRY*LPALCRENDERSAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); +#ifdef AL_ALEXT_PROTOTYPES +ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDevice(void); +ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupported(ALCdevice *device, ALCsizei freq, ALenum channels, ALenum type); +ALC_API void ALC_APIENTRY alcRenderSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); +#endif +#endif + #ifndef AL_EXT_sample_buffer_object #define AL_EXT_sample_buffer_object 1 typedef ptrdiff_t ALintptrEXT; @@ -294,6 +325,9 @@ void alc_pulse_probe(int type); void alc_null_init(BackendFuncs *func_list); void alc_null_deinit(void); void alc_null_probe(int type); +void alc_loopback_init(BackendFuncs *func_list); +void alc_loopback_deinit(void); +void alc_loopback_probe(int type); typedef struct UIntMap { @@ -313,19 +347,19 @@ ALvoid *LookupUIntMapKey(UIntMap *map, ALuint key); /* Device formats */ enum DevFmtType { - DevFmtByte, /* AL_BYTE */ - DevFmtUByte, /* AL_UNSIGNED_BYTE */ - DevFmtShort, /* AL_SHORT */ - DevFmtUShort, /* AL_UNSIGNED_SHORT */ - DevFmtFloat, /* AL_FLOAT */ + DevFmtByte = AL_BYTE, + DevFmtUByte = AL_UNSIGNED_BYTE, + DevFmtShort = AL_SHORT, + DevFmtUShort = AL_UNSIGNED_SHORT, + DevFmtFloat = AL_FLOAT }; enum DevFmtChannels { - DevFmtMono, /* AL_MONO */ - DevFmtStereo, /* AL_STEREO */ - DevFmtQuad, /* AL_QUAD */ - DevFmtX51, /* AL_5POINT1 */ - DevFmtX61, /* AL_6POINT1 */ - DevFmtX71, /* AL_7POINT1 */ + DevFmtMono = AL_MONO, + DevFmtStereo = AL_STEREO, + DevFmtQuad = AL_QUAD, + DevFmtX51 = AL_5POINT1, + DevFmtX61 = AL_6POINT1, + DevFmtX71 = AL_7POINT1 }; ALuint BytesFromDevFmt(enum DevFmtType type); @@ -341,6 +375,7 @@ struct ALCdevice_struct { ALCboolean Connected; ALboolean IsCaptureDevice; + ALboolean IsLoopbackDevice; ALuint Frequency; ALuint UpdateSize; |