rlm@0: #ifndef AL_MAIN_H rlm@0: #define AL_MAIN_H rlm@0: rlm@0: #include rlm@0: #include rlm@0: #include rlm@0: rlm@0: #ifdef HAVE_FENV_H rlm@0: #include rlm@0: #endif rlm@0: rlm@0: #include "AL/al.h" rlm@0: #include "AL/alc.h" rlm@0: #include "AL/alext.h" rlm@0: rlm@0: #ifndef ALC_SOFT_device_loopback rlm@0: #define ALC_SOFT_device_loopback 1 rlm@0: #define ALC_FORMAT_CHANNELS_SOFT 0x1990 rlm@0: #define ALC_FORMAT_TYPE_SOFT 0x1991 rlm@0: rlm@0: /* Sample types */ rlm@0: #define ALC_BYTE 0x1400 rlm@0: #define ALC_UNSIGNED_BYTE 0x1401 rlm@0: #define ALC_SHORT 0x1402 rlm@0: #define ALC_UNSIGNED_SHORT 0x1403 rlm@0: #define ALC_INT 0x1404 rlm@0: #define ALC_UNSIGNED_INT 0x1405 rlm@0: #define ALC_FLOAT 0x1406 rlm@0: rlm@0: /* Channel configurations */ rlm@0: #define ALC_MONO 0x1500 rlm@0: #define ALC_STEREO 0x1501 rlm@0: #define ALC_QUAD 0x1503 rlm@0: #define ALC_5POINT1 0x1504 /* (WFX order) */ rlm@0: #define ALC_6POINT1 0x1505 /* (WFX order) */ rlm@0: #define ALC_7POINT1 0x1506 /* (WFX order) */ rlm@0: rlm@0: typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(void); rlm@0: typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type); rlm@0: typedef void (ALC_APIENTRY*LPALCRENDERSAMPLESSOFT)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); rlm@0: #ifdef AL_ALEXT_PROTOTYPES rlm@0: ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(void); rlm@0: ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupportedSOFT(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type); rlm@0: ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); rlm@0: #endif rlm@0: #endif rlm@0: rlm@0: #ifndef AL_SOFT_buffer_samples rlm@0: #define AL_SOFT_buffer_samples 1 rlm@0: /* Sample types */ rlm@0: #define AL_BYTE 0x1400 rlm@0: #define AL_UNSIGNED_BYTE 0x1401 rlm@0: #define AL_SHORT 0x1402 rlm@0: #define AL_UNSIGNED_SHORT 0x1403 rlm@0: #define AL_INT 0x1404 rlm@0: #define AL_UNSIGNED_INT 0x1405 rlm@0: #define AL_FLOAT 0x1406 rlm@0: #define AL_DOUBLE 0x1407 rlm@0: #define AL_BYTE3 0x1408 rlm@0: #define AL_UNSIGNED_BYTE3 0x1409 rlm@0: #define AL_MULAW 0x1410 rlm@0: #define AL_IMA4 0x1411 rlm@0: rlm@0: /* Channel configurations */ rlm@0: #define AL_MONO 0x1500 rlm@0: #define AL_STEREO 0x1501 rlm@0: #define AL_REAR 0x1502 rlm@0: #define AL_QUAD 0x1503 rlm@0: #define AL_5POINT1 0x1504 /* (WFX order) */ rlm@0: #define AL_6POINT1 0x1505 /* (WFX order) */ rlm@0: #define AL_7POINT1 0x1506 /* (WFX order) */ rlm@0: rlm@0: /* Storage formats */ rlm@0: #define AL_MONO8 0x1100 rlm@0: #define AL_MONO16 0x1101 rlm@0: #define AL_MONO32F 0x10010 rlm@0: #define AL_STEREO8 0x1102 rlm@0: #define AL_STEREO16 0x1103 rlm@0: #define AL_STEREO32F 0x10011 rlm@0: #define AL_QUAD8 0x1204 rlm@0: #define AL_QUAD16 0x1205 rlm@0: #define AL_QUAD32F 0x1206 rlm@0: #define AL_REAR8 0x1207 rlm@0: #define AL_REAR16 0x1208 rlm@0: #define AL_REAR32F 0x1209 rlm@0: #define AL_5POINT1_8 0x120A rlm@0: #define AL_5POINT1_16 0x120B rlm@0: #define AL_5POINT1_32F 0x120C rlm@0: #define AL_6POINT1_8 0x120D rlm@0: #define AL_6POINT1_16 0x120E rlm@0: #define AL_6POINT1_32F 0x120F rlm@0: #define AL_7POINT1_8 0x1210 rlm@0: #define AL_7POINT1_16 0x1211 rlm@0: #define AL_7POINT1_32F 0x1212 rlm@0: rlm@0: typedef void (AL_APIENTRY*LPALBUFFERSAMPLESSOFT)(ALuint,ALuint,ALenum,ALsizei,ALenum,ALenum,const ALvoid*); rlm@0: typedef void (AL_APIENTRY*LPALBUFFERSUBSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,const ALvoid*); rlm@0: typedef void (AL_APIENTRY*LPALGETBUFFERSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,ALvoid*); rlm@0: typedef ALboolean (AL_APIENTRY*LPALISBUFFERFORMATSUPPORTEDSOFT)(ALenum); rlm@0: #ifdef AL_ALEXT_PROTOTYPES rlm@0: AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer, rlm@0: ALuint samplerate, ALenum internalformat, ALsizei frames, rlm@0: ALenum channels, ALenum type, const ALvoid *data); rlm@0: AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer, rlm@0: ALsizei offset, ALsizei frames, rlm@0: ALenum channels, ALenum type, const ALvoid *data); rlm@0: AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, rlm@0: ALsizei offset, ALsizei frames, rlm@0: ALenum channels, ALenum type, ALvoid *data); rlm@0: AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format); rlm@0: #endif rlm@0: #endif rlm@0: rlm@0: #ifndef AL_SOFT_non_virtual_channels rlm@0: #define AL_SOFT_non_virtual_channels 1 rlm@0: #define AL_VIRTUAL_CHANNELS_SOFT 0x1033 rlm@0: #endif rlm@0: rlm@0: #ifndef AL_SOFT_deferred_updates rlm@0: #define AL_SOFT_deferred_updates 1 rlm@0: #define AL_DEFERRED_UPDATES_SOFT 0xC002 rlm@0: typedef ALvoid (AL_APIENTRY*LPALDEFERUPDATESSOFT)(void); rlm@0: typedef ALvoid (AL_APIENTRY*LPALPROCESSUPDATESSOFT)(void); rlm@0: #ifdef AL_ALEXT_PROTOTYPES rlm@0: AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void); rlm@0: AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void); rlm@0: #endif rlm@0: #endif rlm@0: rlm@0: rlm@0: #if defined(HAVE_STDINT_H) rlm@0: #include rlm@0: typedef int64_t ALint64; rlm@0: typedef uint64_t ALuint64; rlm@0: #elif defined(HAVE___INT64) rlm@0: typedef __int64 ALint64; rlm@0: typedef unsigned __int64 ALuint64; rlm@0: #elif (SIZEOF_LONG == 8) rlm@0: typedef long ALint64; rlm@0: typedef unsigned long ALuint64; rlm@0: #elif (SIZEOF_LONG_LONG == 8) rlm@0: typedef long long ALint64; rlm@0: typedef unsigned long long ALuint64; rlm@0: #endif rlm@0: rlm@0: typedef ptrdiff_t ALintptrEXT; rlm@0: typedef ptrdiff_t ALsizeiptrEXT; rlm@0: rlm@0: #ifdef HAVE_GCC_FORMAT rlm@0: #define PRINTF_STYLE(x, y) __attribute__((format(printf, (x), (y)))) rlm@0: #else rlm@0: #define PRINTF_STYLE(x, y) rlm@0: #endif rlm@0: rlm@0: #if defined(HAVE_RESTRICT) rlm@0: #define RESTRICT restrict rlm@0: #elif defined(HAVE___RESTRICT) rlm@0: #define RESTRICT __restrict rlm@0: #else rlm@0: #define RESTRICT rlm@0: #endif rlm@0: rlm@0: #ifdef _WIN32 rlm@0: rlm@0: #ifndef _WIN32_WINNT rlm@0: #define _WIN32_WINNT 0x0500 rlm@0: #endif rlm@0: #include rlm@0: rlm@0: typedef DWORD tls_type; rlm@0: #define tls_create(x) (*(x) = TlsAlloc()) rlm@0: #define tls_delete(x) TlsFree((x)) rlm@0: #define tls_get(x) TlsGetValue((x)) rlm@0: #define tls_set(x, a) TlsSetValue((x), (a)) rlm@0: rlm@0: #define HAVE_DYNLOAD 1 rlm@0: void *LoadLib(const char *name); rlm@0: void CloseLib(void *handle); rlm@0: void *GetSymbol(void *handle, const char *name); rlm@0: rlm@0: typedef LONG pthread_once_t; rlm@0: #define PTHREAD_ONCE_INIT 0 rlm@0: void pthread_once(pthread_once_t *once, void (*callback)(void)); rlm@0: rlm@0: #else rlm@0: rlm@0: #include rlm@0: #include rlm@0: #include rlm@0: #ifdef HAVE_PTHREAD_NP_H rlm@0: #include rlm@0: #endif rlm@0: #include rlm@0: #include rlm@0: #include rlm@0: rlm@0: #define IsBadWritePtr(a,b) ((a) == NULL && (b) != 0) rlm@0: rlm@0: typedef pthread_key_t tls_type; rlm@0: #define tls_create(x) pthread_key_create((x), NULL) rlm@0: #define tls_delete(x) pthread_key_delete((x)) rlm@0: #define tls_get(x) pthread_getspecific((x)) rlm@0: #define tls_set(x, a) pthread_setspecific((x), (a)) rlm@0: rlm@0: typedef pthread_mutex_t CRITICAL_SECTION; rlm@0: void InitializeCriticalSection(CRITICAL_SECTION *cs); rlm@0: void DeleteCriticalSection(CRITICAL_SECTION *cs); rlm@0: void EnterCriticalSection(CRITICAL_SECTION *cs); rlm@0: void LeaveCriticalSection(CRITICAL_SECTION *cs); rlm@0: rlm@0: ALuint timeGetTime(void); rlm@0: rlm@0: static __inline void Sleep(ALuint t) rlm@0: { rlm@0: struct timespec tv, rem; rlm@0: tv.tv_nsec = (t*1000000)%1000000000; rlm@0: tv.tv_sec = t/1000; rlm@0: rlm@0: while(nanosleep(&tv, &rem) == -1 && errno == EINTR) rlm@0: tv = rem; rlm@0: } rlm@0: rlm@0: #if defined(HAVE_DLFCN_H) rlm@0: #define HAVE_DYNLOAD 1 rlm@0: void *LoadLib(const char *name); rlm@0: void CloseLib(void *handle); rlm@0: void *GetSymbol(void *handle, const char *name); rlm@0: #endif rlm@0: rlm@0: #endif rlm@0: rlm@0: #include "alListener.h" rlm@0: #include "alu.h" rlm@0: rlm@0: #ifdef __cplusplus rlm@0: extern "C" { rlm@0: #endif rlm@0: rlm@0: rlm@0: #define DEFAULT_OUTPUT_RATE (44100) rlm@0: rlm@0: #define SPEEDOFSOUNDMETRESPERSEC (343.3f) rlm@0: #define AIRABSORBGAINHF (0.99426) /* -0.05dB */ rlm@0: rlm@0: #define LOWPASSFREQCUTOFF (5000) rlm@0: rlm@0: rlm@0: // Find the next power-of-2 for non-power-of-2 numbers. rlm@0: static __inline ALuint NextPowerOf2(ALuint value) rlm@0: { rlm@0: ALuint powerOf2 = 1; rlm@0: rlm@0: if(value) rlm@0: { rlm@0: value--; rlm@0: while(value) rlm@0: { rlm@0: value >>= 1; rlm@0: powerOf2 <<= 1; rlm@0: } rlm@0: } rlm@0: return powerOf2; rlm@0: } rlm@0: rlm@0: rlm@0: enum DevProbe { rlm@0: DEVICE_PROBE, rlm@0: ALL_DEVICE_PROBE, rlm@0: CAPTURE_DEVICE_PROBE rlm@0: }; rlm@0: rlm@0: typedef struct { rlm@0: ALCboolean (*OpenPlayback)(ALCdevice*, const ALCchar*); rlm@0: void (*ClosePlayback)(ALCdevice*); rlm@0: ALCboolean (*ResetPlayback)(ALCdevice*); rlm@0: void (*StopPlayback)(ALCdevice*); rlm@0: rlm@0: ALCboolean (*OpenCapture)(ALCdevice*, const ALCchar*); rlm@0: void (*CloseCapture)(ALCdevice*); rlm@0: void (*StartCapture)(ALCdevice*); rlm@0: void (*StopCapture)(ALCdevice*); rlm@0: void (*CaptureSamples)(ALCdevice*, void*, ALCuint); rlm@0: ALCuint (*AvailableSamples)(ALCdevice*); rlm@0: } BackendFuncs; rlm@0: rlm@0: struct BackendInfo { rlm@0: const char *name; rlm@0: ALCboolean (*Init)(BackendFuncs*); rlm@0: void (*Deinit)(void); rlm@0: void (*Probe)(enum DevProbe); rlm@0: BackendFuncs Funcs; rlm@0: }; rlm@0: rlm@0: ALCboolean alc_alsa_init(BackendFuncs *func_list); rlm@0: void alc_alsa_deinit(void); rlm@0: void alc_alsa_probe(enum DevProbe type); rlm@0: ALCboolean alc_oss_init(BackendFuncs *func_list); rlm@0: void alc_oss_deinit(void); rlm@0: void alc_oss_probe(enum DevProbe type); rlm@0: ALCboolean alc_solaris_init(BackendFuncs *func_list); rlm@0: void alc_solaris_deinit(void); rlm@0: void alc_solaris_probe(enum DevProbe type); rlm@0: ALCboolean alc_sndio_init(BackendFuncs *func_list); rlm@0: void alc_sndio_deinit(void); rlm@0: void alc_sndio_probe(enum DevProbe type); rlm@0: ALCboolean alcMMDevApiInit(BackendFuncs *func_list); rlm@0: void alcMMDevApiDeinit(void); rlm@0: void alcMMDevApiProbe(enum DevProbe type); rlm@0: ALCboolean alcDSoundInit(BackendFuncs *func_list); rlm@0: void alcDSoundDeinit(void); rlm@0: void alcDSoundProbe(enum DevProbe type); rlm@0: ALCboolean alcWinMMInit(BackendFuncs *FuncList); rlm@0: void alcWinMMDeinit(void); rlm@0: void alcWinMMProbe(enum DevProbe type); rlm@0: ALCboolean alc_pa_init(BackendFuncs *func_list); rlm@0: void alc_pa_deinit(void); rlm@0: void alc_pa_probe(enum DevProbe type); rlm@0: ALCboolean alc_wave_init(BackendFuncs *func_list); rlm@0: void alc_wave_deinit(void); rlm@0: void alc_wave_probe(enum DevProbe type); rlm@0: ALCboolean alc_pulse_init(BackendFuncs *func_list); rlm@0: void alc_pulse_deinit(void); rlm@0: void alc_pulse_probe(enum DevProbe type); rlm@0: ALCboolean alc_ca_init(BackendFuncs *func_list); rlm@0: void alc_ca_deinit(void); rlm@0: void alc_ca_probe(enum DevProbe type); rlm@0: ALCboolean alc_opensl_init(BackendFuncs *func_list); rlm@0: void alc_opensl_deinit(void); rlm@0: void alc_opensl_probe(enum DevProbe type); rlm@0: ALCboolean alc_null_init(BackendFuncs *func_list); rlm@0: void alc_null_deinit(void); rlm@0: void alc_null_probe(enum DevProbe type); rlm@0: ALCboolean alc_loopback_init(BackendFuncs *func_list); rlm@0: void alc_loopback_deinit(void); rlm@0: void alc_loopback_probe(enum DevProbe type); rlm@0: rlm@0: //RLM: aurellem send device insertion rlm@0: ALCboolean alc_send_init(BackendFuncs *func_list); rlm@0: void alc_send_deinit(void); rlm@0: void alc_send_probe(enum DevProbe type); rlm@0: rlm@0: rlm@0: typedef struct UIntMap { rlm@0: struct { rlm@0: ALuint key; rlm@0: ALvoid *value; rlm@0: } *array; rlm@0: ALsizei size; rlm@0: ALsizei maxsize; rlm@0: } UIntMap; rlm@0: rlm@0: void InitUIntMap(UIntMap *map); rlm@0: void ResetUIntMap(UIntMap *map); rlm@0: ALenum InsertUIntMapEntry(UIntMap *map, ALuint key, ALvoid *value); rlm@0: void RemoveUIntMapKey(UIntMap *map, ALuint key); rlm@0: ALvoid *LookupUIntMapKey(UIntMap *map, ALuint key); rlm@0: rlm@0: /* Device formats */ rlm@0: enum DevFmtType { rlm@0: DevFmtByte = AL_BYTE, rlm@0: DevFmtUByte = AL_UNSIGNED_BYTE, rlm@0: DevFmtShort = AL_SHORT, rlm@0: DevFmtUShort = AL_UNSIGNED_SHORT, rlm@0: DevFmtFloat = AL_FLOAT rlm@0: }; rlm@0: enum DevFmtChannels { rlm@0: DevFmtMono = AL_MONO, rlm@0: DevFmtStereo = AL_STEREO, rlm@0: DevFmtQuad = AL_QUAD, rlm@0: DevFmtX51 = AL_5POINT1, rlm@0: DevFmtX61 = AL_6POINT1, rlm@0: DevFmtX71 = AL_7POINT1, rlm@0: rlm@0: /* Similar to 5.1, except using the side channels instead of back */ rlm@0: DevFmtX51Side = 0x80000000 | AL_5POINT1 rlm@0: }; rlm@0: rlm@0: ALuint BytesFromDevFmt(enum DevFmtType type); rlm@0: ALuint ChannelsFromDevFmt(enum DevFmtChannels chans); rlm@0: static __inline ALuint FrameSizeFromDevFmt(enum DevFmtChannels chans, rlm@0: enum DevFmtType type) rlm@0: { rlm@0: return ChannelsFromDevFmt(chans) * BytesFromDevFmt(type); rlm@0: } rlm@0: rlm@0: rlm@0: extern const struct EffectList { rlm@0: const char *name; rlm@0: int type; rlm@0: const char *ename; rlm@0: ALenum val; rlm@0: } EffectList[]; rlm@0: rlm@0: rlm@0: struct ALCdevice_struct rlm@0: { rlm@0: ALCboolean Connected; rlm@0: ALboolean IsCaptureDevice; rlm@0: ALboolean IsLoopbackDevice; rlm@0: rlm@0: CRITICAL_SECTION Mutex; rlm@0: rlm@0: ALuint Frequency; rlm@0: ALuint UpdateSize; rlm@0: ALuint NumUpdates; rlm@0: enum DevFmtChannels FmtChans; rlm@0: enum DevFmtType FmtType; rlm@0: rlm@0: ALCchar *szDeviceName; rlm@0: rlm@0: ALCenum LastError; rlm@0: rlm@0: // Maximum number of sources that can be created rlm@0: ALuint MaxNoOfSources; rlm@0: // Maximum number of slots that can be created rlm@0: ALuint AuxiliaryEffectSlotMax; rlm@0: rlm@0: ALCuint NumMonoSources; rlm@0: ALCuint NumStereoSources; rlm@0: ALuint NumAuxSends; rlm@0: rlm@0: // Map of Buffers for this device rlm@0: UIntMap BufferMap; rlm@0: rlm@0: // Map of Effects for this device rlm@0: UIntMap EffectMap; rlm@0: rlm@0: // Map of Filters for this device rlm@0: UIntMap FilterMap; rlm@0: rlm@0: // Stereo-to-binaural filter rlm@0: struct bs2b *Bs2b; rlm@0: ALCint Bs2bLevel; rlm@0: rlm@0: // Device flags rlm@0: ALuint Flags; rlm@0: rlm@0: // Dry path buffer mix rlm@0: ALfloat DryBuffer[BUFFERSIZE][MAXCHANNELS]; rlm@0: rlm@0: enum Channel DevChannels[MAXCHANNELS]; rlm@0: rlm@0: enum Channel Speaker2Chan[MAXCHANNELS]; rlm@0: ALfloat PanningLUT[LUT_NUM][MAXCHANNELS]; rlm@0: ALuint NumChan; rlm@0: rlm@0: ALfloat ClickRemoval[MAXCHANNELS]; rlm@0: ALfloat PendingClicks[MAXCHANNELS]; rlm@0: rlm@0: // Contexts created on this device rlm@0: ALCcontext **Contexts; rlm@0: ALuint NumContexts; rlm@0: rlm@0: BackendFuncs *Funcs; rlm@0: void *ExtraData; // For the backend's use rlm@0: rlm@0: ALCdevice *next; rlm@0: }; rlm@0: rlm@0: #define ALCdevice_OpenPlayback(a,b) ((a)->Funcs->OpenPlayback((a), (b))) rlm@0: #define ALCdevice_ClosePlayback(a) ((a)->Funcs->ClosePlayback((a))) rlm@0: #define ALCdevice_ResetPlayback(a) ((a)->Funcs->ResetPlayback((a))) rlm@0: #define ALCdevice_StopPlayback(a) ((a)->Funcs->StopPlayback((a))) rlm@0: #define ALCdevice_OpenCapture(a,b) ((a)->Funcs->OpenCapture((a), (b))) rlm@0: #define ALCdevice_CloseCapture(a) ((a)->Funcs->CloseCapture((a))) rlm@0: #define ALCdevice_StartCapture(a) ((a)->Funcs->StartCapture((a))) rlm@0: #define ALCdevice_StopCapture(a) ((a)->Funcs->StopCapture((a))) rlm@0: #define ALCdevice_CaptureSamples(a,b,c) ((a)->Funcs->CaptureSamples((a), (b), (c))) rlm@0: #define ALCdevice_AvailableSamples(a) ((a)->Funcs->AvailableSamples((a))) rlm@0: rlm@0: // Duplicate stereo sources on the side/rear channels rlm@0: #define DEVICE_DUPLICATE_STEREO (1<<0) rlm@0: // Use HRTF filters for mixing sounds rlm@0: #define DEVICE_USE_HRTF (1<<1) rlm@0: // Frequency was requested by the app or config file rlm@0: #define DEVICE_FREQUENCY_REQUEST (1<<2) rlm@0: // Channel configuration was requested by the config file rlm@0: #define DEVICE_CHANNELS_REQUEST (1<<3) rlm@0: rlm@0: // Specifies if the device is currently running rlm@0: #define DEVICE_RUNNING (1<<31) rlm@0: rlm@0: struct ALCcontext_struct rlm@0: { rlm@0: ALlistener Listener; rlm@0: rlm@0: UIntMap SourceMap; rlm@0: UIntMap EffectSlotMap; rlm@0: rlm@0: ALenum LastError; rlm@0: rlm@0: ALboolean UpdateSources; rlm@0: rlm@0: enum DistanceModel DistanceModel; rlm@0: ALboolean SourceDistanceModel; rlm@0: rlm@0: ALfloat DopplerFactor; rlm@0: ALfloat DopplerVelocity; rlm@0: ALfloat flSpeedOfSound; rlm@0: ALboolean DeferUpdates; rlm@0: rlm@0: struct ALsource **ActiveSources; rlm@0: ALsizei ActiveSourceCount; rlm@0: ALsizei MaxActiveSources; rlm@0: rlm@0: ALCdevice *Device; rlm@0: const ALCchar *ExtensionList; rlm@0: rlm@0: ALCcontext *next; rlm@0: }; rlm@0: rlm@0: void AppendDeviceList(const ALCchar *name); rlm@0: void AppendAllDeviceList(const ALCchar *name); rlm@0: void AppendCaptureDeviceList(const ALCchar *name); rlm@0: rlm@0: ALCvoid alcSetError(ALCdevice *device, ALenum errorCode); rlm@0: rlm@0: ALCvoid LockDevice(ALCdevice *device); rlm@0: ALCvoid UnlockDevice(ALCdevice *device); rlm@0: ALCvoid LockContext(ALCcontext *context); rlm@0: ALCvoid UnlockContext(ALCcontext *context); rlm@0: rlm@0: ALvoid *StartThread(ALuint (*func)(ALvoid*), ALvoid *ptr); rlm@0: ALuint StopThread(ALvoid *thread); rlm@0: rlm@0: ALCcontext *GetLockedContext(void); rlm@0: rlm@0: typedef struct RingBuffer RingBuffer; rlm@0: RingBuffer *CreateRingBuffer(ALsizei frame_size, ALsizei length); rlm@0: void DestroyRingBuffer(RingBuffer *ring); rlm@0: ALsizei RingBufferSize(RingBuffer *ring); rlm@0: void WriteRingBuffer(RingBuffer *ring, const ALubyte *data, ALsizei len); rlm@0: void ReadRingBuffer(RingBuffer *ring, ALubyte *data, ALsizei len); rlm@0: rlm@0: void ReadALConfig(void); rlm@0: void FreeALConfig(void); rlm@0: int ConfigValueExists(const char *blockName, const char *keyName); rlm@0: const char *GetConfigValue(const char *blockName, const char *keyName, const char *def); rlm@0: int GetConfigValueInt(const char *blockName, const char *keyName, int def); rlm@0: float GetConfigValueFloat(const char *blockName, const char *keyName, float def); rlm@0: int GetConfigValueBool(const char *blockName, const char *keyName, int def); rlm@0: rlm@0: void SetRTPriority(void); rlm@0: rlm@0: void SetDefaultChannelOrder(ALCdevice *device); rlm@0: void SetDefaultWFXChannelOrder(ALCdevice *device); rlm@0: rlm@0: const ALCchar *DevFmtTypeString(enum DevFmtType type); rlm@0: const ALCchar *DevFmtChannelsString(enum DevFmtChannels chans); rlm@0: rlm@0: #define HRIR_BITS (5) rlm@0: #define HRIR_LENGTH (1<= LogTrace) \ rlm@0: AL_PRINT(__VA_ARGS__); \ rlm@0: } while(0) rlm@0: rlm@0: #define WARN(...) do { \ rlm@0: if(LogLevel >= LogWarning) \ rlm@0: AL_PRINT(__VA_ARGS__); \ rlm@0: } while(0) rlm@0: rlm@0: #define ERR(...) do { \ rlm@0: if(LogLevel >= LogError) \ rlm@0: AL_PRINT(__VA_ARGS__); \ rlm@0: } while(0) rlm@0: rlm@0: rlm@0: extern ALdouble ConeScale; rlm@0: extern ALdouble ZScale; rlm@0: rlm@0: extern ALint RTPrioLevel; rlm@0: rlm@0: #ifdef __cplusplus rlm@0: } rlm@0: #endif rlm@0: rlm@0: #endif