//
// Generated by Brutal.OpenAl.Generate; do not edit by hand.
#nullable enable
using static Brutal.OpenAlApi.Al.Constants;
namespace Brutal.OpenAlApi
{
///
/// The typed parameter surface of an AL_EFFECT_AUTOWAH effect (see ); requires ALC_EXT_EFX.
///
public unsafe readonly partial struct AutowahEffect
{
///
/// The underlying effect handle.
///
public readonly AlEffect Effect;
///
/// Wraps an effect handle without validating its type; prefer the checked conversion.
///
public AutowahEffect(AlEffect effect) => Effect = effect;
///
/// The wrapper converts freely to its underlying handle.
///
public static implicit operator AlEffect(AutowahEffect effect) => effect.Effect;
///
/// Converts a raw handle to the typed wrapper, checking .
///
///
/// The effect's type is not .
public static explicit operator AutowahEffect(AlEffect effect) =>
effect.Type == AlEffectType.Autowah
? new AutowahEffect(effect)
: throw new InvalidCastException($"Effect {effect.Name} has type {effect.Type}, not Autowah.");
///
/// Deletes the underlying effect ().
///
public void Delete() => Effect.Delete();
///
/// Gets/sets AL_AUTOWAH_ATTACK_TIME.
///
///
///
/// range 0.0001f to 1.0f; default 0.06f.
///
///
public float AttackTime
{
get => Al.GetEffectf(Effect.Name, AL_AUTOWAH_ATTACK_TIME);
set => Al.PInvoke.Effectf(Effect.Name, AL_AUTOWAH_ATTACK_TIME, value);
}
///
/// Gets/sets AL_AUTOWAH_RELEASE_TIME.
///
///
///
/// range 0.0001f to 1.0f; default 0.06f.
///
///
public float ReleaseTime
{
get => Al.GetEffectf(Effect.Name, AL_AUTOWAH_RELEASE_TIME);
set => Al.PInvoke.Effectf(Effect.Name, AL_AUTOWAH_RELEASE_TIME, value);
}
///
/// Gets/sets AL_AUTOWAH_RESONANCE.
///
///
///
/// range 2.0f to 1000.0f; default 1000.0f.
///
///
public float Resonance
{
get => Al.GetEffectf(Effect.Name, AL_AUTOWAH_RESONANCE);
set => Al.PInvoke.Effectf(Effect.Name, AL_AUTOWAH_RESONANCE, value);
}
///
/// Gets/sets AL_AUTOWAH_PEAK_GAIN.
///
///
///
/// range 0.00003f to 31621.0f; default 11.22f.
///
///
public float PeakGain
{
get => Al.GetEffectf(Effect.Name, AL_AUTOWAH_PEAK_GAIN);
set => Al.PInvoke.Effectf(Effect.Name, AL_AUTOWAH_PEAK_GAIN, value);
}
}
}