brutal/Brutal.OpenAl/Generated/Al/Efx/RingModulatorEffect.gen.cs
Rian Drake b578433e37 first
2026-10-15 17:10:50 +13:00

86 lines
3.1 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_RING_MODULATOR</c> effect (see <see cref="AlEffect"/>); requires <c>ALC_EXT_EFX</c>.
/// </summary>
public unsafe readonly partial struct RingModulatorEffect
{
/// <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 RingModulatorEffect(AlEffect effect) => Effect = effect;
/// <summary>
/// The wrapper converts freely to its underlying handle.
/// </summary>
public static implicit operator AlEffect(RingModulatorEffect 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.RingModulator"/>.</exception>
public static explicit operator RingModulatorEffect(AlEffect effect) =>
effect.Type == AlEffectType.RingModulator
? new RingModulatorEffect(effect)
: throw new InvalidCastException($"Effect {effect.Name} has type {effect.Type}, not RingModulator.");
/// <summary>
/// Deletes the underlying effect (<see cref="AlEffect.Delete"/>).
/// </summary>
public void Delete() => Effect.Delete();
/// <summary>
/// Gets/sets <c>AL_RING_MODULATOR_FREQUENCY</c>.
/// </summary>
/// <remarks>
/// <para>
/// range 0.0f to 8000.0f; default 440.0f.
/// </para>
/// </remarks>
public float Frequency
{
get => Al.GetEffectf(Effect.Name, AL_RING_MODULATOR_FREQUENCY);
set => Al.PInvoke.Effectf(Effect.Name, AL_RING_MODULATOR_FREQUENCY, value);
}
/// <summary>
/// Gets/sets <c>AL_RING_MODULATOR_HIGHPASS_CUTOFF</c>.
/// </summary>
/// <remarks>
/// <para>
/// range 0.0f to 24000.0f; default 800.0f.
/// </para>
/// </remarks>
public float HighpassCutoff
{
get => Al.GetEffectf(Effect.Name, AL_RING_MODULATOR_HIGHPASS_CUTOFF);
set => Al.PInvoke.Effectf(Effect.Name, AL_RING_MODULATOR_HIGHPASS_CUTOFF, value);
}
/// <summary>
/// Gets/sets <c>AL_RING_MODULATOR_WAVEFORM</c>.
/// </summary>
/// <remarks>
/// <para>
/// range 0 to 2; default 0.
/// </para>
/// </remarks>
public AlRingModulatorWaveform Waveform
{
get => (AlRingModulatorWaveform)Al.GetEffecti(Effect.Name, AL_RING_MODULATOR_WAVEFORM);
set => Al.PInvoke.Effecti(Effect.Name, AL_RING_MODULATOR_WAVEFORM, (int)value);
}
}
}