Allocate enough reverb panning gains
[openal-soft.git] / examples / common / alhelpers.h
blob1b4d2fbf64c0e299ce0c1f4f90a266ba237331a4
1 #ifndef ALHELPERS_H
2 #define ALHELPERS_H
4 #include "AL/alc.h"
5 #include "AL/al.h"
6 #include "AL/alext.h"
8 #include "threads.h"
10 #ifdef __cplusplus
11 extern "C" {
12 #endif /* __cplusplus */
14 /* Some helper functions to get the name from the channel and type enums. */
15 const char *ChannelsName(ALenum chans);
16 const char *TypeName(ALenum type);
18 /* Helpers to convert frame counts and byte lengths. */
19 ALsizei FramesToBytes(ALsizei size, ALenum channels, ALenum type);
20 ALsizei BytesToFrames(ALsizei size, ALenum channels, ALenum type);
22 /* Retrieves a compatible buffer format given the channel configuration and
23 * sample type. If an alIsBufferFormatSupportedSOFT-compatible function is
24 * provided, it will be called to find the closest-matching format from
25 * AL_SOFT_buffer_samples. Returns AL_NONE (0) if no supported format can be
26 * found. */
27 ALenum GetFormat(ALenum channels, ALenum type, LPALISBUFFERFORMATSUPPORTEDSOFT palIsBufferFormatSupportedSOFT);
29 /* Loads samples into a buffer using the standard alBufferData call, but with a
30 * LPALBUFFERSAMPLESSOFT-compatible prototype. Assumes internalformat is valid
31 * for alBufferData, and that channels and type match it. */
32 void AL_APIENTRY wrap_BufferSamples(ALuint buffer, ALuint samplerate,
33 ALenum internalformat, ALsizei samples,
34 ALenum channels, ALenum type,
35 const ALvoid *data);
37 /* Easy device init/deinit functions. InitAL returns 0 on success. */
38 int InitAL(void);
39 void CloseAL(void);
41 #ifdef __cplusplus
43 #endif /* __cplusplus */
45 #endif /* ALHELPERS_H */