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

55 lines
2.2 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_DEDICATED_LOW_FREQUENCY_EFFECT</c> effect (see <see cref="AlEffect"/>); requires <c>ALC_EXT_EFX</c>. Provided by <c>ALC_EXT_DEDICATED</c>.
/// </summary>
public unsafe readonly partial struct DedicatedLowFrequencyEffect
{
/// <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 DedicatedLowFrequencyEffect(AlEffect effect) => Effect = effect;
/// <summary>
/// The wrapper converts freely to its underlying handle.
/// </summary>
public static implicit operator AlEffect(DedicatedLowFrequencyEffect 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.DedicatedLowFrequencyEffect"/>.</exception>
public static explicit operator DedicatedLowFrequencyEffect(AlEffect effect) =>
effect.Type == AlEffectType.DedicatedLowFrequencyEffect
? new DedicatedLowFrequencyEffect(effect)
: throw new InvalidCastException(
$"Effect {effect.Name} has type {effect.Type}, not DedicatedLowFrequencyEffect."
);
/// <summary>
/// Deletes the underlying effect (<see cref="AlEffect.Delete"/>).
/// </summary>
public void Delete() => Effect.Delete();
/// <summary>
/// Gets/sets <c>AL_DEDICATED_GAIN</c>.
/// </summary>
public float Gain
{
get => Al.GetEffectf(Effect.Name, AL_DEDICATED_GAIN);
set => Al.PInvoke.Effectf(Effect.Name, AL_DEDICATED_GAIN, value);
}
}
}