mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 21:18:24 +01:00
first
This commit is contained in:
parent
bd62d51ec9
commit
b578433e37
1 changed files with 784842 additions and 0 deletions
58
Brutal.OpenAl/Generated/Al/Efx/CompressorEffect.gen.cs
Normal file
58
Brutal.OpenAl/Generated/Al/Efx/CompressorEffect.gen.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
// <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_COMPRESSOR</c> effect (see <see cref="AlEffect"/>); requires <c>ALC_EXT_EFX</c>.
|
||||
/// </summary>
|
||||
public unsafe readonly partial struct CompressorEffect
|
||||
{
|
||||
/// <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 CompressorEffect(AlEffect effect) => Effect = effect;
|
||||
|
||||
/// <summary>
|
||||
/// The wrapper converts freely to its underlying handle.
|
||||
/// </summary>
|
||||
public static implicit operator AlEffect(CompressorEffect 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.Compressor"/>.</exception>
|
||||
public static explicit operator CompressorEffect(AlEffect effect) =>
|
||||
effect.Type == AlEffectType.Compressor
|
||||
? new CompressorEffect(effect)
|
||||
: throw new InvalidCastException($"Effect {effect.Name} has type {effect.Type}, not Compressor.");
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the underlying effect (<see cref="AlEffect.Delete"/>).
|
||||
/// </summary>
|
||||
public void Delete() => Effect.Delete();
|
||||
|
||||
/// <summary>
|
||||
/// Gets/sets <c>AL_COMPRESSOR_ONOFF</c>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// range 0 to 1; default 1.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public bool Enabled
|
||||
{
|
||||
get => Al.GetEffecti(Effect.Name, AL_COMPRESSOR_ONOFF) != AL_FALSE;
|
||||
set => Al.PInvoke.Effecti(Effect.Name, AL_COMPRESSOR_ONOFF, value ? AL_TRUE : AL_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue