Class MusicFadeCurveEvaluator
Evaluates the remaining-volume gain of a tail fade-out for a given MusicFadeCurve.
Platform-agnostic so it can be unit tested and shared between the runtime fade and editor previews.
Inherited Members
Namespace: Serenity.MusicPlayer.Domain.Services
Assembly: Serenity.MusicPlayer.Domain.dll
Syntax
public static class MusicFadeCurveEvaluator
Remarks
Progress t runs from 0 at the start of the fade to 1 at the end; the returned gain runs from 1
(full volume) down to 0 (silence) and is used as a multiplier on the source's starting volume.
Methods
Evaluate(MusicFadeCurve, float, float[])
Returns the volume gain multiplier at fade progress t for the given curve.
Declaration
public static float Evaluate(MusicFadeCurve curve, float t, float[] customSamples = null)
Parameters
| Type | Name | Description |
|---|---|---|
| MusicFadeCurve | curve | The fade shape to evaluate. |
| float | t | Fade progress in the range [0, 1]; values outside are clamped. |
| float[] | customSamples | Gain table sampled uniformly over [0, 1], used only when
|
Returns
| Type | Description |
|---|---|
| float | The remaining-volume gain in the range [0, 1] (1 at the start of the fade, 0 at the end). |