//
// Generated by Brutal.OpenAl.Generate; do not edit by hand.
#nullable enable
using static Brutal.OpenAlApi.Al.Constants;
namespace Brutal.OpenAlApi
{
public readonly unsafe partial struct AlSource
{
///
/// Source or listener gain.
///
///
///
/// Gets/sets AL_GAIN (alSourcef/alGetSourcef).
///
///
/// For sources, an initial linear gain value (before attenuation is applied). For the listener, an output
/// linear gain adjustment.
///
///
/// A value of 1.0 means unattenuated. Each division by 2 equals an attenuation of about -6dB. Each
/// multiplication by 2 equals an amplification of about +6dB.
///
///
/// Type ALfloat; minimum 0.0.
///
///
public float Gain
{
get => Al.GetSourcef(Name, AL_GAIN);
set => Al.PInvoke.Sourcef(Name, AL_GAIN, value);
}
///
/// Source pitch.
///
///
///
/// Gets/sets AL_PITCH (alSourcef/alGetSourcef).
///
///
/// A multiplier for the sample rate of the source's buffer.
///
///
/// Type ALfloat; range 0.5 to 2.0; default 1.0.
///
///
public float Pitch
{
get => Al.GetSourcef(Name, AL_PITCH);
set => Al.PInvoke.Sourcef(Name, AL_PITCH, value);
}
///
/// Minimum source gain.
///
///
///
/// Gets/sets AL_MIN_GAIN (alSourcef/alGetSourcef).
///
///
/// The minimum gain allowed for a source, after distance and cone attenuation are applied (if applicable).
///
///
/// Type ALfloat; range 0.0 to 1.0.
///
///
public float MinGain
{
get => Al.GetSourcef(Name, AL_MIN_GAIN);
set => Al.PInvoke.Sourcef(Name, AL_MIN_GAIN, value);
}
///
/// Maximum source gain.
///
///
///
/// Gets/sets AL_MAX_GAIN (alSourcef/alGetSourcef).
///
///
/// The maximum gain allowed for a source, after distance and cone attenuation are applied (if applicable).
///
///
/// Type ALfloat; range 0.0 to 1.0.
///
///
public float MaxGain
{
get => Al.GetSourcef(Name, AL_MAX_GAIN);
set => Al.PInvoke.Sourcef(Name, AL_MAX_GAIN, value);
}
///
/// Source maximum distance.
///
///
///
/// Gets/sets AL_MAX_DISTANCE (alSourcef/alGetSourcef).
///
///
/// The distance above which the source is not attenuated any further with a clamped distance model, or
/// where attenuation reaches 0.0 gain for linear distance models with a default rolloff factor.
///
///
/// Type ALfloat; minimum 0.0; default FLT_MAX.
///
///
public float MaxDistance
{
get => Al.GetSourcef(Name, AL_MAX_DISTANCE);
set => Al.PInvoke.Sourcef(Name, AL_MAX_DISTANCE, value);
}
///
/// Source rolloff factor.
///
///
///
/// Gets/sets AL_ROLLOFF_FACTOR (alSourcef/alGetSourcef).
///
///
/// Multiplier to exaggerate or diminish distance attenuation.
///
///
/// At 0.0, no distance attenuation ever occurs.
///
///
/// Type ALfloat; minimum 0.0; default 1.0.
///
///
public float RolloffFactor
{
get => Al.GetSourcef(Name, AL_ROLLOFF_FACTOR);
set => Al.PInvoke.Sourcef(Name, AL_ROLLOFF_FACTOR, value);
}
///
/// Source reference distance.
///
///
///
/// Gets/sets AL_REFERENCE_DISTANCE (alSourcef/alGetSourcef).
///
///
/// The distance in units that no distance attenuation occurs.
///
///
/// At 0.0, no distance attenuation occurs with non-linear attenuation models.
///
///
/// Type ALfloat; minimum 0.0; default 1.0.
///
///
public float ReferenceDistance
{
get => Al.GetSourcef(Name, AL_REFERENCE_DISTANCE);
set => Al.PInvoke.Sourcef(Name, AL_REFERENCE_DISTANCE, value);
}
///
/// Outer cone gain.
///
///
///
/// Gets/sets AL_CONE_OUTER_GAIN (alSourcef/alGetSourcef).
///
///
/// The gain attenuation applied when the listener is outside of the source's outer cone angle.
///
///
/// Type ALfloat; range 0.0 to 1.0; default 0.0.
///
///
public float ConeOuterGain
{
get => Al.GetSourcef(Name, AL_CONE_OUTER_GAIN);
set => Al.PInvoke.Sourcef(Name, AL_CONE_OUTER_GAIN, value);
}
///
/// Inner cone angle, in degrees.
///
///
///
/// Gets/sets AL_CONE_INNER_ANGLE (alSourcef/alGetSourcef).
///
///
/// The angle covered by the inner cone, the area within which the source will not be attenuated by
/// direction.
///
///
/// Type ALint/ALfloat; range 0 to 360; default 360.
///
///
public float ConeInnerAngle
{
get => Al.GetSourcef(Name, AL_CONE_INNER_ANGLE);
set => Al.PInvoke.Sourcef(Name, AL_CONE_INNER_ANGLE, value);
}
///
/// Outer cone angle, in degrees.
///
///
///
/// Gets/sets AL_CONE_OUTER_ANGLE (alSourcef/alGetSourcef).
///
///
/// The angle covered by the outer cone, the area outside of which the source will be fully attenuated by
/// direction.
///
///
/// Type ALint/ALfloat; range 0 to 360; default 360.
///
///
public float ConeOuterAngle
{
get => Al.GetSourcef(Name, AL_CONE_OUTER_ANGLE);
set => Al.PInvoke.Sourcef(Name, AL_CONE_OUTER_ANGLE, value);
}
///
/// Source buffer offset, in seconds.
///
///
///
/// Gets/sets AL_SEC_OFFSET (alSourcef/alGetSourcef).
///
///
/// Type ALfloat/ALint; minimum 0.
///
///
public float SecOffset
{
get => Al.GetSourcef(Name, AL_SEC_OFFSET);
set => Al.PInvoke.Sourcef(Name, AL_SEC_OFFSET, value);
}
///
/// Source buffer offset, in sample frames.
///
///
///
/// Gets/sets AL_SAMPLE_OFFSET (alSourcei/alGetSourcei).
///
///
/// Type ALint; minimum 0.
///
///
public int SampleOffset
{
get => Al.GetSourcei(Name, AL_SAMPLE_OFFSET);
set => Al.PInvoke.Sourcei(Name, AL_SAMPLE_OFFSET, value);
}
///
/// Source buffer offset, in bytes.
///
///
///
/// Gets/sets AL_BYTE_OFFSET (alSourcei/alGetSourcei).
///
///
/// Type ALint; minimum 0.
///
///
public int ByteOffset
{
get => Al.GetSourcei(Name, AL_BYTE_OFFSET);
set => Al.PInvoke.Sourcei(Name, AL_BYTE_OFFSET, value);
}
///
/// Source or listener position.
///
///
///
/// Gets/sets AL_POSITION (alSource3f/alGetSource3f).
///
///
/// The source or listener location in three dimensional space.
///
///
/// OpenAL uses a right handed coordinate system, like OpenGL, where with a default view, X points right
/// (thumb), Y points up (index finger), and Z points towards the viewer/camera (middle finger).
///
///
/// To change from or to a left handed coordinate system, negate the Z component.
///
///
/// Type ALfloat[3]/ALint[3]; default 0,0,0.
///
///
public float3 Position
{
get => Al.GetSource3f(Name, AL_POSITION);
set => Al.PInvoke.Source3f(Name, AL_POSITION, value.X, value.Y, value.Z);
}
///
/// Source or listener velocity.
///
///
///
/// Gets/sets AL_VELOCITY (alSource3f/alGetSource3f).
///
///
/// Specifies the current velocity, relative to the position.
///
///
/// To change from or to a left handed coordinate system, negate the Z component.
///
///
/// Type ALfloat[3]/ALint[3]; default 0,0,0.
///
///
public float3 Velocity
{
get => Al.GetSource3f(Name, AL_VELOCITY);
set => Al.PInvoke.Source3f(Name, AL_VELOCITY, value.X, value.Y, value.Z);
}
///
/// Source direction.
///
///
///
/// Gets/sets AL_DIRECTION (alSource3f/alGetSource3f).
///
///
/// Specifies the current direction in local space. A zero-length vector specifies an omni-directional
/// source (cone is ignored).
///
///
/// To change from or to a left handed coordinate system, negate the Z component.
///
///
/// Type ALfloat[3]/ALint[3]; default 0,0,0.
///
///
public float3 Direction
{
get => Al.GetSource3f(Name, AL_DIRECTION);
set => Al.PInvoke.Source3f(Name, AL_DIRECTION, value.X, value.Y, value.Z);
}
///
/// Source looping.
///
///
///
/// Gets/sets AL_LOOPING (alSourcei/alGetSourcei).
///
///
/// Specifies whether source playback loops.
///
///
/// Type ALboolean; default AL_FALSE.
///
///
public bool Looping
{
get => Al.GetSourcei(Name, AL_LOOPING) != AL_FALSE;
set => Al.PInvoke.Sourcei(Name, AL_LOOPING, value ? AL_TRUE : AL_FALSE);
}
///
/// Relative source.
///
///
///
/// Gets/sets AL_SOURCE_RELATIVE (alSourcei/alGetSourcei).
///
///
/// Specifies if the source uses relative coordinates.
///
///
/// Type ALboolean; default AL_FALSE.
///
///
public bool SourceRelative
{
get => Al.GetSourcei(Name, AL_SOURCE_RELATIVE) != AL_FALSE;
set => Al.PInvoke.Sourcei(Name, AL_SOURCE_RELATIVE, value ? AL_TRUE : AL_FALSE);
}
///
/// Source buffer.
///
///
///
/// Gets/sets AL_BUFFER (alSourcei/alGetSourcei).
///
///
/// Specifies the buffer to provide sound samples for a source.
///
///
/// Type ALuint; default AL_NONE.
///
///
public AlBuffer Buffer
{
get => new AlBuffer((uint)Al.GetSourcei(Name, AL_BUFFER));
set => Al.PInvoke.Sourcei(Name, AL_BUFFER, (int)value.Name);
}
///
/// Source state (query only).
///
///
///
/// Gets AL_SOURCE_STATE (alGetSourcei).
///
///
/// Type ALenum.
///
///
public AlSourceState State
{
get => (AlSourceState)Al.GetSourcei(Name, AL_SOURCE_STATE);
}
///
/// Source type (query only).
///
///
///
/// Gets AL_SOURCE_TYPE (alGetSourcei).
///
///
/// A Source is Static if a Buffer has been attached using AL_BUFFER.
///
///
/// A Source is Streaming if one or more Buffers have been attached using alSourceQueueBuffers.
///
///
/// A Source is Undetermined when it has the NULL buffer attached using AL_BUFFER.
///
///
/// Type ALenum.
///
///
public AlSourceType Type
{
get => (AlSourceType)Al.GetSourcei(Name, AL_SOURCE_TYPE);
}
///
/// Source Buffer Queue size (query only).
///
///
///
/// Gets AL_BUFFERS_QUEUED (alGetSourcei).
///
///
/// The number of buffers queued using alSourceQueueBuffers, minus the buffers removed with
/// alSourceUnqueueBuffers.
///
///
/// Type ALint.
///
///
public int BuffersQueued
{
get => Al.GetSourcei(Name, AL_BUFFERS_QUEUED);
}
///
/// Source Buffer Queue processed count (query only).
///
///
///
/// Gets AL_BUFFERS_PROCESSED (alGetSourcei).
///
///
/// The number of queued buffers that have been fully processed, and can be removed with
/// alSourceUnqueueBuffers.
///
///
/// Looping sources will never fully process buffers because they will be set to play again for when the
/// source loops.
///
///
/// Type ALint.
///
///
public int BuffersProcessed
{
get => Al.GetSourcei(Name, AL_BUFFERS_PROCESSED);
}
///
/// Sets AL_DIRECT_FILTER (alSourcei).
///
///
///
/// Type ALuint; default AL_FILTER_NULL.
///
///
/// Set-only, as in the EFX spec: assignment copies the filter's parameters into the source, and native OpenAL keeps no record of which filter object they came from.
///
///
public AlFilter DirectFilter
{
set => Al.PInvoke.Sourcei(Name, AL_DIRECT_FILTER, (int)value.Name);
}
///
/// Gets/sets AL_AIR_ABSORPTION_FACTOR (alSourcef/alGetSourcef).
///
///
///
/// Type ALuint; range 0 to 10; default 0.
///
///
public float AirAbsorptionFactor
{
get => Al.GetSourcef(Name, AL_AIR_ABSORPTION_FACTOR);
set => Al.PInvoke.Sourcef(Name, AL_AIR_ABSORPTION_FACTOR, value);
}
///
/// Gets/sets AL_ROOM_ROLLOFF_FACTOR (alSourcef/alGetSourcef).
///
///
///
/// Type ALuint; range 0 to 10; default 0.
///
///
public float RoomRolloffFactor
{
get => Al.GetSourcef(Name, AL_ROOM_ROLLOFF_FACTOR);
set => Al.PInvoke.Sourcef(Name, AL_ROOM_ROLLOFF_FACTOR, value);
}
///
/// Gets/sets AL_CONE_OUTER_GAINHF (alSourcef/alGetSourcef).
///
///
///
/// Type ALfloat; range 0.0 to 1.0; default 1.0.
///
///
public float ConeOuterGainHf
{
get => Al.GetSourcef(Name, AL_CONE_OUTER_GAINHF);
set => Al.PInvoke.Sourcef(Name, AL_CONE_OUTER_GAINHF, value);
}
///
/// Gets/sets AL_DIRECT_FILTER_GAINHF_AUTO (alSourcei/alGetSourcei).
///
///
///
/// Type ALboolean; default AL_TRUE.
///
///
public bool DirectFilterGainHfAuto
{
get => Al.GetSourcei(Name, AL_DIRECT_FILTER_GAINHF_AUTO) != AL_FALSE;
set => Al.PInvoke.Sourcei(Name, AL_DIRECT_FILTER_GAINHF_AUTO, value ? AL_TRUE : AL_FALSE);
}
///
/// Gets/sets AL_AUXILIARY_SEND_FILTER_GAIN_AUTO (alSourcei/alGetSourcei).
///
///
///
/// Type ALboolean; default AL_TRUE.
///
///
public bool AuxiliarySendFilterGainAuto
{
get => Al.GetSourcei(Name, AL_AUXILIARY_SEND_FILTER_GAIN_AUTO) != AL_FALSE;
set => Al.PInvoke.Sourcei(Name, AL_AUXILIARY_SEND_FILTER_GAIN_AUTO, value ? AL_TRUE : AL_FALSE);
}
///
/// Gets/sets AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO (alSourcei/alGetSourcei).
///
///
///
/// Type ALboolean; default AL_TRUE.
///
///
public bool AuxiliarySendFilterGainHfAuto
{
get => Al.GetSourcei(Name, AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO) != AL_FALSE;
set => Al.PInvoke.Sourcei(Name, AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO, value ? AL_TRUE : AL_FALSE);
}
///
/// Gets/sets AL_SOURCE_RADIUS (alSourcef/alGetSourcef).
///
///
///
/// Type ALfloat.
///
///
public float SourceRadius
{
get => Al.GetSourcef(Name, AL_SOURCE_RADIUS);
set => Al.PInvoke.Sourcef(Name, AL_SOURCE_RADIUS, value);
}
///
/// Gets/sets AL_SOURCE_DISTANCE_MODEL (alSourcei/alGetSourcei).
///
public AlDistanceModel DistanceModel
{
get => (AlDistanceModel)Al.GetSourcei(Name, AL_SOURCE_DISTANCE_MODEL);
set => Al.PInvoke.Sourcei(Name, AL_SOURCE_DISTANCE_MODEL, (int)value);
}
///
/// Gets/sets AL_DIRECT_CHANNELS_SOFT (alSourcei/alGetSourcei).
///
///
///
/// Type ALenum; default AL_FALSE.
///
///
public AlDirectChannelsMode DirectChannels
{
get => (AlDirectChannelsMode)Al.GetSourcei(Name, AL_DIRECT_CHANNELS_SOFT);
set => Al.PInvoke.Sourcei(Name, AL_DIRECT_CHANNELS_SOFT, (int)value);
}
///
/// Gets/sets AL_SOURCE_SPATIALIZE_SOFT (alSourcei/alGetSourcei).
///
///
///
/// Type ALenum; default AL_AUTO_SOFT.
///
///
public AlSpatializeMode Spatialize
{
get => (AlSpatializeMode)Al.GetSourcei(Name, AL_SOURCE_SPATIALIZE_SOFT);
set => Al.PInvoke.Sourcei(Name, AL_SOURCE_SPATIALIZE_SOFT, (int)value);
}
///
/// Gets/sets AL_SOURCE_RESAMPLER_SOFT (alSourcei/alGetSourcei).
///
///
///
/// Type ALint.
///
///
public int Resampler
{
get => Al.GetSourcei(Name, AL_SOURCE_RESAMPLER_SOFT);
set => Al.PInvoke.Sourcei(Name, AL_SOURCE_RESAMPLER_SOFT, value);
}
///
/// Gets/sets AL_STEREO_MODE_SOFT (alSourcei/alGetSourcei).
///
///
///
/// Type ALenum; default AL_NORMAL_SOFT.
///
///
public AlStereoMode StereoMode
{
get => (AlStereoMode)Al.GetSourcei(Name, AL_STEREO_MODE_SOFT);
set => Al.PInvoke.Sourcei(Name, AL_STEREO_MODE_SOFT, (int)value);
}
///
/// Gets/sets AL_SUPER_STEREO_WIDTH_SOFT (alSourcef/alGetSourcef).
///
///
///
/// Type ALfloat; range 0.0 to 1.0.
///
///
public float SuperStereoWidth
{
get => Al.GetSourcef(Name, AL_SUPER_STEREO_WIDTH_SOFT);
set => Al.PInvoke.Sourcef(Name, AL_SUPER_STEREO_WIDTH_SOFT, value);
}
///
/// Gets/sets AL_STEREO_ANGLES (alSourcefv/alGetSourcefv).
///
///
///
/// Type ALfloat.
///
///
public float2 StereoAngles
{
get => Al.GetSourcefv2(Name, AL_STEREO_ANGLES);
set => Al.SetSourcefv2(Name, AL_STEREO_ANGLES, value);
}
///
/// Gets AL_BYTE_LENGTH_SOFT (alGetSourcei).
///
///
///
/// Type ALint.
///
///
public int ByteLength
{
get => Al.GetSourcei(Name, AL_BYTE_LENGTH_SOFT);
}
///
/// Gets AL_SAMPLE_LENGTH_SOFT (alGetSourcei).
///
///
///
/// Type ALint.
///
///
public int SampleLength
{
get => Al.GetSourcei(Name, AL_SAMPLE_LENGTH_SOFT);
}
///
/// Gets AL_SEC_LENGTH_SOFT (alGetSourcef).
///
///
///
/// Type ALfloat.
///
///
public float SecLength
{
get => Al.GetSourcef(Name, AL_SEC_LENGTH_SOFT);
}
}
}