mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
246 lines
8.9 KiB
C#
246 lines
8.9 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.OpenAl.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
using static Brutal.OpenAlApi.Al.Constants;
|
|
|
|
namespace Brutal.OpenAlApi
|
|
{
|
|
/// <summary>
|
|
/// The typed parameter surface of an <c>AL_EFFECT_REVERB</c> effect (see <see cref="AlEffect"/>); requires <c>ALC_EXT_EFX</c>.
|
|
/// </summary>
|
|
public unsafe readonly partial struct ReverbEffect
|
|
{
|
|
/// <summary>
|
|
/// The underlying effect handle.
|
|
/// </summary>
|
|
public readonly AlEffect Effect;
|
|
|
|
/// <summary>
|
|
/// Wraps an effect handle without validating its type; prefer the checked conversion.
|
|
/// </summary>
|
|
public ReverbEffect(AlEffect effect) => Effect = effect;
|
|
|
|
/// <summary>
|
|
/// The wrapper converts freely to its underlying handle.
|
|
/// </summary>
|
|
public static implicit operator AlEffect(ReverbEffect effect) => effect.Effect;
|
|
|
|
/// <summary>
|
|
/// Converts a raw handle to the typed wrapper, checking <see cref="AlEffect.Type"/>.
|
|
/// </summary>
|
|
/// <exception cref="InvalidCastException">
|
|
/// The effect's type is not <see cref="AlEffectType.Reverb"/>.</exception>
|
|
public static explicit operator ReverbEffect(AlEffect effect) =>
|
|
effect.Type == AlEffectType.Reverb
|
|
? new ReverbEffect(effect)
|
|
: throw new InvalidCastException($"Effect {effect.Name} has type {effect.Type}, not Reverb.");
|
|
|
|
/// <summary>
|
|
/// Deletes the underlying effect (<see cref="AlEffect.Delete"/>).
|
|
/// </summary>
|
|
public void Delete() => Effect.Delete();
|
|
|
|
/// <summary>
|
|
/// Gets/sets <c>AL_REVERB_DENSITY</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// range 0.0f to 1.0f; default 1.0f.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float Density
|
|
{
|
|
get => Al.GetEffectf(Effect.Name, AL_REVERB_DENSITY);
|
|
set => Al.PInvoke.Effectf(Effect.Name, AL_REVERB_DENSITY, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets/sets <c>AL_REVERB_DIFFUSION</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// range 0.0f to 1.0f; default 1.0f.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float Diffusion
|
|
{
|
|
get => Al.GetEffectf(Effect.Name, AL_REVERB_DIFFUSION);
|
|
set => Al.PInvoke.Effectf(Effect.Name, AL_REVERB_DIFFUSION, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets/sets <c>AL_REVERB_GAIN</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// range 0.0f to 1.0f; default 0.32f.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float Gain
|
|
{
|
|
get => Al.GetEffectf(Effect.Name, AL_REVERB_GAIN);
|
|
set => Al.PInvoke.Effectf(Effect.Name, AL_REVERB_GAIN, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets/sets <c>AL_REVERB_GAINHF</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// range 0.0f to 1.0f; default 0.89f.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float GainHf
|
|
{
|
|
get => Al.GetEffectf(Effect.Name, AL_REVERB_GAINHF);
|
|
set => Al.PInvoke.Effectf(Effect.Name, AL_REVERB_GAINHF, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets/sets <c>AL_REVERB_DECAY_TIME</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// range 0.1f to 20.0f; default 1.49f.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float DecayTime
|
|
{
|
|
get => Al.GetEffectf(Effect.Name, AL_REVERB_DECAY_TIME);
|
|
set => Al.PInvoke.Effectf(Effect.Name, AL_REVERB_DECAY_TIME, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets/sets <c>AL_REVERB_DECAY_HFRATIO</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// range 0.1f to 2.0f; default 0.83f.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float DecayHfRatio
|
|
{
|
|
get => Al.GetEffectf(Effect.Name, AL_REVERB_DECAY_HFRATIO);
|
|
set => Al.PInvoke.Effectf(Effect.Name, AL_REVERB_DECAY_HFRATIO, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets/sets <c>AL_REVERB_REFLECTIONS_GAIN</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// range 0.0f to 3.16f; default 0.05f.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float ReflectionsGain
|
|
{
|
|
get => Al.GetEffectf(Effect.Name, AL_REVERB_REFLECTIONS_GAIN);
|
|
set => Al.PInvoke.Effectf(Effect.Name, AL_REVERB_REFLECTIONS_GAIN, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets/sets <c>AL_REVERB_REFLECTIONS_DELAY</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// range 0.0f to 0.3f; default 0.007f.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float ReflectionsDelay
|
|
{
|
|
get => Al.GetEffectf(Effect.Name, AL_REVERB_REFLECTIONS_DELAY);
|
|
set => Al.PInvoke.Effectf(Effect.Name, AL_REVERB_REFLECTIONS_DELAY, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets/sets <c>AL_REVERB_LATE_REVERB_GAIN</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// range 0.0f to 10.0f; default 1.26f.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float LateReverbGain
|
|
{
|
|
get => Al.GetEffectf(Effect.Name, AL_REVERB_LATE_REVERB_GAIN);
|
|
set => Al.PInvoke.Effectf(Effect.Name, AL_REVERB_LATE_REVERB_GAIN, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets/sets <c>AL_REVERB_LATE_REVERB_DELAY</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// range 0.0f to 0.1f; default 0.011f.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float LateReverbDelay
|
|
{
|
|
get => Al.GetEffectf(Effect.Name, AL_REVERB_LATE_REVERB_DELAY);
|
|
set => Al.PInvoke.Effectf(Effect.Name, AL_REVERB_LATE_REVERB_DELAY, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets/sets <c>AL_REVERB_AIR_ABSORPTION_GAINHF</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// range 0.892f to 1.0f; default 0.994f.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float AirAbsorptionGainHf
|
|
{
|
|
get => Al.GetEffectf(Effect.Name, AL_REVERB_AIR_ABSORPTION_GAINHF);
|
|
set => Al.PInvoke.Effectf(Effect.Name, AL_REVERB_AIR_ABSORPTION_GAINHF, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets/sets <c>AL_REVERB_ROOM_ROLLOFF_FACTOR</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// range 0.0f to 10.0f; default 0.0f.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float RoomRolloffFactor
|
|
{
|
|
get => Al.GetEffectf(Effect.Name, AL_REVERB_ROOM_ROLLOFF_FACTOR);
|
|
set => Al.PInvoke.Effectf(Effect.Name, AL_REVERB_ROOM_ROLLOFF_FACTOR, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets/sets <c>AL_REVERB_DECAY_HFLIMIT</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// range 0 to 1; default 1.
|
|
/// </para>
|
|
/// </remarks>
|
|
public bool DecayHfLimit
|
|
{
|
|
get => Al.GetEffecti(Effect.Name, AL_REVERB_DECAY_HFLIMIT) != AL_FALSE;
|
|
set => Al.PInvoke.Effecti(Effect.Name, AL_REVERB_DECAY_HFLIMIT, value ? AL_TRUE : AL_FALSE);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sets the standard-reverb subset of a full EAX reverb parameter set (e.g. a <see cref="ReverbPreset"/> value); the EAX-only fields (pans, LF, echo, modulation) are ignored.
|
|
/// </summary>
|
|
public void Set(in ReverbProperties properties)
|
|
{
|
|
Al.PInvoke.Effectf(Effect.Name, AL_REVERB_DENSITY, properties.Density);
|
|
Al.PInvoke.Effectf(Effect.Name, AL_REVERB_DIFFUSION, properties.Diffusion);
|
|
Al.PInvoke.Effectf(Effect.Name, AL_REVERB_GAIN, properties.Gain);
|
|
Al.PInvoke.Effectf(Effect.Name, AL_REVERB_GAINHF, properties.GainHf);
|
|
Al.PInvoke.Effectf(Effect.Name, AL_REVERB_DECAY_TIME, properties.DecayTime);
|
|
Al.PInvoke.Effectf(Effect.Name, AL_REVERB_DECAY_HFRATIO, properties.DecayHfRatio);
|
|
Al.PInvoke.Effectf(Effect.Name, AL_REVERB_REFLECTIONS_GAIN, properties.ReflectionsGain);
|
|
Al.PInvoke.Effectf(Effect.Name, AL_REVERB_REFLECTIONS_DELAY, properties.ReflectionsDelay);
|
|
Al.PInvoke.Effectf(Effect.Name, AL_REVERB_LATE_REVERB_GAIN, properties.LateReverbGain);
|
|
Al.PInvoke.Effectf(Effect.Name, AL_REVERB_LATE_REVERB_DELAY, properties.LateReverbDelay);
|
|
Al.PInvoke.Effectf(Effect.Name, AL_REVERB_AIR_ABSORPTION_GAINHF, properties.AirAbsorptionGainHf);
|
|
Al.PInvoke.Effectf(Effect.Name, AL_REVERB_ROOM_ROLLOFF_FACTOR, properties.RoomRolloffFactor);
|
|
Al.PInvoke.Effecti(Effect.Name, AL_REVERB_DECAY_HFLIMIT, properties.DecayHfLimit ? AL_TRUE : AL_FALSE);
|
|
}
|
|
}
|
|
}
|