Table of Contents

Class EffectParameter

Namespace
NAudio.Effects
Assembly
NAudio.Core.dll

A thin, delegate-backed facade over one of an effect's existing typed properties, describing it enough to drive a generic UI (or a VST3-style host, presets, automation). It does not store state — get/set forward to the effect — so the effect's property remains the single source of truth and IAudioEffect is unaffected. Build these with the static factory methods.

public sealed class EffectParameter
Inheritance
EffectParameter
Inherited Members

Properties

Choices

Choice labels for Choice; otherwise null.

public IReadOnlyList<string> Choices { get; }

Property Value

IReadOnlyList<string>

DefaultValue

The value at the time the parameter was created.

public float DefaultValue { get; }

Property Value

float

IsReadOnly

True for a Meter (set is ignored).

public bool IsReadOnly { get; }

Property Value

bool

Kind

The control kind.

public EffectParameterKind Kind { get; }

Property Value

EffectParameterKind

Maximum

Maximum value (also upper display bound for a meter).

public float Maximum { get; }

Property Value

float

Minimum

Minimum value (also lower display bound for a meter).

public float Minimum { get; }

Property Value

float

Name

Display name.

public string Name { get; }

Property Value

string

Unit

Unit string for display (e.g. "dB", "Hz", "ms"); empty if none.

public string Unit { get; }

Property Value

string

Value

The live value, read from / written to the underlying effect property. Writes are clamped to [Minimum, Maximum]; writes to a meter are ignored. If a dispatch has been attached (the effect is running behind an audio thread) the clamped write is deferred and applied at the next block boundary on the audio thread; the getter then returns that just-requested value (optimistically) so a UI bound two-way does not snap back before the audio thread has applied it. Otherwise it is applied inline. See ParameterDispatchQueue.

public float Value { get; set; }

Property Value

float

Methods

Choice(string, IReadOnlyList<string>, Func<int>, Action<int>)

Creates a one-of-N choice parameter (Value is the index).

public static EffectParameter Choice(string name, IReadOnlyList<string> choices, Func<int> getter, Action<int> setter)

Parameters

name string
choices IReadOnlyList<string>
getter Func<int>
setter Action<int>

Returns

EffectParameter

Continuous(string, string, float, float, Func<float>, Action<float>)

Creates a continuous numeric parameter.

public static EffectParameter Continuous(string name, string unit, float minimum, float maximum, Func<float> getter, Action<float> setter)

Parameters

name string
unit string
minimum float
maximum float
getter Func<float>
setter Action<float>

Returns

EffectParameter

Meter(string, string, float, float, Func<float>)

Creates a read-only meter parameter (e.g. live gain reduction).

public static EffectParameter Meter(string name, string unit, float minimum, float maximum, Func<float> getter)

Parameters

name string
unit string
minimum float
maximum float
getter Func<float>

Returns

EffectParameter

Toggle(string, Func<bool>, Action<bool>)

Creates an on/off parameter.

public static EffectParameter Toggle(string name, Func<bool> getter, Action<bool> setter)

Parameters

name string
getter Func<bool>
setter Action<bool>

Returns

EffectParameter