120 lines
2.5 KiB
C
Raw Normal View History

2007-11-13 18:02:18 -08:00
#ifndef _AL_SOURCE_H_
#define _AL_SOURCE_H_
2012-09-14 02:42:36 -07:00
#include "alMain.h"
#include "alu.h"
#include "hrtf.h"
#include "atomic.h"
2007-11-13 18:02:18 -08:00
#define MAX_SENDS 16
#define DEFAULT_SENDS 2
2007-11-13 18:02:18 -08:00
#ifdef __cplusplus
extern "C" {
#endif
struct ALbuffer;
struct ALsource;
typedef struct ALbufferlistitem {
ATOMIC(struct ALbufferlistitem*) next;
ALsizei max_samples;
ALsizei num_buffers;
struct ALbuffer *buffers[];
2007-11-13 18:02:18 -08:00
} ALbufferlistitem;
typedef struct ALsource {
2012-04-26 03:26:22 -07:00
/** Source properties. */
ALfloat Pitch;
ALfloat Gain;
ALfloat OuterGain;
ALfloat MinGain;
ALfloat MaxGain;
ALfloat InnerAngle;
ALfloat OuterAngle;
ALfloat RefDistance;
ALfloat MaxDistance;
2017-05-05 03:19:50 -07:00
ALfloat RolloffFactor;
ALfloat Position[3];
ALfloat Velocity[3];
ALfloat Direction[3];
ALfloat Orientation[2][3];
ALboolean HeadRelative;
ALboolean Looping;
DistanceModel mDistanceModel;
enum Resampler Resampler;
ALboolean DirectChannels;
enum SpatializeMode Spatialize;
ALboolean DryGainHFAuto;
ALboolean WetGainAuto;
ALboolean WetGainHFAuto;
ALfloat OuterGainHF;
ALfloat AirAbsorptionFactor;
ALfloat RoomRolloffFactor;
ALfloat DopplerFactor;
2016-03-25 14:40:44 -07:00
/* NOTE: Stereo pan angles are specified in radians, counter-clockwise
* rather than clockwise.
*/
ALfloat StereoPan[2];
2016-03-25 14:40:44 -07:00
ALfloat Radius;
2016-05-14 23:43:40 -07:00
/** Direct filter and auxiliary send info. */
struct {
ALfloat Gain;
ALfloat GainHF;
ALfloat HFReference;
ALfloat GainLF;
ALfloat LFReference;
} Direct;
struct {
struct ALeffectslot *Slot;
ALfloat Gain;
ALfloat GainHF;
ALfloat HFReference;
ALfloat GainLF;
ALfloat LFReference;
} *Send;
2016-05-14 23:43:40 -07:00
2012-04-26 03:26:22 -07:00
/**
* Last user-specified offset, and the offset type (bytes, samples, or
* seconds).
*/
ALdouble Offset;
ALenum OffsetType;
2007-11-13 18:02:18 -08:00
2012-04-26 03:26:22 -07:00
/** Source type (static, streaming, or undetermined) */
ALint SourceType;
2007-11-13 18:02:18 -08:00
2012-04-26 03:26:22 -07:00
/** Source state (initial, playing, paused, or stopped) */
2018-02-24 09:44:52 -08:00
ALenum state;
2012-04-26 03:26:22 -07:00
/** Source Buffer Queue head. */
ALbufferlistitem *queue;
std::atomic_flag PropsClean{true};
/* Index into the context's Voices array. Lazily updated, only checked and
* reset when looking up the voice.
*/
ALint VoiceIdx;
2012-04-26 03:26:22 -07:00
/** Self ID */
ALuint id;
2007-11-13 18:02:18 -08:00
} ALsource;
2016-05-14 23:43:40 -07:00
void UpdateAllSourceProps(ALCcontext *context);
ALvoid ReleaseALSources(ALCcontext *Context);
2007-11-13 18:02:18 -08:00
#ifdef __cplusplus
}
#endif
#endif